From bbb1ed696c3ddf609db84822d88d32f75c3fa1af Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 19 Mar 2012 12:24:43 -0400 Subject: [PATCH] license changed to LGPL: added COPYING file, changed source file comments Signed-off-by: Casey Bodley --- COPYING | 165 ++++ daemon/acl.c | 36 +- daemon/callback_server.c | 36 +- daemon/callback_xdr.c | 35 +- daemon/daemon_debug.c | 35 +- daemon/daemon_debug.h | 35 +- daemon/delegation.c | 35 +- daemon/delegation.h | 35 +- daemon/from_kernel.h | 35 +- daemon/getattr.c | 35 +- daemon/idmap.c | 35 +- daemon/idmap.h | 35 +- daemon/list.h | 35 +- daemon/lock.c | 35 +- daemon/lookup.c | 35 +- daemon/mount.c | 35 +- daemon/name_cache.c | 36 +- daemon/name_cache.h | 35 +- daemon/namespace.c | 35 +- daemon/nfs41.h | 35 +- daemon/nfs41_callback.h | 35 +- daemon/nfs41_client.c | 35 +- daemon/nfs41_compound.c | 35 +- daemon/nfs41_compound.h | 35 +- daemon/nfs41_const.h | 35 +- daemon/nfs41_daemon.c | 35 +- daemon/nfs41_ops.c | 35 +- daemon/nfs41_ops.h | 35 +- daemon/nfs41_rpc.c | 35 +- daemon/nfs41_server.c | 35 +- daemon/nfs41_session.c | 35 +- daemon/nfs41_superblock.c | 35 +- daemon/nfs41_types.h | 45 +- daemon/nfs41_xdr.c | 35 +- daemon/nfs41_xdr.h | 35 +- daemon/open.c | 35 +- daemon/pnfs.h | 35 +- daemon/pnfs_debug.c | 35 +- daemon/pnfs_device.c | 35 +- daemon/pnfs_io.c | 35 +- daemon/pnfs_layout.c | 35 +- daemon/readdir.c | 35 +- daemon/readwrite.c | 35 +- daemon/recovery.c | 35 +- daemon/recovery.h | 35 +- daemon/setattr.c | 35 +- daemon/symlink.c | 35 +- daemon/upcall.c | 35 +- daemon/upcall.h | 35 +- daemon/util.c | 35 +- daemon/util.h | 35 +- daemon/volume.c | 35 +- dll/dllmain.c | 35 +- dll/nfs41_np.c | 35 +- dll/nfs41_np.h | 35 +- dll/options.c | 35 +- dll/options.h | 36 +- install/nfs_install.c | 36 +- install/nfsreginst.c | 36 +- install/nfsreginst.h | 36 +- libtirpc/src/auth_none.c | 421 ++++---- libtirpc/src/auth_sspi.c | 35 +- libtirpc/src/auth_unix.c | 803 ++++++++------- libtirpc/src/authsspi_prot.c | 35 +- libtirpc/src/clnt_generic.c | 943 +++++++++--------- libtirpc/src/clnt_vc.c | 36 +- libtirpc/src/rpc_prot.c | 815 ++++++++------- libtirpc/src/wintirpc.c | 36 +- libtirpc/src/xdr_rec.c | 1688 ++++++++++++++++---------------- libtirpc/tirpc/reentrant.h | 365 ++++--- libtirpc/tirpc/rpc/auth.h | 817 ++++++++-------- libtirpc/tirpc/rpc/auth_gss.h | 298 +++--- libtirpc/tirpc/rpc/auth_sspi.h | 35 +- libtirpc/tirpc/rpc/clnt.h | 35 +- libtirpc/tirpc/rpc/rpc_msg.h | 485 +++++---- libtirpc/tirpc/rpc/types.h | 312 +++--- libtirpc/tirpc/wintirpc.h | 34 +- mount/enum.c | 35 +- mount/mount.c | 35 +- mount/options.c | 35 +- mount/options.h | 35 +- sys/nfs41_debug.c | 35 +- sys/nfs41_debug.h | 35 +- sys/nfs41_driver.c | 35 +- sys/nfs41_driver.h | 35 +- sys/wmlkm.c | 36 +- sys/wmlkm.h | 35 +- tests/asio/asio.c | 33 +- 88 files changed, 4784 insertions(+), 5040 deletions(-) create mode 100644 COPYING diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..b14ca0a --- /dev/null +++ b/COPYING @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/daemon/acl.c b/daemon/acl.c index 0ef5f01..9107fef 100644 --- a/daemon/acl.c +++ b/daemon/acl.c @@ -1,28 +1,24 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ + #include #include #include diff --git a/daemon/callback_server.c b/daemon/callback_server.c index edd33dc..a6e758e 100644 --- a/daemon/callback_server.c +++ b/daemon/callback_server.c @@ -1,28 +1,24 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ + #include #include diff --git a/daemon/callback_xdr.c b/daemon/callback_xdr.c index 041b4e6..364ca85 100644 --- a/daemon/callback_xdr.c +++ b/daemon/callback_xdr.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include "nfs41_callback.h" diff --git a/daemon/daemon_debug.c b/daemon/daemon_debug.c index 07dd030..40b3d6f 100644 --- a/daemon/daemon_debug.c +++ b/daemon/daemon_debug.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/daemon_debug.h b/daemon/daemon_debug.h index 901ce01..f484d58 100644 --- a/daemon/daemon_debug.h +++ b/daemon/daemon_debug.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef _DAEMON_DEBUG_ diff --git a/daemon/delegation.c b/daemon/delegation.c index 7b2611b..ecb0bcb 100644 --- a/daemon/delegation.c +++ b/daemon/delegation.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include "delegation.h" diff --git a/daemon/delegation.h b/daemon/delegation.h index 174cc1b..bd1f653 100644 --- a/daemon/delegation.h +++ b/daemon/delegation.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef DELEGATION_H diff --git a/daemon/from_kernel.h b/daemon/from_kernel.h index 4608072..3d51573 100644 --- a/daemon/from_kernel.h +++ b/daemon/from_kernel.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef _NFS41_DAEMON_ diff --git a/daemon/getattr.c b/daemon/getattr.c index 09fd849..541237b 100644 --- a/daemon/getattr.c +++ b/daemon/getattr.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/idmap.c b/daemon/idmap.c index f59559a..f38ec71 100644 --- a/daemon/idmap.c +++ b/daemon/idmap.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/idmap.h b/daemon/idmap.h index 11e04d5..6a78476 100644 --- a/daemon/idmap.h +++ b/daemon/idmap.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef IDMAP_H diff --git a/daemon/list.h b/daemon/list.h index 5475110..5159b0d 100644 --- a/daemon/list.h +++ b/daemon/list.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef NFS41_LIST_H diff --git a/daemon/lock.c b/daemon/lock.c index 1ff0339..9cf4d4e 100644 --- a/daemon/lock.c +++ b/daemon/lock.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/lookup.c b/daemon/lookup.c index 13ab6b0..7ea26dc 100644 --- a/daemon/lookup.c +++ b/daemon/lookup.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/mount.c b/daemon/mount.c index 3f5cd1d..97ce241 100644 --- a/daemon/mount.c +++ b/daemon/mount.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/name_cache.c b/daemon/name_cache.c index 786aef7..b75e7fd 100644 --- a/daemon/name_cache.c +++ b/daemon/name_cache.c @@ -1,28 +1,24 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ + #include #include #include diff --git a/daemon/name_cache.h b/daemon/name_cache.h index 358eb2b..fbea8c5 100644 --- a/daemon/name_cache.h +++ b/daemon/name_cache.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41_DAEMON_NAME_CACHE_H__ diff --git a/daemon/namespace.c b/daemon/namespace.c index 52ebfa2..ab16f49 100644 --- a/daemon/namespace.c +++ b/daemon/namespace.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/nfs41.h b/daemon/nfs41.h index 94c4ebb..8ced537 100644 --- a/daemon/nfs41.h +++ b/daemon/nfs41.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41__ diff --git a/daemon/nfs41_callback.h b/daemon/nfs41_callback.h index c654a73..8e5190c 100644 --- a/daemon/nfs41_callback.h +++ b/daemon/nfs41_callback.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41_CALLBACK_H__ diff --git a/daemon/nfs41_client.c b/daemon/nfs41_client.c index 5692f35..0460fc5 100644 --- a/daemon/nfs41_client.c +++ b/daemon/nfs41_client.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/nfs41_compound.c b/daemon/nfs41_compound.c index 10fd01d..da7834c 100644 --- a/daemon/nfs41_compound.c +++ b/daemon/nfs41_compound.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/nfs41_compound.h b/daemon/nfs41_compound.h index 7478956..d222559 100644 --- a/daemon/nfs41_compound.h +++ b/daemon/nfs41_compound.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41_DAEMON_COMPOUND_H__ diff --git a/daemon/nfs41_const.h b/daemon/nfs41_const.h index a3ad017..874623f 100644 --- a/daemon/nfs41_const.h +++ b/daemon/nfs41_const.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41_NFS_CONST_H__ diff --git a/daemon/nfs41_daemon.c b/daemon/nfs41_daemon.c index e3a7792..599f246 100644 --- a/daemon/nfs41_daemon.c +++ b/daemon/nfs41_daemon.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/nfs41_ops.c b/daemon/nfs41_ops.c index db86d51..fc158ce 100644 --- a/daemon/nfs41_ops.c +++ b/daemon/nfs41_ops.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/nfs41_ops.h b/daemon/nfs41_ops.h index 4e40086..faa247b 100644 --- a/daemon/nfs41_ops.h +++ b/daemon/nfs41_ops.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41_NFS_OPS_H__ diff --git a/daemon/nfs41_rpc.c b/daemon/nfs41_rpc.c index a77883a..65dd545 100644 --- a/daemon/nfs41_rpc.c +++ b/daemon/nfs41_rpc.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include "nfs41_ops.h" diff --git a/daemon/nfs41_server.c b/daemon/nfs41_server.c index 22eb306..d58c03a 100644 --- a/daemon/nfs41_server.c +++ b/daemon/nfs41_server.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/nfs41_session.c b/daemon/nfs41_session.c index ff75363..d1e9126 100644 --- a/daemon/nfs41_session.c +++ b/daemon/nfs41_session.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/nfs41_superblock.c b/daemon/nfs41_superblock.c index ee8130f..cf2bf4a 100644 --- a/daemon/nfs41_superblock.c +++ b/daemon/nfs41_superblock.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/nfs41_types.h b/daemon/nfs41_types.h index ae9867c..1e5e716 100644 --- a/daemon/nfs41_types.h +++ b/daemon/nfs41_types.h @@ -1,28 +1,23 @@ -/* Copyright (c) 2010, 2011 -* The Regents of the University of Michigan -* All Rights Reserved -* -* Olga Kornievskaia -* Casey Bodley -* -* Permission is granted to use, copy and redistribute this software -* for noncommercial education and research purposes, so long as no -* fee is charged, and so long as the name of the University of Michigan -* is not used in any advertising or publicity pertaining to the use -* or distribution of this software without specific, written prior -* authorization. Permission to modify or otherwise create derivative -* works of this software is not granted. -* -* This software is provided as is, without representation or warranty -* of any kind either express or implied, including without limitation -* the implied warranties of merchantability, fitness for a particular -* purpose, or noninfringement. The Regents of the University of -* Michigan shall not be liable for any damages, including special, -* indirect, incidental, or consequential damages, with respect to any -* claim arising out of or in connection with the use of the software, -* even if it has been or is hereafter advised of the possibility of -* such damages. -*/ +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * + * Olga Kornievskaia + * Casey Bodley + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA + */ #ifndef __NFS41_DAEMON_TYPES_H__ #define __NFS41_DAEMON_TYPES_H__ diff --git a/daemon/nfs41_xdr.c b/daemon/nfs41_xdr.c index 81a1a7b..9462033 100644 --- a/daemon/nfs41_xdr.c +++ b/daemon/nfs41_xdr.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/nfs41_xdr.h b/daemon/nfs41_xdr.h index caf30e5..9a3fc61 100644 --- a/daemon/nfs41_xdr.h +++ b/daemon/nfs41_xdr.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41_NFS_XDR_H__ diff --git a/daemon/open.c b/daemon/open.c index 133fc30..e52531c 100644 --- a/daemon/open.c +++ b/daemon/open.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/pnfs.h b/daemon/pnfs.h index eb20c6f..f915948 100644 --- a/daemon/pnfs.h +++ b/daemon/pnfs.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __PNFS_H__ diff --git a/daemon/pnfs_debug.c b/daemon/pnfs_debug.c index 6ffa867..fc55c34 100644 --- a/daemon/pnfs_debug.c +++ b/daemon/pnfs_debug.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/pnfs_device.c b/daemon/pnfs_device.c index e19bd99..4b0520c 100644 --- a/daemon/pnfs_device.c +++ b/daemon/pnfs_device.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/pnfs_io.c b/daemon/pnfs_io.c index 647ef9e..6386ad0 100644 --- a/daemon/pnfs_io.c +++ b/daemon/pnfs_io.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/pnfs_layout.c b/daemon/pnfs_layout.c index b8a72c1..b3e8506 100644 --- a/daemon/pnfs_layout.c +++ b/daemon/pnfs_layout.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/readdir.c b/daemon/readdir.c index 23dc9f4..648b592 100644 --- a/daemon/readdir.c +++ b/daemon/readdir.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/readwrite.c b/daemon/readwrite.c index 5ff208c..3a1e080 100644 --- a/daemon/readwrite.c +++ b/daemon/readwrite.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/recovery.c b/daemon/recovery.c index ddd9e27..7713602 100644 --- a/daemon/recovery.c +++ b/daemon/recovery.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/recovery.h b/daemon/recovery.h index 2b91c1b..b16044e 100644 --- a/daemon/recovery.h +++ b/daemon/recovery.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef RECOVERY_H diff --git a/daemon/setattr.c b/daemon/setattr.c index c9a577c..cad4b79 100644 --- a/daemon/setattr.c +++ b/daemon/setattr.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/symlink.c b/daemon/symlink.c index 47b0b37..2b57825 100644 --- a/daemon/symlink.c +++ b/daemon/symlink.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/upcall.c b/daemon/upcall.c index 35b3b13..16fa4a4 100644 --- a/daemon/upcall.c +++ b/daemon/upcall.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/upcall.h b/daemon/upcall.h index 64c3a61..560722f 100644 --- a/daemon/upcall.h +++ b/daemon/upcall.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41_DAEMON_UPCALL_H__ diff --git a/daemon/util.c b/daemon/util.c index dc63e1a..86f9e77 100644 --- a/daemon/util.c +++ b/daemon/util.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/daemon/util.h b/daemon/util.h index 89b62a4..07acf15 100644 --- a/daemon/util.h +++ b/daemon/util.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41_DAEMON_UTIL_H__ diff --git a/daemon/volume.c b/daemon/volume.c index cdb1a08..fe662ba 100644 --- a/daemon/volume.c +++ b/daemon/volume.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/dll/dllmain.c b/dll/dllmain.c index 834ed07..b027350 100644 --- a/dll/dllmain.c +++ b/dll/dllmain.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ /*++ diff --git a/dll/nfs41_np.c b/dll/nfs41_np.c index b4dc32f..8b259bb 100644 --- a/dll/nfs41_np.c +++ b/dll/nfs41_np.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/dll/nfs41_np.h b/dll/nfs41_np.h index fa1aa55..aed9c35 100644 --- a/dll/nfs41_np.h +++ b/dll/nfs41_np.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41_NP_H__ diff --git a/dll/options.c b/dll/options.c index 72b1b81..e400e31 100644 --- a/dll/options.c +++ b/dll/options.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/dll/options.h b/dll/options.h index 2df3f37..e6f16ff 100644 --- a/dll/options.h +++ b/dll/options.h @@ -1,24 +1,22 @@ -/* Copyright (c) 2010 - * The Regents of the University of Michigan - * All Rights Reserved +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * Olga Kornievskaia + * Casey Bodley * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41_NP_OPTIONS_H__ diff --git a/install/nfs_install.c b/install/nfs_install.c index 5f36b13..d1e6b74 100644 --- a/install/nfs_install.c +++ b/install/nfs_install.c @@ -1,28 +1,24 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ + /* * * This file is just for prepending nfs41_driver to the diff --git a/install/nfsreginst.c b/install/nfsreginst.c index 2e891a8..f4bb3e4 100644 --- a/install/nfsreginst.c +++ b/install/nfsreginst.c @@ -1,28 +1,24 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ + /*++ Module Name: diff --git a/install/nfsreginst.h b/install/nfsreginst.h index a308b98..93bf954 100644 --- a/install/nfsreginst.h +++ b/install/nfsreginst.h @@ -1,28 +1,24 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ + /*++ Copyright (c) 1997 - 1999 Microsoft Corporation diff --git a/libtirpc/src/auth_none.c b/libtirpc/src/auth_none.c index 3d90992..e2793c6 100644 --- a/libtirpc/src/auth_none.c +++ b/libtirpc/src/auth_none.c @@ -1,218 +1,213 @@ -/* - * Copyright (c) 2009, Sun Microsystems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of Sun Microsystems, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* -#if defined(LIBC_SCCS) && !defined(lint) -static char *sccsid = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro"; -static char *sccsid = "@(#)auth_none.c 2.1 88/07/29 4.0 RPCSRC"; -#endif -//#include -__FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 obrien Exp $"); -*/ - - -/* - * auth_none.c - * Creates a client authentication handle for passing "null" - * credentials and verifiers to remote systems. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ - -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of Sun Microsystems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* +#if defined(LIBC_SCCS) && !defined(lint) +static char *sccsid = "@(#)auth_none.c 1.19 87/08/11 Copyr 1984 Sun Micro"; +static char *sccsid = "@(#)auth_none.c 2.1 88/07/29 4.0 RPCSRC"; +#endif +//#include +__FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 obrien Exp $"); +*/ + + +/* + * auth_none.c + * Creates a client authentication handle for passing "null" + * credentials and verifiers to remote systems. + * + * Copyright (C) 1984, Sun Microsystems, Inc. + */ + +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. - */ -#include -//#include -#include -#include -#include -#include -#include -#include - -#define MAX_MARSHAL_SIZE 20 - -/* - * Authenticator operations routines - */ - -static bool_t authnone_marshal (AUTH *, XDR *, u_int *); -static void authnone_verf (AUTH *); -static bool_t authnone_validate (AUTH *, struct opaque_auth *, u_int); -static bool_t authnone_refresh (AUTH *, void *); -static void authnone_destroy (AUTH *); - -extern bool_t xdr_opaque_auth(); - -static struct auth_ops *authnone_ops(); - -static struct authnone_private { - AUTH no_client; - char marshalled_client[MAX_MARSHAL_SIZE]; - u_int mcnt; -} *authnone_private; - -AUTH * -authnone_create() -{ - struct authnone_private *ap = authnone_private; - XDR xdr_stream; - XDR *xdrs; - extern mutex_t authnone_lock; - - mutex_lock(&authnone_lock); - if (ap == 0) { - ap = (struct authnone_private *)calloc(1, sizeof (*ap)); - if (ap == 0) { - mutex_unlock(&authnone_lock); - return (0); - } - authnone_private = ap; - } - if (!ap->mcnt) { - ap->no_client.ah_cred = ap->no_client.ah_verf = _null_auth; - ap->no_client.ah_ops = authnone_ops(); - xdrs = &xdr_stream; - xdrmem_create(xdrs, ap->marshalled_client, - (u_int)MAX_MARSHAL_SIZE, XDR_ENCODE); - (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_cred); - (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_verf); - ap->mcnt = XDR_GETPOS(xdrs); - XDR_DESTROY(xdrs); - } - mutex_unlock(&authnone_lock); - return (&ap->no_client); -} - -/*ARGSUSED*/ -static bool_t -authnone_marshal(AUTH *client, XDR *xdrs, u_int *seq) -{ - struct authnone_private *ap; - bool_t dummy; - extern mutex_t authnone_lock; - - assert(xdrs != NULL); - - ap = authnone_private; - if (ap == NULL) { - mutex_unlock(&authnone_lock); - return (FALSE); - } - dummy = (*xdrs->x_ops->x_putbytes)(xdrs, - ap->marshalled_client, ap->mcnt); - mutex_unlock(&authnone_lock); - return (dummy); -} - -/* All these unused parameters are required to keep ANSI-C from grumbling */ -/*ARGSUSED*/ -static void -authnone_verf(AUTH *client) -{ -} - -/*ARGSUSED*/ -static bool_t -authnone_validate(AUTH *client, struct opaque_auth *opaque, u_int seq) -{ - - return (TRUE); -} - -/*ARGSUSED*/ -static bool_t -authnone_refresh(AUTH *client, void *dummy) -{ - - return (FALSE); -} - -/*ARGSUSED*/ -static void -authnone_destroy(AUTH *client) -{ -} - -static int -authnone_wrap(AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args) -{ - return ((*func)(xdrs, args)); -} - -static int -authnone_unwrap(AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args, u_int seq) -{ - return ((*func)(xdrs, args)); -} - -static struct auth_ops * -authnone_ops() -{ - static struct auth_ops ops; - extern mutex_t ops_lock; - -/* VARIABLES PROTECTED BY ops_lock: ops */ - - mutex_lock(&ops_lock); - if (ops.ah_nextverf == NULL) { - ops.ah_nextverf = authnone_verf; - ops.ah_marshal = authnone_marshal; - ops.ah_validate = authnone_validate; - ops.ah_refresh = authnone_refresh; - ops.ah_destroy = authnone_destroy; - ops.ah_wrap = authnone_wrap; - ops.ah_unwrap = authnone_unwrap; - } - mutex_unlock(&ops_lock); - return (&ops); -} + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA + */ + +#include +//#include +#include +#include +#include +#include +#include +#include + +#define MAX_MARSHAL_SIZE 20 + +/* + * Authenticator operations routines + */ + +static bool_t authnone_marshal (AUTH *, XDR *, u_int *); +static void authnone_verf (AUTH *); +static bool_t authnone_validate (AUTH *, struct opaque_auth *, u_int); +static bool_t authnone_refresh (AUTH *, void *); +static void authnone_destroy (AUTH *); + +extern bool_t xdr_opaque_auth(); + +static struct auth_ops *authnone_ops(); + +static struct authnone_private { + AUTH no_client; + char marshalled_client[MAX_MARSHAL_SIZE]; + u_int mcnt; +} *authnone_private; + +AUTH * +authnone_create() +{ + struct authnone_private *ap = authnone_private; + XDR xdr_stream; + XDR *xdrs; + extern mutex_t authnone_lock; + + mutex_lock(&authnone_lock); + if (ap == 0) { + ap = (struct authnone_private *)calloc(1, sizeof (*ap)); + if (ap == 0) { + mutex_unlock(&authnone_lock); + return (0); + } + authnone_private = ap; + } + if (!ap->mcnt) { + ap->no_client.ah_cred = ap->no_client.ah_verf = _null_auth; + ap->no_client.ah_ops = authnone_ops(); + xdrs = &xdr_stream; + xdrmem_create(xdrs, ap->marshalled_client, + (u_int)MAX_MARSHAL_SIZE, XDR_ENCODE); + (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_cred); + (void)xdr_opaque_auth(xdrs, &ap->no_client.ah_verf); + ap->mcnt = XDR_GETPOS(xdrs); + XDR_DESTROY(xdrs); + } + mutex_unlock(&authnone_lock); + return (&ap->no_client); +} + +/*ARGSUSED*/ +static bool_t +authnone_marshal(AUTH *client, XDR *xdrs, u_int *seq) +{ + struct authnone_private *ap; + bool_t dummy; + extern mutex_t authnone_lock; + + assert(xdrs != NULL); + + ap = authnone_private; + if (ap == NULL) { + mutex_unlock(&authnone_lock); + return (FALSE); + } + dummy = (*xdrs->x_ops->x_putbytes)(xdrs, + ap->marshalled_client, ap->mcnt); + mutex_unlock(&authnone_lock); + return (dummy); +} + +/* All these unused parameters are required to keep ANSI-C from grumbling */ +/*ARGSUSED*/ +static void +authnone_verf(AUTH *client) +{ +} + +/*ARGSUSED*/ +static bool_t +authnone_validate(AUTH *client, struct opaque_auth *opaque, u_int seq) +{ + + return (TRUE); +} + +/*ARGSUSED*/ +static bool_t +authnone_refresh(AUTH *client, void *dummy) +{ + + return (FALSE); +} + +/*ARGSUSED*/ +static void +authnone_destroy(AUTH *client) +{ +} + +static int +authnone_wrap(AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args) +{ + return ((*func)(xdrs, args)); +} + +static int +authnone_unwrap(AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args, u_int seq) +{ + return ((*func)(xdrs, args)); +} + +static struct auth_ops * +authnone_ops() +{ + static struct auth_ops ops; + extern mutex_t ops_lock; + +/* VARIABLES PROTECTED BY ops_lock: ops */ + + mutex_lock(&ops_lock); + if (ops.ah_nextverf == NULL) { + ops.ah_nextverf = authnone_verf; + ops.ah_marshal = authnone_marshal; + ops.ah_validate = authnone_validate; + ops.ah_refresh = authnone_refresh; + ops.ah_destroy = authnone_destroy; + ops.ah_wrap = authnone_wrap; + ops.ah_unwrap = authnone_unwrap; + } + mutex_unlock(&ops_lock); + return (&ops); +} diff --git a/libtirpc/src/auth_sspi.c b/libtirpc/src/auth_sspi.c index d5acb35..3bd558c 100644 --- a/libtirpc/src/auth_sspi.c +++ b/libtirpc/src/auth_sspi.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/libtirpc/src/auth_unix.c b/libtirpc/src/auth_unix.c index 815fcfa..4757aaa 100644 --- a/libtirpc/src/auth_unix.c +++ b/libtirpc/src/auth_unix.c @@ -1,409 +1,404 @@ -/* - * Copyright (c) 2009, Sun Microsystems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of Sun Microsystems, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -//#include - -/* - * auth_unix.c, Implements UNIX style authentication parameters. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - * - * The system is very weak. The client uses no encryption for it's - * credentials and only sends null verifiers. The server sends backs - * null verifiers or optionally a verifier that suggests a new short hand - * for the credentials. - * - */ - -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of Sun Microsystems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +//#include + +/* + * auth_unix.c, Implements UNIX style authentication parameters. + * + * Copyright (C) 1984, Sun Microsystems, Inc. + * + * The system is very weak. The client uses no encryption for it's + * credentials and only sends null verifiers. The server sends backs + * null verifiers or optionally a verifier that suggests a new short hand + * for the credentials. + * + */ + +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. - */ -#include -//#include -#include -//#include - -#include -//#include -#include -#include -//#include -#include - -#include -#include -#include -#include - -/* auth_unix.c */ -static void authunix_nextverf (AUTH *); -static bool_t authunix_marshal (AUTH *, XDR *, u_int *seq); -static bool_t authunix_validate (AUTH *, struct opaque_auth *, u_int); -static bool_t authunix_refresh (AUTH *, void *); -static void authunix_destroy (AUTH *); -static void marshal_new_auth (AUTH *); -static struct auth_ops *authunix_ops (void); - -/* - * This struct is pointed to by the ah_private field of an auth_handle. - */ -struct audata { - struct opaque_auth au_origcred; /* original credentials */ - struct opaque_auth au_shcred; /* short hand cred */ - u_long au_shfaults; /* short hand cache faults */ - char au_marshed[MAX_AUTH_BYTES]; - u_int au_mpos; /* xdr pos at end of marshed */ -}; -#define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private) - -/* - * Create a unix style authenticator. - * Returns an auth handle with the given stuff in it. - */ -AUTH * -authunix_create(machname, uid, gid, len, aup_gids) - char *machname; - uid_t uid; - gid_t gid; - int len; - gid_t *aup_gids; -{ - struct authunix_parms aup; - char mymem[MAX_AUTH_BYTES]; - struct timeval now; - XDR xdrs; - AUTH *auth; - struct audata *au; - - /* - * Allocate and set up auth handle - */ - au = NULL; - auth = mem_alloc(sizeof(*auth)); -#ifndef _KERNEL - if (auth == NULL) { - // XXX warnx("authunix_create: out of memory"); - goto cleanup_authunix_create; - } -#endif - au = mem_alloc(sizeof(*au)); -#ifndef _KERNEL - if (au == NULL) { - // XXX warnx("authunix_create: out of memory"); - goto cleanup_authunix_create; - } -#endif - auth->ah_ops = authunix_ops(); - auth->ah_private = (caddr_t)au; - auth->ah_verf = au->au_shcred = _null_auth; - au->au_shfaults = 0; - au->au_origcred.oa_base = NULL; - - /* - * fill in param struct from the given params - */ - (void)gettimeofday(&now, NULL); - aup.aup_time = now.tv_sec; - aup.aup_machname = machname; - aup.aup_uid = uid; - aup.aup_gid = gid; - aup.aup_len = (u_int)len; - aup.aup_gids = aup_gids; - - /* - * Serialize the parameters into origcred - */ - xdrmem_create(&xdrs, mymem, MAX_AUTH_BYTES, XDR_ENCODE); - if (! xdr_authunix_parms(&xdrs, &aup)) - abort(); - au->au_origcred.oa_length = len = XDR_GETPOS(&xdrs); - au->au_origcred.oa_flavor = AUTH_UNIX; -#ifdef _KERNEL - au->au_origcred.oa_base = mem_alloc((u_int) len); -#else - if ((au->au_origcred.oa_base = mem_alloc((u_int) len)) == NULL) { - // XXX warnx("authunix_create: out of memory"); - goto cleanup_authunix_create; - } -#endif - memmove(au->au_origcred.oa_base, mymem, (size_t)len); - - /* - * set auth handle to reflect new cred. - */ - auth->ah_cred = au->au_origcred; - marshal_new_auth(auth); - return (auth); -#ifndef _KERNEL - cleanup_authunix_create: - if (auth) - mem_free(auth, sizeof(*auth)); - if (au) { - if (au->au_origcred.oa_base) - mem_free(au->au_origcred.oa_base, (u_int)len); - mem_free(au, sizeof(*au)); - } - return (NULL); -#endif -} - -/* - * Returns an auth handle with parameters determined by doing lots of - * syscalls. - */ -AUTH * -authunix_create_default() -{ - int len; - char machname[MAXHOSTNAMELEN + 1]; - uid_t uid; - gid_t gid; - gid_t gids[NGRPS]; - - if (gethostname(machname, sizeof machname) == -1) - abort(); - machname[sizeof(machname) - 1] = 0; -#if 0 - uid = geteuid(); - gid = getegid(); - if ((len = getgroups(NGRPS, gids)) < 0) - abort(); -#else - // XXX Need to figure out what to do here! - uid = 666; - gid = 777; - gids[0] = 0; - len = 0; -#endif - /* XXX: interface problem; those should all have been unsigned */ - return (authunix_create(machname, uid, gid, len, gids)); -} - -/* - * authunix operations - */ - -/* ARGSUSED */ -static void -authunix_nextverf(auth) - AUTH *auth; -{ - /* no action necessary */ -} - -static bool_t -authunix_marshal(auth, xdrs, seq) - AUTH *auth; - XDR *xdrs; - u_int *seq; -{ - struct audata *au; - - assert(auth != NULL); - assert(xdrs != NULL); - - au = AUTH_PRIVATE(auth); - return (XDR_PUTBYTES(xdrs, au->au_marshed, au->au_mpos)); -} - -static bool_t -authunix_validate(auth, verf, seq) - AUTH *auth; - struct opaque_auth *verf; - u_int seq; -{ - struct audata *au; - XDR xdrs; - - assert(auth != NULL); - assert(verf != NULL); - - if (verf->oa_flavor == AUTH_SHORT) { - au = AUTH_PRIVATE(auth); - xdrmem_create(&xdrs, verf->oa_base, verf->oa_length, - XDR_DECODE); - - if (au->au_shcred.oa_base != NULL) { - mem_free(au->au_shcred.oa_base, - au->au_shcred.oa_length); - au->au_shcred.oa_base = NULL; - } - if (xdr_opaque_auth(&xdrs, &au->au_shcred)) { - auth->ah_cred = au->au_shcred; - } else { - xdrs.x_op = XDR_FREE; - (void)xdr_opaque_auth(&xdrs, &au->au_shcred); - au->au_shcred.oa_base = NULL; - auth->ah_cred = au->au_origcred; - } - marshal_new_auth(auth); - } - return (TRUE); -} - -static bool_t -authunix_refresh(AUTH *auth, void *dummy) -{ - struct audata *au = AUTH_PRIVATE(auth); - struct authunix_parms aup; - struct timeval now; - XDR xdrs; - int stat; - - assert(auth != NULL); - - if (auth->ah_cred.oa_base == au->au_origcred.oa_base) { - /* there is no hope. Punt */ - return (FALSE); - } - au->au_shfaults ++; - - /* first deserialize the creds back into a struct authunix_parms */ - aup.aup_machname = NULL; - aup.aup_gids = NULL; - xdrmem_create(&xdrs, au->au_origcred.oa_base, - au->au_origcred.oa_length, XDR_DECODE); - stat = xdr_authunix_parms(&xdrs, &aup); - if (! stat) - goto done; - - /* update the time and serialize in place */ - (void)gettimeofday(&now, NULL); - aup.aup_time = now.tv_sec; - xdrs.x_op = XDR_ENCODE; - XDR_SETPOS(&xdrs, 0); - stat = xdr_authunix_parms(&xdrs, &aup); - if (! stat) - goto done; - auth->ah_cred = au->au_origcred; - marshal_new_auth(auth); -done: - /* free the struct authunix_parms created by deserializing */ - xdrs.x_op = XDR_FREE; - (void)xdr_authunix_parms(&xdrs, &aup); - XDR_DESTROY(&xdrs); - return (stat); -} - -static void -authunix_destroy(auth) - AUTH *auth; -{ - struct audata *au; - - assert(auth != NULL); - - au = AUTH_PRIVATE(auth); - mem_free(au->au_origcred.oa_base, au->au_origcred.oa_length); - - if (au->au_shcred.oa_base != NULL) - mem_free(au->au_shcred.oa_base, au->au_shcred.oa_length); - - mem_free(auth->ah_private, sizeof(struct audata)); - - if (auth->ah_verf.oa_base != NULL) - mem_free(auth->ah_verf.oa_base, auth->ah_verf.oa_length); - - mem_free(auth, sizeof(*auth)); -} - -/* - * Marshals (pre-serializes) an auth struct. - * sets private data, au_marshed and au_mpos - */ -static void -marshal_new_auth(auth) - AUTH *auth; -{ - XDR xdr_stream; - XDR *xdrs = &xdr_stream; - struct audata *au; - - assert(auth != NULL); - - au = AUTH_PRIVATE(auth); - xdrmem_create(xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE); - if ((! xdr_opaque_auth(xdrs, &(auth->ah_cred))) || - (! xdr_opaque_auth(xdrs, &(auth->ah_verf)))) - assert(0); // XXX - // XXX warnx("auth_none.c - Fatal marshalling problem"); - else - au->au_mpos = XDR_GETPOS(xdrs); - XDR_DESTROY(xdrs); -} - -static bool_t -authunix_wrap(AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args, u_int seq) -{ - return ((*func)(xdrs, args)); -} - -static struct auth_ops * -authunix_ops() -{ - static struct auth_ops ops; - extern mutex_t ops_lock; - - /* VARIABLES PROTECTED BY ops_lock: ops */ - - mutex_lock(&ops_lock); - if (ops.ah_nextverf == NULL) { - ops.ah_nextverf = authunix_nextverf; - ops.ah_marshal = authunix_marshal; - ops.ah_validate = authunix_validate; - ops.ah_refresh = authunix_refresh; - ops.ah_destroy = authunix_destroy; - ops.ah_wrap = authunix_wrap; - ops.ah_unwrap = authunix_wrap; - } - mutex_unlock(&ops_lock); - return (&ops); -} + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA + */ + +#include +//#include +#include +//#include + +#include +//#include +#include +#include +//#include +#include + +#include +#include +#include +#include + +/* auth_unix.c */ +static void authunix_nextverf (AUTH *); +static bool_t authunix_marshal (AUTH *, XDR *, u_int *seq); +static bool_t authunix_validate (AUTH *, struct opaque_auth *, u_int); +static bool_t authunix_refresh (AUTH *, void *); +static void authunix_destroy (AUTH *); +static void marshal_new_auth (AUTH *); +static struct auth_ops *authunix_ops (void); + +/* + * This struct is pointed to by the ah_private field of an auth_handle. + */ +struct audata { + struct opaque_auth au_origcred; /* original credentials */ + struct opaque_auth au_shcred; /* short hand cred */ + u_long au_shfaults; /* short hand cache faults */ + char au_marshed[MAX_AUTH_BYTES]; + u_int au_mpos; /* xdr pos at end of marshed */ +}; +#define AUTH_PRIVATE(auth) ((struct audata *)auth->ah_private) + +/* + * Create a unix style authenticator. + * Returns an auth handle with the given stuff in it. + */ +AUTH * +authunix_create(machname, uid, gid, len, aup_gids) + char *machname; + uid_t uid; + gid_t gid; + int len; + gid_t *aup_gids; +{ + struct authunix_parms aup; + char mymem[MAX_AUTH_BYTES]; + struct timeval now; + XDR xdrs; + AUTH *auth; + struct audata *au; + + /* + * Allocate and set up auth handle + */ + au = NULL; + auth = mem_alloc(sizeof(*auth)); +#ifndef _KERNEL + if (auth == NULL) { + // XXX warnx("authunix_create: out of memory"); + goto cleanup_authunix_create; + } +#endif + au = mem_alloc(sizeof(*au)); +#ifndef _KERNEL + if (au == NULL) { + // XXX warnx("authunix_create: out of memory"); + goto cleanup_authunix_create; + } +#endif + auth->ah_ops = authunix_ops(); + auth->ah_private = (caddr_t)au; + auth->ah_verf = au->au_shcred = _null_auth; + au->au_shfaults = 0; + au->au_origcred.oa_base = NULL; + + /* + * fill in param struct from the given params + */ + (void)gettimeofday(&now, NULL); + aup.aup_time = now.tv_sec; + aup.aup_machname = machname; + aup.aup_uid = uid; + aup.aup_gid = gid; + aup.aup_len = (u_int)len; + aup.aup_gids = aup_gids; + + /* + * Serialize the parameters into origcred + */ + xdrmem_create(&xdrs, mymem, MAX_AUTH_BYTES, XDR_ENCODE); + if (! xdr_authunix_parms(&xdrs, &aup)) + abort(); + au->au_origcred.oa_length = len = XDR_GETPOS(&xdrs); + au->au_origcred.oa_flavor = AUTH_UNIX; +#ifdef _KERNEL + au->au_origcred.oa_base = mem_alloc((u_int) len); +#else + if ((au->au_origcred.oa_base = mem_alloc((u_int) len)) == NULL) { + // XXX warnx("authunix_create: out of memory"); + goto cleanup_authunix_create; + } +#endif + memmove(au->au_origcred.oa_base, mymem, (size_t)len); + + /* + * set auth handle to reflect new cred. + */ + auth->ah_cred = au->au_origcred; + marshal_new_auth(auth); + return (auth); +#ifndef _KERNEL + cleanup_authunix_create: + if (auth) + mem_free(auth, sizeof(*auth)); + if (au) { + if (au->au_origcred.oa_base) + mem_free(au->au_origcred.oa_base, (u_int)len); + mem_free(au, sizeof(*au)); + } + return (NULL); +#endif +} + +/* + * Returns an auth handle with parameters determined by doing lots of + * syscalls. + */ +AUTH * +authunix_create_default() +{ + int len; + char machname[MAXHOSTNAMELEN + 1]; + uid_t uid; + gid_t gid; + gid_t gids[NGRPS]; + + if (gethostname(machname, sizeof machname) == -1) + abort(); + machname[sizeof(machname) - 1] = 0; +#if 0 + uid = geteuid(); + gid = getegid(); + if ((len = getgroups(NGRPS, gids)) < 0) + abort(); +#else + // XXX Need to figure out what to do here! + uid = 666; + gid = 777; + gids[0] = 0; + len = 0; +#endif + /* XXX: interface problem; those should all have been unsigned */ + return (authunix_create(machname, uid, gid, len, gids)); +} + +/* + * authunix operations + */ + +/* ARGSUSED */ +static void +authunix_nextverf(auth) + AUTH *auth; +{ + /* no action necessary */ +} + +static bool_t +authunix_marshal(auth, xdrs, seq) + AUTH *auth; + XDR *xdrs; + u_int *seq; +{ + struct audata *au; + + assert(auth != NULL); + assert(xdrs != NULL); + + au = AUTH_PRIVATE(auth); + return (XDR_PUTBYTES(xdrs, au->au_marshed, au->au_mpos)); +} + +static bool_t +authunix_validate(auth, verf, seq) + AUTH *auth; + struct opaque_auth *verf; + u_int seq; +{ + struct audata *au; + XDR xdrs; + + assert(auth != NULL); + assert(verf != NULL); + + if (verf->oa_flavor == AUTH_SHORT) { + au = AUTH_PRIVATE(auth); + xdrmem_create(&xdrs, verf->oa_base, verf->oa_length, + XDR_DECODE); + + if (au->au_shcred.oa_base != NULL) { + mem_free(au->au_shcred.oa_base, + au->au_shcred.oa_length); + au->au_shcred.oa_base = NULL; + } + if (xdr_opaque_auth(&xdrs, &au->au_shcred)) { + auth->ah_cred = au->au_shcred; + } else { + xdrs.x_op = XDR_FREE; + (void)xdr_opaque_auth(&xdrs, &au->au_shcred); + au->au_shcred.oa_base = NULL; + auth->ah_cred = au->au_origcred; + } + marshal_new_auth(auth); + } + return (TRUE); +} + +static bool_t +authunix_refresh(AUTH *auth, void *dummy) +{ + struct audata *au = AUTH_PRIVATE(auth); + struct authunix_parms aup; + struct timeval now; + XDR xdrs; + int stat; + + assert(auth != NULL); + + if (auth->ah_cred.oa_base == au->au_origcred.oa_base) { + /* there is no hope. Punt */ + return (FALSE); + } + au->au_shfaults ++; + + /* first deserialize the creds back into a struct authunix_parms */ + aup.aup_machname = NULL; + aup.aup_gids = NULL; + xdrmem_create(&xdrs, au->au_origcred.oa_base, + au->au_origcred.oa_length, XDR_DECODE); + stat = xdr_authunix_parms(&xdrs, &aup); + if (! stat) + goto done; + + /* update the time and serialize in place */ + (void)gettimeofday(&now, NULL); + aup.aup_time = now.tv_sec; + xdrs.x_op = XDR_ENCODE; + XDR_SETPOS(&xdrs, 0); + stat = xdr_authunix_parms(&xdrs, &aup); + if (! stat) + goto done; + auth->ah_cred = au->au_origcred; + marshal_new_auth(auth); +done: + /* free the struct authunix_parms created by deserializing */ + xdrs.x_op = XDR_FREE; + (void)xdr_authunix_parms(&xdrs, &aup); + XDR_DESTROY(&xdrs); + return (stat); +} + +static void +authunix_destroy(auth) + AUTH *auth; +{ + struct audata *au; + + assert(auth != NULL); + + au = AUTH_PRIVATE(auth); + mem_free(au->au_origcred.oa_base, au->au_origcred.oa_length); + + if (au->au_shcred.oa_base != NULL) + mem_free(au->au_shcred.oa_base, au->au_shcred.oa_length); + + mem_free(auth->ah_private, sizeof(struct audata)); + + if (auth->ah_verf.oa_base != NULL) + mem_free(auth->ah_verf.oa_base, auth->ah_verf.oa_length); + + mem_free(auth, sizeof(*auth)); +} + +/* + * Marshals (pre-serializes) an auth struct. + * sets private data, au_marshed and au_mpos + */ +static void +marshal_new_auth(auth) + AUTH *auth; +{ + XDR xdr_stream; + XDR *xdrs = &xdr_stream; + struct audata *au; + + assert(auth != NULL); + + au = AUTH_PRIVATE(auth); + xdrmem_create(xdrs, au->au_marshed, MAX_AUTH_BYTES, XDR_ENCODE); + if ((! xdr_opaque_auth(xdrs, &(auth->ah_cred))) || + (! xdr_opaque_auth(xdrs, &(auth->ah_verf)))) + assert(0); // XXX + // XXX warnx("auth_none.c - Fatal marshalling problem"); + else + au->au_mpos = XDR_GETPOS(xdrs); + XDR_DESTROY(xdrs); +} + +static bool_t +authunix_wrap(AUTH *auth, XDR *xdrs, xdrproc_t func, caddr_t args, u_int seq) +{ + return ((*func)(xdrs, args)); +} + +static struct auth_ops * +authunix_ops() +{ + static struct auth_ops ops; + extern mutex_t ops_lock; + + /* VARIABLES PROTECTED BY ops_lock: ops */ + + mutex_lock(&ops_lock); + if (ops.ah_nextverf == NULL) { + ops.ah_nextverf = authunix_nextverf; + ops.ah_marshal = authunix_marshal; + ops.ah_validate = authunix_validate; + ops.ah_refresh = authunix_refresh; + ops.ah_destroy = authunix_destroy; + ops.ah_wrap = authunix_wrap; + ops.ah_unwrap = authunix_wrap; + } + mutex_unlock(&ops_lock); + return (&ops); +} diff --git a/libtirpc/src/authsspi_prot.c b/libtirpc/src/authsspi_prot.c index 001b445..714da5f 100644 --- a/libtirpc/src/authsspi_prot.c +++ b/libtirpc/src/authsspi_prot.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/libtirpc/src/clnt_generic.c b/libtirpc/src/clnt_generic.c index 49ce6e9..58a6cc1 100644 --- a/libtirpc/src/clnt_generic.c +++ b/libtirpc/src/clnt_generic.c @@ -1,480 +1,475 @@ -/* - * Copyright (c) 2009, Sun Microsystems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of Sun Microsystems, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Copyright (c) 1986-1996,1998 by Sun Microsystems, Inc. - * All rights reserved. - */ - -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of Sun Microsystems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Copyright (c) 1986-1996,1998 by Sun Microsystems, Inc. + * All rights reserved. + */ + +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. - */ -#include -//#include -#include -#include -//#include -#include -//#include -//#include -//#include -#include -#include -#include -#include -//#include -//#include -#include -#include -//#include -#include "rpc_com.h" - -extern bool_t __rpc_is_local_host(const char *); -#if 0 /* WINDOWS */ -int __rpc_raise_fd(int); -#endif - -#ifndef NETIDLEN -#define NETIDLEN 32 -#endif - -/* - * Generic client creation with version checking the value of - * vers_out is set to the highest server supported value - * vers_low <= vers_out <= vers_high AND an error results - * if this can not be done. - * - * It calls clnt_create_vers_timed() with a NULL value for the timeout - * pointer, which indicates that the default timeout should be used. - */ -CLIENT * -clnt_create_vers(const char *hostname, const rpcprog_t prog, rpcvers_t *vers_out, - const rpcvers_t vers_low, const rpcvers_t vers_high, const char *nettype) -{ - - return (clnt_create_vers_timed(hostname, prog, vers_out, vers_low, - vers_high, nettype, NULL)); -} - -/* - * This the routine has the same definition as clnt_create_vers(), - * except it takes an additional timeout parameter - a pointer to - * a timeval structure. A NULL value for the pointer indicates - * that the default timeout value should be used. - */ -CLIENT * -clnt_create_vers_timed(const char *hostname, const rpcprog_t prog, - rpcvers_t *vers_out, const rpcvers_t vers_low_in, const rpcvers_t vers_high_in, - const char *nettype, const struct timeval *tp) -{ - CLIENT *clnt; - struct timeval to; - enum clnt_stat rpc_stat; - struct rpc_err rpcerr; - rpcvers_t vers_high = vers_high_in; - rpcvers_t vers_low = vers_low_in; - - clnt = clnt_create_timed(hostname, prog, vers_high, nettype, tp); - if (clnt == NULL) { - return (NULL); - } - to.tv_sec = 10; - to.tv_usec = 0; - rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t)xdr_void, - (char *)NULL, (xdrproc_t)xdr_void, (char *)NULL, to); - if (rpc_stat == RPC_SUCCESS) { - *vers_out = vers_high; - return (clnt); - } - while (rpc_stat == RPC_PROGVERSMISMATCH && vers_high > vers_low) { - unsigned int minvers, maxvers; - - clnt_geterr(clnt, &rpcerr); - minvers = rpcerr.re_vers.low; - maxvers = rpcerr.re_vers.high; - if (maxvers < vers_high) - vers_high = maxvers; - else - vers_high--; - if (minvers > vers_low) - vers_low = minvers; - if (vers_low > vers_high) { - goto error; - } - CLNT_CONTROL(clnt, CLSET_VERS, (char *)&vers_high); - rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t)xdr_void, - (char *)NULL, (xdrproc_t)xdr_void, - (char *)NULL, to); - if (rpc_stat == RPC_SUCCESS) { - *vers_out = vers_high; - return (clnt); - } - } - clnt_geterr(clnt, &rpcerr); - -error: - rpc_createerr.cf_stat = rpc_stat; - rpc_createerr.cf_error = rpcerr; - clnt_destroy(clnt); - return (NULL); -} - -/* - * Top level client creation routine. - * Generic client creation: takes (servers name, program-number, nettype) and - * returns client handle. Default options are set, which the user can - * change using the rpc equivalent of _ioctl()'s. - * - * It tries for all the netids in that particular class of netid until - * it succeeds. - * XXX The error message in the case of failure will be the one - * pertaining to the last create error. - * - * It calls clnt_create_timed() with the default timeout. - */ -CLIENT * -clnt_create(const char *hostname, const rpcprog_t prog, const rpcvers_t vers, - const char *nettype) -{ - - return (clnt_create_timed(hostname, prog, vers, nettype, NULL)); -} - -/* - * This the routine has the same definition as clnt_create(), - * except it takes an additional timeout parameter - a pointer to - * a timeval structure. A NULL value for the pointer indicates - * that the default timeout value should be used. - * - * This function calls clnt_tp_create_timed(). - */ -CLIENT * -clnt_create_timed(const char *hostname, const rpcprog_t prog, const rpcvers_t vers, - const char *netclass, const struct timeval *tp) -{ - struct netconfig *nconf; - CLIENT *clnt = NULL; - void *handle; - enum clnt_stat save_cf_stat = RPC_SUCCESS; - struct rpc_err save_cf_error; - char nettype_array[NETIDLEN]; - char *nettype = &nettype_array[0]; - - if (netclass == NULL) - nettype = NULL; - else { - size_t len = strlen(netclass); - if (len >= sizeof (nettype_array)) { - rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - return (NULL); - } - strcpy(nettype, netclass); - } - - if ((handle = __rpc_setconf((char *)nettype)) == NULL) { - rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - return (NULL); - } - rpc_createerr.cf_stat = RPC_SUCCESS; - while (clnt == NULL) { - if ((nconf = __rpc_getconf(handle)) == NULL) { - if (rpc_createerr.cf_stat == RPC_SUCCESS) - rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - break; - } -#ifdef CLNT_DEBUG - printf("trying netid %s\n", nconf->nc_netid); -#endif - clnt = clnt_tp_create_timed(hostname, prog, vers, nconf, tp); - if (clnt) - break; - else { - /* - * Since we didn't get a name-to-address - * translation failure here, we remember - * this particular error. The object of - * this is to enable us to return to the - * caller a more-specific error than the - * unhelpful ``Name to address translation - * failed'' which might well occur if we - * merely returned the last error (because - * the local loopbacks are typically the - * last ones in /etc/netconfig and the most - * likely to be unable to translate a host - * name). We also check for a more - * meaningful error than ``unknown host - * name'' for the same reasons. - */ - if (rpc_createerr.cf_stat != RPC_N2AXLATEFAILURE && - rpc_createerr.cf_stat != RPC_UNKNOWNHOST) { - save_cf_stat = rpc_createerr.cf_stat; - save_cf_error = rpc_createerr.cf_error; - } - } - } - - /* - * Attempt to return an error more specific than ``Name to address - * translation failed'' or ``unknown host name'' - */ - if ((rpc_createerr.cf_stat == RPC_N2AXLATEFAILURE || - rpc_createerr.cf_stat == RPC_UNKNOWNHOST) && - (save_cf_stat != RPC_SUCCESS)) { - rpc_createerr.cf_stat = save_cf_stat; - rpc_createerr.cf_error = save_cf_error; - } - __rpc_endconf(handle); - return (clnt); -} - -/* - * Generic client creation: takes (servers name, program-number, netconf) and - * returns client handle. Default options are set, which the user can - * change using the rpc equivalent of _ioctl()'s : clnt_control() - * It finds out the server address from rpcbind and calls clnt_tli_create(). - * - * It calls clnt_tp_create_timed() with the default timeout. - */ -CLIENT * -clnt_tp_create(const char *hostname, const rpcprog_t prog, const rpcvers_t vers, - const struct netconfig *nconf) -{ - return (clnt_tp_create_timed(hostname, prog, vers, nconf, NULL)); -} - -/* - * This has the same definition as clnt_tp_create(), except it - * takes an additional parameter - a pointer to a timeval structure. - * A NULL value for the timeout pointer indicates that the default - * value for the timeout should be used. - */ -CLIENT * -clnt_tp_create_timed(const char *hostname, const rpcprog_t prog, const rpcvers_t vers, - const struct netconfig *nconf, const struct timeval *tp) -{ - struct netbuf *svcaddr; /* servers address */ - CLIENT *cl = NULL; /* client handle */ - - if (nconf == NULL) { - rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - return (NULL); - } - - /* - * Get the address of the server - */ - if ((svcaddr = __rpcb_findaddr_timed(prog, vers, - (struct netconfig *)nconf, (char *)hostname, - &cl, (struct timeval *)tp)) == NULL) { - /* appropriate error number is set by rpcbind libraries */ - return (NULL); - } - if (cl == NULL) { - cl = clnt_tli_create(RPC_ANYFD, nconf, svcaddr, - prog, vers, 0, 0, NULL, NULL, NULL); - } else { - /* Reuse the CLIENT handle and change the appropriate fields */ - if (CLNT_CONTROL(cl, CLSET_SVC_ADDR, (void *)svcaddr) == TRUE) { - if (cl->cl_netid == NULL) - cl->cl_netid = strdup(nconf->nc_netid); - if (cl->cl_tp == NULL) - cl->cl_tp = strdup(nconf->nc_device); - (void) CLNT_CONTROL(cl, CLSET_PROG, (void *)&prog); - (void) CLNT_CONTROL(cl, CLSET_VERS, (void *)&vers); - } else { - CLNT_DESTROY(cl); - cl = clnt_tli_create(RPC_ANYFD, nconf, svcaddr, - prog, vers, 0, 0, NULL, NULL, NULL); - } - } - free(svcaddr->buf); - free(svcaddr); - return (cl); -} - -/* - * Generic client creation: returns client handle. - * Default options are set, which the user can - * change using the rpc equivalent of _ioctl()'s : clnt_control(). - * If fd is RPC_ANYFD, it will be opened using nconf. - * It will be bound if not so. - * If sizes are 0; appropriate defaults will be chosen. - */ -CLIENT * -clnt_tli_create(const SOCKET fd_in, const struct netconfig *nconf, - struct netbuf *svcaddr, const rpcprog_t prog, const rpcvers_t vers, - const uint sendsz, const uint recvsz, - int (*callback_xdr)(void *, void *), - int (*callback_function)(void *, void *, void **), - void *callback_args) -{ - CLIENT *cl; /* client handle */ - bool_t madefd = FALSE; /* whether fd opened here */ - long servtype; - BOOL one = TRUE; - struct __rpc_sockinfo si; - extern int __rpc_minfd; - SOCKET fd = fd_in; - - if (fd == RPC_ANYFD) { - if (nconf == NULL) { - rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - return (NULL); - } - - fd = __rpc_nconf2fd(nconf); - - if (fd == INVALID_SOCKET) - goto err; -#if 0 - if (fd < __rpc_minfd) - fd = __rpc_raise_fd(fd); -#endif - madefd = TRUE; - servtype = nconf->nc_semantics; - bindresvport(fd, NULL); - if (!__rpc_fd2sockinfo(fd, &si)) - goto err; - } else { - if (!__rpc_fd2sockinfo(fd, &si)) - goto err; - servtype = __rpc_socktype2seman(si.si_socktype); - if (servtype == -1) { - rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; - return (NULL); - } - } - - if (si.si_af != ((struct sockaddr *)svcaddr->buf)->sa_family) { - rpc_createerr.cf_stat = RPC_UNKNOWNHOST; /* XXX */ - goto err1; - } - - switch (servtype) { - case NC_TPI_COTS: - cl = clnt_vc_create(fd, svcaddr, prog, vers, sendsz, recvsz, - callback_xdr, callback_function, callback_args); - break; - case NC_TPI_COTS_ORD: - if (nconf && - ((strcmp(nconf->nc_protofmly, "inet") == 0) || - (strcmp(nconf->nc_protofmly, "inet6") == 0))) { - setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (const char *)&one, - sizeof (one)); - } - cl = clnt_vc_create(fd, svcaddr, prog, vers, sendsz, recvsz, - callback_xdr, callback_function, callback_args); - break; - case NC_TPI_CLTS: - cl = clnt_dg_create(fd, svcaddr, prog, vers, sendsz, recvsz); - break; - default: - goto err; - } - - if (cl == NULL) - goto err1; /* borrow errors from clnt_dg/vc creates */ - if (nconf) { - cl->cl_netid = strdup(nconf->nc_netid); - cl->cl_tp = strdup(nconf->nc_device); - } else { - cl->cl_netid = ""; - cl->cl_tp = ""; - } - if (madefd) { - (void) CLNT_CONTROL(cl, CLSET_FD_CLOSE, NULL); -/* (void) CLNT_CONTROL(cl, CLSET_POP_TIMOD, NULL); */ - }; - - return (cl); - -err: - rpc_createerr.cf_stat = RPC_SYSTEMERROR; - rpc_createerr.cf_error.re_errno = errno; -err1: if (madefd) - (void)closesocket(fd); - return (NULL); -} - -#if 0 /* WINDOWS */ -/* - * To avoid conflicts with the "magic" file descriptors (0, 1, and 2), - * we try to not use them. The __rpc_raise_fd() routine will dup - * a descriptor to a higher value. If we fail to do it, we continue - * to use the old one (and hope for the best). - */ -int __rpc_minfd = 3; - -int -__rpc_raise_fd(int fd) -{ - int nfd; - - if (fd >= __rpc_minfd) - return (fd); - - if ((nfd = fcntl(fd, F_DUPFD, __rpc_minfd)) == -1) - return (fd); - - if (fsync(nfd) == -1) { - closesocket(nfd); - return (fd); - } - - if (closesocket(fd) == -1) { - /* this is okay, we will syslog an error, then use the new fd */ - (void) syslog(LOG_ERR, - "could not close() fd %d; mem & fd leak", fd); - } - - return (nfd); -} + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA + */ + +#include +//#include +#include +#include +//#include +#include +//#include +//#include +//#include +#include +#include +#include +#include +//#include +//#include +#include +#include +//#include +#include "rpc_com.h" + +extern bool_t __rpc_is_local_host(const char *); +#if 0 /* WINDOWS */ +int __rpc_raise_fd(int); +#endif + +#ifndef NETIDLEN +#define NETIDLEN 32 +#endif + +/* + * Generic client creation with version checking the value of + * vers_out is set to the highest server supported value + * vers_low <= vers_out <= vers_high AND an error results + * if this can not be done. + * + * It calls clnt_create_vers_timed() with a NULL value for the timeout + * pointer, which indicates that the default timeout should be used. + */ +CLIENT * +clnt_create_vers(const char *hostname, const rpcprog_t prog, rpcvers_t *vers_out, + const rpcvers_t vers_low, const rpcvers_t vers_high, const char *nettype) +{ + + return (clnt_create_vers_timed(hostname, prog, vers_out, vers_low, + vers_high, nettype, NULL)); +} + +/* + * This the routine has the same definition as clnt_create_vers(), + * except it takes an additional timeout parameter - a pointer to + * a timeval structure. A NULL value for the pointer indicates + * that the default timeout value should be used. + */ +CLIENT * +clnt_create_vers_timed(const char *hostname, const rpcprog_t prog, + rpcvers_t *vers_out, const rpcvers_t vers_low_in, const rpcvers_t vers_high_in, + const char *nettype, const struct timeval *tp) +{ + CLIENT *clnt; + struct timeval to; + enum clnt_stat rpc_stat; + struct rpc_err rpcerr; + rpcvers_t vers_high = vers_high_in; + rpcvers_t vers_low = vers_low_in; + + clnt = clnt_create_timed(hostname, prog, vers_high, nettype, tp); + if (clnt == NULL) { + return (NULL); + } + to.tv_sec = 10; + to.tv_usec = 0; + rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t)xdr_void, + (char *)NULL, (xdrproc_t)xdr_void, (char *)NULL, to); + if (rpc_stat == RPC_SUCCESS) { + *vers_out = vers_high; + return (clnt); + } + while (rpc_stat == RPC_PROGVERSMISMATCH && vers_high > vers_low) { + unsigned int minvers, maxvers; + + clnt_geterr(clnt, &rpcerr); + minvers = rpcerr.re_vers.low; + maxvers = rpcerr.re_vers.high; + if (maxvers < vers_high) + vers_high = maxvers; + else + vers_high--; + if (minvers > vers_low) + vers_low = minvers; + if (vers_low > vers_high) { + goto error; + } + CLNT_CONTROL(clnt, CLSET_VERS, (char *)&vers_high); + rpc_stat = clnt_call(clnt, NULLPROC, (xdrproc_t)xdr_void, + (char *)NULL, (xdrproc_t)xdr_void, + (char *)NULL, to); + if (rpc_stat == RPC_SUCCESS) { + *vers_out = vers_high; + return (clnt); + } + } + clnt_geterr(clnt, &rpcerr); + +error: + rpc_createerr.cf_stat = rpc_stat; + rpc_createerr.cf_error = rpcerr; + clnt_destroy(clnt); + return (NULL); +} + +/* + * Top level client creation routine. + * Generic client creation: takes (servers name, program-number, nettype) and + * returns client handle. Default options are set, which the user can + * change using the rpc equivalent of _ioctl()'s. + * + * It tries for all the netids in that particular class of netid until + * it succeeds. + * XXX The error message in the case of failure will be the one + * pertaining to the last create error. + * + * It calls clnt_create_timed() with the default timeout. + */ +CLIENT * +clnt_create(const char *hostname, const rpcprog_t prog, const rpcvers_t vers, + const char *nettype) +{ + + return (clnt_create_timed(hostname, prog, vers, nettype, NULL)); +} + +/* + * This the routine has the same definition as clnt_create(), + * except it takes an additional timeout parameter - a pointer to + * a timeval structure. A NULL value for the pointer indicates + * that the default timeout value should be used. + * + * This function calls clnt_tp_create_timed(). + */ +CLIENT * +clnt_create_timed(const char *hostname, const rpcprog_t prog, const rpcvers_t vers, + const char *netclass, const struct timeval *tp) +{ + struct netconfig *nconf; + CLIENT *clnt = NULL; + void *handle; + enum clnt_stat save_cf_stat = RPC_SUCCESS; + struct rpc_err save_cf_error; + char nettype_array[NETIDLEN]; + char *nettype = &nettype_array[0]; + + if (netclass == NULL) + nettype = NULL; + else { + size_t len = strlen(netclass); + if (len >= sizeof (nettype_array)) { + rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; + return (NULL); + } + strcpy(nettype, netclass); + } + + if ((handle = __rpc_setconf((char *)nettype)) == NULL) { + rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; + return (NULL); + } + rpc_createerr.cf_stat = RPC_SUCCESS; + while (clnt == NULL) { + if ((nconf = __rpc_getconf(handle)) == NULL) { + if (rpc_createerr.cf_stat == RPC_SUCCESS) + rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; + break; + } +#ifdef CLNT_DEBUG + printf("trying netid %s\n", nconf->nc_netid); +#endif + clnt = clnt_tp_create_timed(hostname, prog, vers, nconf, tp); + if (clnt) + break; + else { + /* + * Since we didn't get a name-to-address + * translation failure here, we remember + * this particular error. The object of + * this is to enable us to return to the + * caller a more-specific error than the + * unhelpful ``Name to address translation + * failed'' which might well occur if we + * merely returned the last error (because + * the local loopbacks are typically the + * last ones in /etc/netconfig and the most + * likely to be unable to translate a host + * name). We also check for a more + * meaningful error than ``unknown host + * name'' for the same reasons. + */ + if (rpc_createerr.cf_stat != RPC_N2AXLATEFAILURE && + rpc_createerr.cf_stat != RPC_UNKNOWNHOST) { + save_cf_stat = rpc_createerr.cf_stat; + save_cf_error = rpc_createerr.cf_error; + } + } + } + + /* + * Attempt to return an error more specific than ``Name to address + * translation failed'' or ``unknown host name'' + */ + if ((rpc_createerr.cf_stat == RPC_N2AXLATEFAILURE || + rpc_createerr.cf_stat == RPC_UNKNOWNHOST) && + (save_cf_stat != RPC_SUCCESS)) { + rpc_createerr.cf_stat = save_cf_stat; + rpc_createerr.cf_error = save_cf_error; + } + __rpc_endconf(handle); + return (clnt); +} + +/* + * Generic client creation: takes (servers name, program-number, netconf) and + * returns client handle. Default options are set, which the user can + * change using the rpc equivalent of _ioctl()'s : clnt_control() + * It finds out the server address from rpcbind and calls clnt_tli_create(). + * + * It calls clnt_tp_create_timed() with the default timeout. + */ +CLIENT * +clnt_tp_create(const char *hostname, const rpcprog_t prog, const rpcvers_t vers, + const struct netconfig *nconf) +{ + return (clnt_tp_create_timed(hostname, prog, vers, nconf, NULL)); +} + +/* + * This has the same definition as clnt_tp_create(), except it + * takes an additional parameter - a pointer to a timeval structure. + * A NULL value for the timeout pointer indicates that the default + * value for the timeout should be used. + */ +CLIENT * +clnt_tp_create_timed(const char *hostname, const rpcprog_t prog, const rpcvers_t vers, + const struct netconfig *nconf, const struct timeval *tp) +{ + struct netbuf *svcaddr; /* servers address */ + CLIENT *cl = NULL; /* client handle */ + + if (nconf == NULL) { + rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; + return (NULL); + } + + /* + * Get the address of the server + */ + if ((svcaddr = __rpcb_findaddr_timed(prog, vers, + (struct netconfig *)nconf, (char *)hostname, + &cl, (struct timeval *)tp)) == NULL) { + /* appropriate error number is set by rpcbind libraries */ + return (NULL); + } + if (cl == NULL) { + cl = clnt_tli_create(RPC_ANYFD, nconf, svcaddr, + prog, vers, 0, 0, NULL, NULL, NULL); + } else { + /* Reuse the CLIENT handle and change the appropriate fields */ + if (CLNT_CONTROL(cl, CLSET_SVC_ADDR, (void *)svcaddr) == TRUE) { + if (cl->cl_netid == NULL) + cl->cl_netid = strdup(nconf->nc_netid); + if (cl->cl_tp == NULL) + cl->cl_tp = strdup(nconf->nc_device); + (void) CLNT_CONTROL(cl, CLSET_PROG, (void *)&prog); + (void) CLNT_CONTROL(cl, CLSET_VERS, (void *)&vers); + } else { + CLNT_DESTROY(cl); + cl = clnt_tli_create(RPC_ANYFD, nconf, svcaddr, + prog, vers, 0, 0, NULL, NULL, NULL); + } + } + free(svcaddr->buf); + free(svcaddr); + return (cl); +} + +/* + * Generic client creation: returns client handle. + * Default options are set, which the user can + * change using the rpc equivalent of _ioctl()'s : clnt_control(). + * If fd is RPC_ANYFD, it will be opened using nconf. + * It will be bound if not so. + * If sizes are 0; appropriate defaults will be chosen. + */ +CLIENT * +clnt_tli_create(const SOCKET fd_in, const struct netconfig *nconf, + struct netbuf *svcaddr, const rpcprog_t prog, const rpcvers_t vers, + const uint sendsz, const uint recvsz, + int (*callback_xdr)(void *, void *), + int (*callback_function)(void *, void *, void **), + void *callback_args) +{ + CLIENT *cl; /* client handle */ + bool_t madefd = FALSE; /* whether fd opened here */ + long servtype; + BOOL one = TRUE; + struct __rpc_sockinfo si; + extern int __rpc_minfd; + SOCKET fd = fd_in; + + if (fd == RPC_ANYFD) { + if (nconf == NULL) { + rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; + return (NULL); + } + + fd = __rpc_nconf2fd(nconf); + + if (fd == INVALID_SOCKET) + goto err; +#if 0 + if (fd < __rpc_minfd) + fd = __rpc_raise_fd(fd); +#endif + madefd = TRUE; + servtype = nconf->nc_semantics; + bindresvport(fd, NULL); + if (!__rpc_fd2sockinfo(fd, &si)) + goto err; + } else { + if (!__rpc_fd2sockinfo(fd, &si)) + goto err; + servtype = __rpc_socktype2seman(si.si_socktype); + if (servtype == -1) { + rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; + return (NULL); + } + } + + if (si.si_af != ((struct sockaddr *)svcaddr->buf)->sa_family) { + rpc_createerr.cf_stat = RPC_UNKNOWNHOST; /* XXX */ + goto err1; + } + + switch (servtype) { + case NC_TPI_COTS: + cl = clnt_vc_create(fd, svcaddr, prog, vers, sendsz, recvsz, + callback_xdr, callback_function, callback_args); + break; + case NC_TPI_COTS_ORD: + if (nconf && + ((strcmp(nconf->nc_protofmly, "inet") == 0) || + (strcmp(nconf->nc_protofmly, "inet6") == 0))) { + setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (const char *)&one, + sizeof (one)); + } + cl = clnt_vc_create(fd, svcaddr, prog, vers, sendsz, recvsz, + callback_xdr, callback_function, callback_args); + break; + case NC_TPI_CLTS: + cl = clnt_dg_create(fd, svcaddr, prog, vers, sendsz, recvsz); + break; + default: + goto err; + } + + if (cl == NULL) + goto err1; /* borrow errors from clnt_dg/vc creates */ + if (nconf) { + cl->cl_netid = strdup(nconf->nc_netid); + cl->cl_tp = strdup(nconf->nc_device); + } else { + cl->cl_netid = ""; + cl->cl_tp = ""; + } + if (madefd) { + (void) CLNT_CONTROL(cl, CLSET_FD_CLOSE, NULL); +/* (void) CLNT_CONTROL(cl, CLSET_POP_TIMOD, NULL); */ + }; + + return (cl); + +err: + rpc_createerr.cf_stat = RPC_SYSTEMERROR; + rpc_createerr.cf_error.re_errno = errno; +err1: if (madefd) + (void)closesocket(fd); + return (NULL); +} + +#if 0 /* WINDOWS */ +/* + * To avoid conflicts with the "magic" file descriptors (0, 1, and 2), + * we try to not use them. The __rpc_raise_fd() routine will dup + * a descriptor to a higher value. If we fail to do it, we continue + * to use the old one (and hope for the best). + */ +int __rpc_minfd = 3; + +int +__rpc_raise_fd(int fd) +{ + int nfd; + + if (fd >= __rpc_minfd) + return (fd); + + if ((nfd = fcntl(fd, F_DUPFD, __rpc_minfd)) == -1) + return (fd); + + if (fsync(nfd) == -1) { + closesocket(nfd); + return (fd); + } + + if (closesocket(fd) == -1) { + /* this is okay, we will syslog an error, then use the new fd */ + (void) syslog(LOG_ERR, + "could not close() fd %d; mem & fd leak", fd); + } + + return (nfd); +} #endif \ No newline at end of file diff --git a/libtirpc/src/clnt_vc.c b/libtirpc/src/clnt_vc.c index d3a339f..ff67d5c 100644 --- a/libtirpc/src/clnt_vc.c +++ b/libtirpc/src/clnt_vc.c @@ -45,31 +45,27 @@ * Now go hang yourself. */ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ + #include //#include diff --git a/libtirpc/src/rpc_prot.c b/libtirpc/src/rpc_prot.c index 9207217..bfaae61 100644 --- a/libtirpc/src/rpc_prot.c +++ b/libtirpc/src/rpc_prot.c @@ -1,415 +1,410 @@ -/* - * Copyright (c) 2009, Sun Microsystems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of Sun Microsystems, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * rpc_prot.c - * - * Copyright (C) 1984, Sun Microsystems, Inc. - * - * This set of routines implements the rpc message definition, - * its serializer and some common rpc utility routines. - * The routines are meant for various implementations of rpc - - * they are NOT for the rpc client or rpc service implementations! - * Because authentication stuff is easy and is part of rpc, the opaque - * routines are also in this program. - */ - -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of Sun Microsystems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * rpc_prot.c + * + * Copyright (C) 1984, Sun Microsystems, Inc. + * + * This set of routines implements the rpc message definition, + * its serializer and some common rpc utility routines. + * The routines are meant for various implementations of rpc - + * they are NOT for the rpc client or rpc service implementations! + * Because authentication stuff is easy and is part of rpc, the opaque + * routines are also in this program. + */ + +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. - */ -#include -//#include - -#include - -#include - -static void accepted(enum accept_stat, struct rpc_err *); -static void rejected(enum reject_stat, struct rpc_err *); - -/* * * * * * * * * * * * * * XDR Authentication * * * * * * * * * * * */ - -extern struct opaque_auth _null_auth; - -/* - * XDR an opaque authentication struct - * (see auth.h) - */ -bool_t -xdr_opaque_auth(xdrs, ap) - XDR *xdrs; - struct opaque_auth *ap; -{ - - assert(xdrs != NULL); - assert(ap != NULL); - - if (xdr_enum(xdrs, &(ap->oa_flavor))) - return (xdr_bytes(xdrs, &ap->oa_base, - &ap->oa_length, MAX_AUTH_BYTES)); - return (FALSE); -} - -/* - * XDR a DES block - */ -bool_t -xdr_des_block(xdrs, blkp) - XDR *xdrs; - des_block *blkp; -{ - - assert(xdrs != NULL); - assert(blkp != NULL); - - return (xdr_opaque(xdrs, (caddr_t)(void *)blkp, sizeof(des_block))); -} - -/* * * * * * * * * * * * * * XDR RPC MESSAGE * * * * * * * * * * * * * * * */ - -/* - * XDR the MSG_ACCEPTED part of a reply message union - */ -bool_t -xdr_accepted_reply(xdrs, ar) - XDR *xdrs; - struct accepted_reply *ar; -{ - - assert(xdrs != NULL); - assert(ar != NULL); - - /* personalized union, rather than calling xdr_union */ - if (! xdr_opaque_auth(xdrs, &(ar->ar_verf))) - return (FALSE); - if (! xdr_enum(xdrs, (enum_t *)&(ar->ar_stat))) - return (FALSE); - switch (ar->ar_stat) { - - case SUCCESS: - return ((*(ar->ar_results.proc))(xdrs, ar->ar_results.where)); - - case PROG_MISMATCH: - if (! xdr_u_int32_t(xdrs, &(ar->ar_vers.low))) - return (FALSE); - return (xdr_u_int32_t(xdrs, &(ar->ar_vers.high))); - - case GARBAGE_ARGS: - case SYSTEM_ERR: - case PROC_UNAVAIL: - case PROG_UNAVAIL: - break; - } - return (TRUE); /* TRUE => open ended set of problems */ -} - -/* - * XDR the MSG_DENIED part of a reply message union - */ -bool_t -xdr_rejected_reply(xdrs, rr) - XDR *xdrs; - struct rejected_reply *rr; -{ - - assert(xdrs != NULL); - assert(rr != NULL); - - /* personalized union, rather than calling xdr_union */ - if (! xdr_enum(xdrs, (enum_t *)&(rr->rj_stat))) - return (FALSE); - switch (rr->rj_stat) { - - case RPC_MISMATCH: - if (! xdr_u_int32_t(xdrs, &(rr->rj_vers.low))) - return (FALSE); - return (xdr_u_int32_t(xdrs, &(rr->rj_vers.high))); - - case AUTH_ERROR: - return (xdr_enum(xdrs, (enum_t *)&(rr->rj_why))); - } - /* NOTREACHED */ - assert(0); - return (FALSE); -} - -static const struct xdr_discrim reply_dscrm[3] = { - { (int)MSG_ACCEPTED, (xdrproc_t)xdr_accepted_reply }, - { (int)MSG_DENIED, (xdrproc_t)xdr_rejected_reply }, - { __dontcare__, NULL_xdrproc_t } }; - -/* - * XDR a reply message - */ -bool_t -xdr_replymsg(xdrs, rmsg) - XDR *xdrs; - struct rpc_msg *rmsg; -{ - assert(xdrs != NULL); - assert(rmsg != NULL); - - if ( - xdr_u_int32_t(xdrs, &(rmsg->rm_xid)) && - xdr_enum(xdrs, (enum_t *)&(rmsg->rm_direction)) && - (rmsg->rm_direction == REPLY) ) - return (xdr_union(xdrs, (enum_t *)&(rmsg->rm_reply.rp_stat), - (caddr_t)(void *)&(rmsg->rm_reply.ru), reply_dscrm, - NULL_xdrproc_t)); - return (FALSE); -} - -/* - * XDR a reply message in pieces, first xid and direction, then union - */ -bool_t -xdr_getxiddir(xdrs, rmsg) - XDR *xdrs; - struct rpc_msg *rmsg; -{ - assert(xdrs != NULL); - assert(rmsg != NULL); - - return (xdr_u_int32_t(xdrs, &(rmsg->rm_xid)) && - xdr_enum(xdrs, (enum_t *)&(rmsg->rm_direction))); -} - -bool_t -xdr_getreplyunion(xdrs, rmsg) - XDR *xdrs; - struct rpc_msg *rmsg; -{ - assert(xdrs != NULL); - assert(rmsg != NULL); - - return (xdr_union(xdrs, (enum_t *)&(rmsg->rm_reply.rp_stat), - (caddr_t)(void *)&(rmsg->rm_reply.ru), reply_dscrm, - NULL_xdrproc_t)); -} - -bool_t -xdr_getcallbody(xdrs, rmsg) - XDR *xdrs; - struct rpc_msg *rmsg; -{ - assert(xdrs != NULL); - assert(rmsg != NULL); - - if ( - xdr_u_int32_t(xdrs, &(rmsg->rm_call.cb_rpcvers)) && - xdr_u_int32_t(xdrs, &(rmsg->rm_call.cb_prog)) && - xdr_u_int32_t(xdrs, &(rmsg->rm_call.cb_vers)) && - xdr_u_int32_t(xdrs, &(rmsg->rm_call.cb_proc)) && - xdr_opaque_auth(xdrs, &(rmsg->rm_call.cb_cred)) ) - return (xdr_opaque_auth(xdrs, &(rmsg->rm_call.cb_verf))); - return FALSE; -} - -/* - * Serializes the "static part" of a call message header. - * The fields include: rm_xid, rm_direction, rpcvers, prog, and vers. - * The rm_xid is not really static, but the user can easily munge on the fly. - */ -bool_t -xdr_callhdr(xdrs, cmsg) - XDR *xdrs; - struct rpc_msg *cmsg; -{ - - assert(xdrs != NULL); - assert(cmsg != NULL); - - cmsg->rm_direction = CALL; - cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION; - if ( - (xdrs->x_op == XDR_ENCODE) && - xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) && - xdr_enum(xdrs, (enum_t *)&(cmsg->rm_direction)) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) ) - return (xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers))); - return (FALSE); -} - -/* ************************** Client utility routine ************* */ - -static void -accepted(acpt_stat, error) - enum accept_stat acpt_stat; - struct rpc_err *error; -{ - - assert(error != NULL); - - switch (acpt_stat) { - - case PROG_UNAVAIL: - error->re_status = RPC_PROGUNAVAIL; - return; - - case PROG_MISMATCH: - error->re_status = RPC_PROGVERSMISMATCH; - return; - - case PROC_UNAVAIL: - error->re_status = RPC_PROCUNAVAIL; - return; - - case GARBAGE_ARGS: - error->re_status = RPC_CANTDECODEARGS; - return; - - case SYSTEM_ERR: - error->re_status = RPC_SYSTEMERROR; - return; - - case SUCCESS: - error->re_status = RPC_SUCCESS; - return; - } - /* NOTREACHED */ - /* something's wrong, but we don't know what ... */ - error->re_status = RPC_FAILED; - error->re_lb.s1 = (int32_t)MSG_ACCEPTED; - error->re_lb.s2 = (int32_t)acpt_stat; -} - -static void -rejected(rjct_stat, error) - enum reject_stat rjct_stat; - struct rpc_err *error; -{ - - assert(error != NULL); - - switch (rjct_stat) { - case RPC_MISMATCH: - error->re_status = RPC_VERSMISMATCH; - return; - - case AUTH_ERROR: - error->re_status = RPC_AUTHERROR; - return; - } - /* something's wrong, but we don't know what ... */ - /* NOTREACHED */ - error->re_status = RPC_FAILED; - error->re_lb.s1 = (int32_t)MSG_DENIED; - error->re_lb.s2 = (int32_t)rjct_stat; -} - -/* - * given a reply message, fills in the error - */ -void -_seterr_reply(msg, error) - struct rpc_msg *msg; - struct rpc_err *error; -{ - - assert(msg != NULL); - assert(error != NULL); - - /* optimized for normal, SUCCESSful case */ - switch (msg->rm_reply.rp_stat) { - - case MSG_ACCEPTED: - if (msg->acpted_rply.ar_stat == SUCCESS) { - error->re_status = RPC_SUCCESS; - return; - } - accepted(msg->acpted_rply.ar_stat, error); - break; - - case MSG_DENIED: - rejected(msg->rjcted_rply.rj_stat, error); - break; - - default: - error->re_status = RPC_FAILED; - error->re_lb.s1 = (int32_t)(msg->rm_reply.rp_stat); - break; - } - switch (error->re_status) { - - case RPC_VERSMISMATCH: - error->re_vers.low = msg->rjcted_rply.rj_vers.low; - error->re_vers.high = msg->rjcted_rply.rj_vers.high; - break; - - case RPC_AUTHERROR: - error->re_why = msg->rjcted_rply.rj_why; - break; - - case RPC_PROGVERSMISMATCH: - error->re_vers.low = msg->acpted_rply.ar_vers.low; - error->re_vers.high = msg->acpted_rply.ar_vers.high; - break; - - case RPC_FAILED: - case RPC_SUCCESS: - case RPC_PROGNOTREGISTERED: - case RPC_PMAPFAILURE: - case RPC_UNKNOWNPROTO: - case RPC_UNKNOWNHOST: - case RPC_SYSTEMERROR: - case RPC_CANTDECODEARGS: - case RPC_PROCUNAVAIL: - case RPC_PROGUNAVAIL: - case RPC_TIMEDOUT: - case RPC_CANTRECV: - case RPC_CANTSEND: - case RPC_CANTDECODERES: - case RPC_CANTENCODEARGS: - default: - break; - } -} + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA + */ + +#include +//#include + +#include + +#include + +static void accepted(enum accept_stat, struct rpc_err *); +static void rejected(enum reject_stat, struct rpc_err *); + +/* * * * * * * * * * * * * * XDR Authentication * * * * * * * * * * * */ + +extern struct opaque_auth _null_auth; + +/* + * XDR an opaque authentication struct + * (see auth.h) + */ +bool_t +xdr_opaque_auth(xdrs, ap) + XDR *xdrs; + struct opaque_auth *ap; +{ + + assert(xdrs != NULL); + assert(ap != NULL); + + if (xdr_enum(xdrs, &(ap->oa_flavor))) + return (xdr_bytes(xdrs, &ap->oa_base, + &ap->oa_length, MAX_AUTH_BYTES)); + return (FALSE); +} + +/* + * XDR a DES block + */ +bool_t +xdr_des_block(xdrs, blkp) + XDR *xdrs; + des_block *blkp; +{ + + assert(xdrs != NULL); + assert(blkp != NULL); + + return (xdr_opaque(xdrs, (caddr_t)(void *)blkp, sizeof(des_block))); +} + +/* * * * * * * * * * * * * * XDR RPC MESSAGE * * * * * * * * * * * * * * * */ + +/* + * XDR the MSG_ACCEPTED part of a reply message union + */ +bool_t +xdr_accepted_reply(xdrs, ar) + XDR *xdrs; + struct accepted_reply *ar; +{ + + assert(xdrs != NULL); + assert(ar != NULL); + + /* personalized union, rather than calling xdr_union */ + if (! xdr_opaque_auth(xdrs, &(ar->ar_verf))) + return (FALSE); + if (! xdr_enum(xdrs, (enum_t *)&(ar->ar_stat))) + return (FALSE); + switch (ar->ar_stat) { + + case SUCCESS: + return ((*(ar->ar_results.proc))(xdrs, ar->ar_results.where)); + + case PROG_MISMATCH: + if (! xdr_u_int32_t(xdrs, &(ar->ar_vers.low))) + return (FALSE); + return (xdr_u_int32_t(xdrs, &(ar->ar_vers.high))); + + case GARBAGE_ARGS: + case SYSTEM_ERR: + case PROC_UNAVAIL: + case PROG_UNAVAIL: + break; + } + return (TRUE); /* TRUE => open ended set of problems */ +} + +/* + * XDR the MSG_DENIED part of a reply message union + */ +bool_t +xdr_rejected_reply(xdrs, rr) + XDR *xdrs; + struct rejected_reply *rr; +{ + + assert(xdrs != NULL); + assert(rr != NULL); + + /* personalized union, rather than calling xdr_union */ + if (! xdr_enum(xdrs, (enum_t *)&(rr->rj_stat))) + return (FALSE); + switch (rr->rj_stat) { + + case RPC_MISMATCH: + if (! xdr_u_int32_t(xdrs, &(rr->rj_vers.low))) + return (FALSE); + return (xdr_u_int32_t(xdrs, &(rr->rj_vers.high))); + + case AUTH_ERROR: + return (xdr_enum(xdrs, (enum_t *)&(rr->rj_why))); + } + /* NOTREACHED */ + assert(0); + return (FALSE); +} + +static const struct xdr_discrim reply_dscrm[3] = { + { (int)MSG_ACCEPTED, (xdrproc_t)xdr_accepted_reply }, + { (int)MSG_DENIED, (xdrproc_t)xdr_rejected_reply }, + { __dontcare__, NULL_xdrproc_t } }; + +/* + * XDR a reply message + */ +bool_t +xdr_replymsg(xdrs, rmsg) + XDR *xdrs; + struct rpc_msg *rmsg; +{ + assert(xdrs != NULL); + assert(rmsg != NULL); + + if ( + xdr_u_int32_t(xdrs, &(rmsg->rm_xid)) && + xdr_enum(xdrs, (enum_t *)&(rmsg->rm_direction)) && + (rmsg->rm_direction == REPLY) ) + return (xdr_union(xdrs, (enum_t *)&(rmsg->rm_reply.rp_stat), + (caddr_t)(void *)&(rmsg->rm_reply.ru), reply_dscrm, + NULL_xdrproc_t)); + return (FALSE); +} + +/* + * XDR a reply message in pieces, first xid and direction, then union + */ +bool_t +xdr_getxiddir(xdrs, rmsg) + XDR *xdrs; + struct rpc_msg *rmsg; +{ + assert(xdrs != NULL); + assert(rmsg != NULL); + + return (xdr_u_int32_t(xdrs, &(rmsg->rm_xid)) && + xdr_enum(xdrs, (enum_t *)&(rmsg->rm_direction))); +} + +bool_t +xdr_getreplyunion(xdrs, rmsg) + XDR *xdrs; + struct rpc_msg *rmsg; +{ + assert(xdrs != NULL); + assert(rmsg != NULL); + + return (xdr_union(xdrs, (enum_t *)&(rmsg->rm_reply.rp_stat), + (caddr_t)(void *)&(rmsg->rm_reply.ru), reply_dscrm, + NULL_xdrproc_t)); +} + +bool_t +xdr_getcallbody(xdrs, rmsg) + XDR *xdrs; + struct rpc_msg *rmsg; +{ + assert(xdrs != NULL); + assert(rmsg != NULL); + + if ( + xdr_u_int32_t(xdrs, &(rmsg->rm_call.cb_rpcvers)) && + xdr_u_int32_t(xdrs, &(rmsg->rm_call.cb_prog)) && + xdr_u_int32_t(xdrs, &(rmsg->rm_call.cb_vers)) && + xdr_u_int32_t(xdrs, &(rmsg->rm_call.cb_proc)) && + xdr_opaque_auth(xdrs, &(rmsg->rm_call.cb_cred)) ) + return (xdr_opaque_auth(xdrs, &(rmsg->rm_call.cb_verf))); + return FALSE; +} + +/* + * Serializes the "static part" of a call message header. + * The fields include: rm_xid, rm_direction, rpcvers, prog, and vers. + * The rm_xid is not really static, but the user can easily munge on the fly. + */ +bool_t +xdr_callhdr(xdrs, cmsg) + XDR *xdrs; + struct rpc_msg *cmsg; +{ + + assert(xdrs != NULL); + assert(cmsg != NULL); + + cmsg->rm_direction = CALL; + cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION; + if ( + (xdrs->x_op == XDR_ENCODE) && + xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) && + xdr_enum(xdrs, (enum_t *)&(cmsg->rm_direction)) && + xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) && + xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) ) + return (xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers))); + return (FALSE); +} + +/* ************************** Client utility routine ************* */ + +static void +accepted(acpt_stat, error) + enum accept_stat acpt_stat; + struct rpc_err *error; +{ + + assert(error != NULL); + + switch (acpt_stat) { + + case PROG_UNAVAIL: + error->re_status = RPC_PROGUNAVAIL; + return; + + case PROG_MISMATCH: + error->re_status = RPC_PROGVERSMISMATCH; + return; + + case PROC_UNAVAIL: + error->re_status = RPC_PROCUNAVAIL; + return; + + case GARBAGE_ARGS: + error->re_status = RPC_CANTDECODEARGS; + return; + + case SYSTEM_ERR: + error->re_status = RPC_SYSTEMERROR; + return; + + case SUCCESS: + error->re_status = RPC_SUCCESS; + return; + } + /* NOTREACHED */ + /* something's wrong, but we don't know what ... */ + error->re_status = RPC_FAILED; + error->re_lb.s1 = (int32_t)MSG_ACCEPTED; + error->re_lb.s2 = (int32_t)acpt_stat; +} + +static void +rejected(rjct_stat, error) + enum reject_stat rjct_stat; + struct rpc_err *error; +{ + + assert(error != NULL); + + switch (rjct_stat) { + case RPC_MISMATCH: + error->re_status = RPC_VERSMISMATCH; + return; + + case AUTH_ERROR: + error->re_status = RPC_AUTHERROR; + return; + } + /* something's wrong, but we don't know what ... */ + /* NOTREACHED */ + error->re_status = RPC_FAILED; + error->re_lb.s1 = (int32_t)MSG_DENIED; + error->re_lb.s2 = (int32_t)rjct_stat; +} + +/* + * given a reply message, fills in the error + */ +void +_seterr_reply(msg, error) + struct rpc_msg *msg; + struct rpc_err *error; +{ + + assert(msg != NULL); + assert(error != NULL); + + /* optimized for normal, SUCCESSful case */ + switch (msg->rm_reply.rp_stat) { + + case MSG_ACCEPTED: + if (msg->acpted_rply.ar_stat == SUCCESS) { + error->re_status = RPC_SUCCESS; + return; + } + accepted(msg->acpted_rply.ar_stat, error); + break; + + case MSG_DENIED: + rejected(msg->rjcted_rply.rj_stat, error); + break; + + default: + error->re_status = RPC_FAILED; + error->re_lb.s1 = (int32_t)(msg->rm_reply.rp_stat); + break; + } + switch (error->re_status) { + + case RPC_VERSMISMATCH: + error->re_vers.low = msg->rjcted_rply.rj_vers.low; + error->re_vers.high = msg->rjcted_rply.rj_vers.high; + break; + + case RPC_AUTHERROR: + error->re_why = msg->rjcted_rply.rj_why; + break; + + case RPC_PROGVERSMISMATCH: + error->re_vers.low = msg->acpted_rply.ar_vers.low; + error->re_vers.high = msg->acpted_rply.ar_vers.high; + break; + + case RPC_FAILED: + case RPC_SUCCESS: + case RPC_PROGNOTREGISTERED: + case RPC_PMAPFAILURE: + case RPC_UNKNOWNPROTO: + case RPC_UNKNOWNHOST: + case RPC_SYSTEMERROR: + case RPC_CANTDECODEARGS: + case RPC_PROCUNAVAIL: + case RPC_PROGUNAVAIL: + case RPC_TIMEDOUT: + case RPC_CANTRECV: + case RPC_CANTSEND: + case RPC_CANTDECODERES: + case RPC_CANTENCODEARGS: + default: + break; + } +} diff --git a/libtirpc/src/wintirpc.c b/libtirpc/src/wintirpc.c index 10b071b..eb98489 100644 --- a/libtirpc/src/wintirpc.c +++ b/libtirpc/src/wintirpc.c @@ -1,24 +1,22 @@ -/* Copyright (c) 2010 - * The Regents of the University of Michigan - * All Rights Reserved +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * Olga Kornievskaia + * Casey Bodley * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/libtirpc/src/xdr_rec.c b/libtirpc/src/xdr_rec.c index 62bb165..cd8e987 100644 --- a/libtirpc/src/xdr_rec.c +++ b/libtirpc/src/xdr_rec.c @@ -1,852 +1,846 @@ - -/* - * Copyright (c) 2009, Sun Microsystems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of Sun Microsystems, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -//#include -//#include - -/* - * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking" - * layer above tcp (for rpc's use). - * - * Copyright (C) 1984, Sun Microsystems, Inc. - * - * These routines interface XDRSTREAMS to a tcp/ip connection. - * There is a record marking layer between the xdr stream - * and the tcp transport level. A record is composed on one or more - * record fragments. A record fragment is a thirty-two bit header followed - * by n bytes of data, where n is contained in the header. The header - * is represented as a htonl(u_long). Thegh order bit encodes - * whether or not the fragment is the last fragment of the record - * (1 => fragment is last, 0 => more fragments to follow. - * The other 31 bits encode the byte length of the fragment. - */ - -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of Sun Microsystems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +//#include +//#include + +/* + * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking" + * layer above tcp (for rpc's use). + * + * Copyright (C) 1984, Sun Microsystems, Inc. + * + * These routines interface XDRSTREAMS to a tcp/ip connection. + * There is a record marking layer between the xdr stream + * and the tcp transport level. A record is composed on one or more + * record fragments. A record fragment is a thirty-two bit header followed + * by n bytes of data, where n is contained in the header. The header + * is represented as a htonl(u_long). Thegh order bit encodes + * whether or not the fragment is the last fragment of the record + * (1 => fragment is last, 0 => more fragments to follow. + * The other 31 bits encode the byte length of the fragment. + */ + +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. - */ -#include -#include -#include - -//#include - -//#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include "rpc_com.h" -//#include -static bool_t xdrrec_getlong(XDR *, long *); -static bool_t xdrrec_putlong(XDR *, const long *); -static bool_t xdrrec_getbytes(XDR *, char *, u_int); - -static bool_t xdrrec_putbytes(XDR *, const char *, u_int); -static u_int xdrrec_getpos(XDR *); -static bool_t xdrrec_setpos(XDR *, u_int); -static int32_t *xdrrec_inline(XDR *, u_int); -static void xdrrec_destroy(XDR *); - -static const struct xdr_ops xdrrec_ops = { - xdrrec_getlong, - xdrrec_putlong, - xdrrec_getbytes, - xdrrec_putbytes, - xdrrec_getpos, - xdrrec_setpos, - xdrrec_inline, - xdrrec_destroy -}; - -/* - * A record is composed of one or more record fragments. - * A record fragment is a four-byte header followed by zero to - * 2**32-1 bytes. The header is treated as a long unsigned and is - * encode/decoded to the network via htonl/ntohl. The low order 31 bits - * are a byte count of the fragment. The highest order bit is a boolean: - * 1 => this fragment is the last fragment of the record, - * 0 => this fragment is followed by more fragment(s). - * - * The fragment/record machinery is not general; it is constructed to - * meet the needs of xdr and rpc based on tcp. - */ - -#define LAST_FRAG ((u_int32_t)(1 << 31)) - -typedef struct rec_strm { - char *tcp_handle; - /* - * out-goung bits - */ - int (*writeit)(void *, void *, int); - char *out_base; /* output buffer (points to frag header) */ - char *out_finger; /* next output position */ - char *out_boundry; /* data cannot up to this address */ - u_int32_t *frag_header; /* beginning of curren fragment */ - bool_t frag_sent; /* true if buffer sent in middle of record */ - /* - * in-coming bits - */ - int (*readit)(void *, void *, int); - u_long in_size; /* fixed size of the input buffer */ - char *in_base; - char *in_finger; /* location of next byte to be had */ - char *in_boundry; /* can read up to this location */ - u_int fbtbc; /* fragment bytes to be consumed */ - bool_t last_frag; - u_int sendsize; - u_int recvsize; - - bool_t nonblock; - bool_t in_haveheader; - u_int32_t in_header; - char *in_hdrp; - u_int in_hdrlen; - u_int in_reclen; - u_int in_received; - u_int in_maxrec; -} RECSTREAM; - -static u_int fix_buf_size(u_int); -static bool_t flush_out(RECSTREAM *, bool_t); -static bool_t fill_input_buf(RECSTREAM *); -static bool_t get_input_bytes(RECSTREAM *, char *, u_int); -static bool_t set_input_fragment(RECSTREAM *); -static bool_t skip_input_bytes(RECSTREAM *, u_int); -static bool_t realloc_stream(RECSTREAM *, u_int); - - -/* - * Create an xdr handle for xdrrec - * xdrrec_create fills in xdrs. Sendsize and recvsize are - * send and recv buffer sizes (0 => use default). - * tcp_handle is an opaque handle that is passed as the first parameter to - * the procedures readit and writeit. Readit and writeit are read and - * write respectively. They are like the system - * calls expect that they take an opaque handle rather than an fd. - */ -void -xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit) - XDR *xdrs; - u_int sendsize; - u_int recvsize; - void *tcp_handle; - /* like read, but pass it a tcp_handle, not sock */ - int (*readit)(void *, void *, int); - /* like write, but pass it a tcp_handle, not sock */ - int (*writeit)(void *, void *, int); -{ - RECSTREAM *rstrm = mem_alloc(sizeof(RECSTREAM)); - - if (rstrm == NULL) { - //warnx("xdrrec_create: out of memory"); - /* - * This is bad. Should rework xdrrec_create to - * return a handle, and in this case return NULL - */ - return; - } - rstrm->sendsize = sendsize = fix_buf_size(sendsize); - rstrm->out_base = mem_alloc(rstrm->sendsize); - if (rstrm->out_base == NULL) { - //warnx("xdrrec_create: out of memory"); - mem_free(rstrm, sizeof(RECSTREAM)); - return; - } - rstrm->recvsize = recvsize = fix_buf_size(recvsize); - rstrm->in_base = mem_alloc(recvsize); - if (rstrm->in_base == NULL) { - //warnx("xdrrec_create: out of memory"); - mem_free(rstrm->out_base, sendsize); - mem_free(rstrm, sizeof(RECSTREAM)); - return; - } - /* - * now the rest ... - */ - xdrs->x_ops = &xdrrec_ops; - xdrs->x_private = rstrm; - rstrm->tcp_handle = tcp_handle; - rstrm->readit = readit; - rstrm->writeit = writeit; - rstrm->out_finger = rstrm->out_boundry = rstrm->out_base; - rstrm->frag_header = (u_int32_t *)(void *)rstrm->out_base; - rstrm->out_finger += sizeof(u_int32_t); - rstrm->out_boundry += sendsize; - rstrm->frag_sent = FALSE; - rstrm->in_size = recvsize; - rstrm->in_boundry = rstrm->in_base; - rstrm->in_finger = (rstrm->in_boundry += recvsize); - rstrm->fbtbc = 0; - rstrm->last_frag = TRUE; - rstrm->in_haveheader = FALSE; - rstrm->in_hdrlen = 0; - rstrm->in_hdrp = (char *)(void *)&rstrm->in_header; - rstrm->nonblock = FALSE; - rstrm->in_reclen = 0; - rstrm->in_received = 0; -} - - -/* - * The reoutines defined below are the xdr ops which will go into the - * xdr handle filled in by xdrrec_create. - */ - -static bool_t -xdrrec_getlong(xdrs, lp) - XDR *xdrs; - long *lp; -{ - RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - int32_t *buflp = (int32_t *)(void *)(rstrm->in_finger); - int32_t mylong; - - /* first try the inline, fast case */ - if ((rstrm->fbtbc >= sizeof(int32_t)) && - ((PtrToLong(rstrm->in_boundry) - PtrToLong(buflp)) >= sizeof(int32_t))) { - *lp = (long)ntohl((u_int32_t)(*buflp)); - rstrm->fbtbc -= sizeof(int32_t); - rstrm->in_finger += sizeof(int32_t); - } else { - if (! xdrrec_getbytes(xdrs, (char *)(void *)&mylong, - sizeof(int32_t))) - return (FALSE); - *lp = (long)ntohl((u_int32_t)mylong); - } - return (TRUE); -} - -static bool_t -xdrrec_putlong(xdrs, lp) - XDR *xdrs; - const long *lp; -{ - RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - int32_t *dest_lp = ((int32_t *)(void *)(rstrm->out_finger)); - - if ((rstrm->out_finger += sizeof(int32_t)) > rstrm->out_boundry) { - /* - * this case should almost never happen so the code is - * inefficient - */ - rstrm->out_finger -= sizeof(int32_t); - rstrm->frag_sent = TRUE; - if (! flush_out(rstrm, FALSE)) - return (FALSE); - dest_lp = ((int32_t *)(void *)(rstrm->out_finger)); - rstrm->out_finger += sizeof(int32_t); - } - *dest_lp = (int32_t)htonl((u_int32_t)(*lp)); - return (TRUE); -} - -static bool_t /* must manage buffers, fragments, and records */ -xdrrec_getbytes(xdrs, addr, len) - XDR *xdrs; - char *addr; - u_int len; -{ - RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - u_int current; - - while (len > 0) { - current = (int)rstrm->fbtbc; - if (current == 0) { - if (rstrm->last_frag) - return (FALSE); - if (! set_input_fragment(rstrm)) - return (FALSE); - continue; - } - current = (len < current) ? len : current; - if (! get_input_bytes(rstrm, addr, current)) - return (FALSE); - addr += current; - rstrm->fbtbc -= current; - len -= current; - } - return (TRUE); -} - -static bool_t -xdrrec_putbytes(xdrs, addr, len) - XDR *xdrs; - const char *addr; - u_int len; -{ - RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - size_t current; - - while (len > 0) { - current = (size_t)(PtrToUlong(rstrm->out_boundry) - - PtrToUlong(rstrm->out_finger)); - current = (len < current) ? len : current; - memmove(rstrm->out_finger, addr, current); - rstrm->out_finger += current; - addr += current; - len -= current; - if (rstrm->out_finger == rstrm->out_boundry) { - rstrm->frag_sent = TRUE; - if (! flush_out(rstrm, FALSE)) - return (FALSE); - } - } - return (TRUE); -} - -static u_int -xdrrec_getpos(xdrs) - XDR *xdrs; -{ - RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; - off_t pos = 0; - - //pos = lseek((int)(u_long)rstrm->tcp_handle, (off_t)0, 1); - //pos = _lseek((int)PtrToUlong(rstrm->tcp_handle), (off_t)0, 1); - if (pos != -1) - switch (xdrs->x_op) { - - case XDR_ENCODE: - pos += PtrToLong(rstrm->out_finger) - PtrToLong(rstrm->out_base); - break; - - case XDR_DECODE: - pos -= PtrToLong(rstrm->in_boundry) - PtrToLong(rstrm->in_finger); - break; - - default: - pos = (off_t) -1; - break; - } - return ((u_int) pos); -} - -static bool_t -xdrrec_setpos(xdrs, pos) - XDR *xdrs; - u_int pos; -{ - RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; - u_int currpos = xdrrec_getpos(xdrs); - int delta = currpos - pos; - char *newpos; - - if ((int)currpos != -1) - switch (xdrs->x_op) { - - case XDR_ENCODE: - newpos = rstrm->out_finger - delta; - if ((newpos > (char *)(void *)(rstrm->frag_header)) && - (newpos < rstrm->out_boundry)) { - rstrm->out_finger = newpos; - return (TRUE); - } - break; - - case XDR_DECODE: - newpos = rstrm->in_finger - delta; - if ((delta < (int)(rstrm->fbtbc)) && - (newpos <= rstrm->in_boundry) && - (newpos >= rstrm->in_base)) { - rstrm->in_finger = newpos; - rstrm->fbtbc -= delta; - return (TRUE); - } - break; - - case XDR_FREE: - break; - } - return (FALSE); -} - -int32_t * -xdrrec_getoutbase(xdrs) - XDR *xdrs; -{ - RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; - int32_t *buf = NULL; - - switch (xdrs->x_op) { - - case XDR_ENCODE: - buf = rstrm->out_base; - break; - - case XDR_DECODE: - break; - - case XDR_FREE: - break; - } - return (buf); -} - -static int32_t * -xdrrec_inline(xdrs, len) - XDR *xdrs; - u_int len; -{ - RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; - int32_t *buf = NULL; - - switch (xdrs->x_op) { - - case XDR_ENCODE: - if ((rstrm->out_finger + len) <= rstrm->out_boundry) { - buf = (int32_t *)(void *)rstrm->out_finger; - rstrm->out_finger += len; - } - break; - - case XDR_DECODE: - if ((len <= rstrm->fbtbc) && - ((rstrm->in_finger + len) <= rstrm->in_boundry)) { - buf = (int32_t *)(void *)rstrm->in_finger; - rstrm->fbtbc -= len; - rstrm->in_finger += len; - } - break; - - case XDR_FREE: - break; - } - return (buf); -} - -static void -xdrrec_destroy(xdrs) - XDR *xdrs; -{ - RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; - - mem_free(rstrm->out_base, rstrm->sendsize); - mem_free(rstrm->in_base, rstrm->recvsize); - mem_free(rstrm, sizeof(RECSTREAM)); -} - - -/* - * Exported routines to manage xdr records - */ - -/* - * Before reading (deserializing from the stream, one should always call - * this procedure to guarantee proper record alignment. - */ -void xdrrec_setlastfrag(xdrs) - XDR *xdrs; -{ - RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - rstrm->last_frag = 1; -} - -bool_t -xdrrec_skiprecord(xdrs) - XDR *xdrs; -{ - RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - enum xprt_stat xstat; - - if (rstrm->nonblock) { - if (__xdrrec_getrec(xdrs, &xstat, FALSE)) - return TRUE; - - if (rstrm->in_finger == rstrm->in_boundry && - xstat == XPRT_MOREREQS) { - rstrm->fbtbc = 0; - return TRUE; - } - return FALSE; - } - - while (rstrm->fbtbc > 0 || (! rstrm->last_frag)) { - if (! skip_input_bytes(rstrm, rstrm->fbtbc)) - return (FALSE); - rstrm->fbtbc = 0; - if ((! rstrm->last_frag) && (! set_input_fragment(rstrm))) - return (FALSE); - } - rstrm->last_frag = FALSE; - return (TRUE); -} - -/* - * Look ahead function. - * Returns TRUE iff there is no more input in the buffer - * after consuming the rest of the current record. - */ -bool_t -xdrrec_eof(xdrs) - XDR *xdrs; -{ - RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - - while (rstrm->fbtbc > 0 || (! rstrm->last_frag)) { - if (! skip_input_bytes(rstrm, rstrm->fbtbc)) - return (TRUE); - rstrm->fbtbc = 0; - if ((! rstrm->last_frag) && (! set_input_fragment(rstrm))) - return (TRUE); - } - if (rstrm->in_finger == rstrm->in_boundry) - return (TRUE); - return (FALSE); -} - -/* - * The client must tell the package when an end-of-record has occurred. - * The second paraemters tells whether the record should be flushed to the - * (output) tcp stream. (This let's the package support batched or - * pipelined procedure calls.) TRUE => immmediate flush to tcp connection. - */ -bool_t -xdrrec_endofrecord(xdrs, sendnow) - XDR *xdrs; - bool_t sendnow; -{ - RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - u_long len; /* fragment length */ - - if (sendnow || rstrm->frag_sent || - (PtrToUlong(rstrm->out_finger) + sizeof(u_int32_t) >= - PtrToUlong(rstrm->out_boundry))) { - rstrm->frag_sent = FALSE; - return (flush_out(rstrm, TRUE)); - } - len = PtrToUlong(rstrm->out_finger) - PtrToUlong(rstrm->frag_header) - - sizeof(u_int32_t); - *(rstrm->frag_header) = htonl((u_int32_t)len | LAST_FRAG); - rstrm->frag_header = (u_int32_t *)(void *)rstrm->out_finger; - rstrm->out_finger += sizeof(u_int32_t); - return (TRUE); -} - -/* - * Fill the stream buffer with a record for a non-blocking connection. - * Return true if a record is available in the buffer, false if not. - */ -bool_t -__xdrrec_getrec(xdrs, statp, expectdata) - XDR *xdrs; - enum xprt_stat *statp; - bool_t expectdata; -{ - RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - int n; - u_int fraglen; - - if (!rstrm->in_haveheader) { - n = rstrm->readit(rstrm->tcp_handle, rstrm->in_hdrp, - (int)sizeof (rstrm->in_header) - rstrm->in_hdrlen); - if (n == 0) { - *statp = expectdata ? XPRT_DIED : XPRT_IDLE; - return FALSE; - } - if (n < 0) { - *statp = XPRT_DIED; - return FALSE; - } - rstrm->in_hdrp += n; - rstrm->in_hdrlen += n; - if (rstrm->in_hdrlen < sizeof (rstrm->in_header)) { - *statp = XPRT_MOREREQS; - return FALSE; - } - rstrm->in_header = ntohl(rstrm->in_header); - fraglen = (int)(rstrm->in_header & ~LAST_FRAG); - if (fraglen == 0 || fraglen > rstrm->in_maxrec || - (rstrm->in_reclen + fraglen) > rstrm->in_maxrec) { - *statp = XPRT_DIED; - return FALSE; - } - rstrm->fbtbc = rstrm->in_header & (~LAST_FRAG); - rstrm->in_reclen += fraglen; - if (rstrm->in_reclen > rstrm->recvsize) - realloc_stream(rstrm, rstrm->in_reclen); - if (rstrm->in_header & LAST_FRAG) { - rstrm->in_header &= ~LAST_FRAG; - rstrm->last_frag = TRUE; - } - } - - do { - n = rstrm->readit(rstrm->tcp_handle, - rstrm->in_base + rstrm->in_received, - (rstrm->in_reclen - rstrm->in_received)); - - /* this case is needed for non-block as socket returns TIMEDOUT and -1 - * -2 is an error case and covered by the next if() statement */ - if (n == -1) continue; - - if (n < 0) { - *statp = XPRT_DIED; - return FALSE; - } - - if (n == 0) { - *statp = expectdata ? XPRT_DIED : XPRT_IDLE; - return FALSE; - } - - rstrm->in_received += n; - if (rstrm->in_received == rstrm->in_reclen) { - rstrm->in_haveheader = FALSE; - rstrm->in_hdrp = (char *)(void *)&rstrm->in_header; - rstrm->in_hdrlen = 0; - if (rstrm->last_frag) { - rstrm->in_boundry = rstrm->in_base + rstrm->in_reclen; - rstrm->in_finger = rstrm->in_base; - rstrm->in_reclen = rstrm->in_received = 0; - *statp = XPRT_MOREREQS; - return TRUE; - } - } - } while (1); - - *statp = XPRT_MOREREQS; - return FALSE; -} - -bool_t -__xdrrec_setnonblock(xdrs, maxrec) - XDR *xdrs; - int maxrec; -{ - RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - - rstrm->nonblock = TRUE; - if (maxrec == 0) - maxrec = rstrm->recvsize; - rstrm->in_maxrec = maxrec; - return TRUE; -} - -bool_t -__xdrrec_setblock(xdrs) - XDR *xdrs; -{ - RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); - - rstrm->nonblock = FALSE; - return TRUE; -} -/* - * Internal useful routines - */ -static bool_t -flush_out(rstrm, eor) - RECSTREAM *rstrm; - bool_t eor; -{ - u_int32_t eormask = (eor == TRUE) ? LAST_FRAG : 0; - u_int32_t len = (u_int32_t)(PtrToUlong(rstrm->out_finger) - - PtrToUlong(rstrm->frag_header) - sizeof(u_int32_t)); - - *(rstrm->frag_header) = htonl(len | eormask); - len = (u_int32_t)(PtrToUlong(rstrm->out_finger) - - PtrToUlong(rstrm->out_base)); - if ((*(rstrm->writeit))(rstrm->tcp_handle, rstrm->out_base, (int)len) - != (int)len) - return (FALSE); - rstrm->frag_header = (u_int32_t *)(void *)rstrm->out_base; - rstrm->out_finger = (char *)rstrm->out_base + sizeof(u_int32_t); - return (TRUE); -} - -static bool_t /* knows nothing about records! Only about input buffers */ -fill_input_buf(rstrm) - RECSTREAM *rstrm; -{ - char *where; - u_int32_t i; - int len; - - if (rstrm->nonblock) - return FALSE; - - where = rstrm->in_base; - i = (u_int32_t)(PtrToUlong(rstrm->in_boundry) % BYTES_PER_XDR_UNIT); - where += i; - len = (u_int32_t)(rstrm->in_size - i); - if ((len = (*(rstrm->readit))(rstrm->tcp_handle, where, len)) == -1) - return (FALSE); - rstrm->in_finger = where; - where += len; - rstrm->in_boundry = where; - return (TRUE); -} - -static bool_t /* knows nothing about records! Only about input buffers */ -get_input_bytes(rstrm, addr, len) - RECSTREAM *rstrm; - char *addr; - u_int len; -{ - size_t current; - - if (rstrm->nonblock) { - if (len > (u_int)(rstrm->in_boundry - rstrm->in_finger)) - return FALSE; - memcpy(addr, rstrm->in_finger, (size_t)len); - rstrm->in_finger += len; - return TRUE; - } - - while (len > 0) { - current = (size_t)(PtrToLong(rstrm->in_boundry) - - PtrToLong(rstrm->in_finger)); - if (current == 0) { - if (! fill_input_buf(rstrm)) - return (FALSE); - continue; - } - current = (len < current) ? len : current; - memmove(addr, rstrm->in_finger, current); - rstrm->in_finger += current; - addr += current; - len -= current; - } - return (TRUE); -} - -static bool_t /* next two bytes of the input stream are treated as a header */ -set_input_fragment(rstrm) - RECSTREAM *rstrm; -{ - u_int32_t header; - - if (rstrm->nonblock) - return FALSE; - if (! get_input_bytes(rstrm, (char *)(void *)&header, sizeof(header))) - return (FALSE); - header = ntohl(header); - rstrm->last_frag = ((header & LAST_FRAG) == 0) ? FALSE : TRUE; - /* - * Sanity check. Try not to accept wildly incorrect - * record sizes. Unfortunately, the only record size - * we can positively identify as being 'wildly incorrect' - * is zero. Ridiculously large record sizes may look wrong, - * but we don't have any way to be certain that they aren't - * what the client actually intended to send us. - */ - if (header == 0) - return(FALSE); - rstrm->fbtbc = header & (~LAST_FRAG); - return (TRUE); -} - -static bool_t /* consumes input bytes; knows nothing about records! */ -skip_input_bytes(rstrm, cnt) - RECSTREAM *rstrm; - u_int cnt; -{ - u_int32_t current; - - while (cnt > 0) { - current = (u_int32_t)(PtrToUlong(rstrm->in_boundry) - - PtrToUlong(rstrm->in_finger)); - if (current == 0) { - if (! fill_input_buf(rstrm)) - return (FALSE); - continue; - } - current = (u_int32_t)((cnt < current) ? cnt : current); - rstrm->in_finger += current; - cnt -= current; - } - return (TRUE); -} - -static u_int -fix_buf_size(s) - u_int s; -{ - - if (s < 100) - s = 4000; - return (RNDUP(s)); -} - -/* - * Reallocate the input buffer for a non-block stream. - */ -static bool_t -realloc_stream(rstrm, size) - RECSTREAM *rstrm; - u_int size; -{ - ptrdiff_t diff; - char *buf; - - if (size > rstrm->recvsize) { - buf = realloc(rstrm->in_base, (size_t)size); - if (buf == NULL) - return FALSE; - diff = buf - rstrm->in_base; - rstrm->in_finger += diff; - rstrm->in_base = buf; - rstrm->in_boundry = buf + size; - rstrm->recvsize = size; - rstrm->in_size = size; - } - - return TRUE; -} + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA + */ + +#include +#include +#include + +//#include + +//#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include "rpc_com.h" +//#include +static bool_t xdrrec_getlong(XDR *, long *); +static bool_t xdrrec_putlong(XDR *, const long *); +static bool_t xdrrec_getbytes(XDR *, char *, u_int); + +static bool_t xdrrec_putbytes(XDR *, const char *, u_int); +static u_int xdrrec_getpos(XDR *); +static bool_t xdrrec_setpos(XDR *, u_int); +static int32_t *xdrrec_inline(XDR *, u_int); +static void xdrrec_destroy(XDR *); + +static const struct xdr_ops xdrrec_ops = { + xdrrec_getlong, + xdrrec_putlong, + xdrrec_getbytes, + xdrrec_putbytes, + xdrrec_getpos, + xdrrec_setpos, + xdrrec_inline, + xdrrec_destroy +}; + +/* + * A record is composed of one or more record fragments. + * A record fragment is a four-byte header followed by zero to + * 2**32-1 bytes. The header is treated as a long unsigned and is + * encode/decoded to the network via htonl/ntohl. The low order 31 bits + * are a byte count of the fragment. The highest order bit is a boolean: + * 1 => this fragment is the last fragment of the record, + * 0 => this fragment is followed by more fragment(s). + * + * The fragment/record machinery is not general; it is constructed to + * meet the needs of xdr and rpc based on tcp. + */ + +#define LAST_FRAG ((u_int32_t)(1 << 31)) + +typedef struct rec_strm { + char *tcp_handle; + /* + * out-goung bits + */ + int (*writeit)(void *, void *, int); + char *out_base; /* output buffer (points to frag header) */ + char *out_finger; /* next output position */ + char *out_boundry; /* data cannot up to this address */ + u_int32_t *frag_header; /* beginning of curren fragment */ + bool_t frag_sent; /* true if buffer sent in middle of record */ + /* + * in-coming bits + */ + int (*readit)(void *, void *, int); + u_long in_size; /* fixed size of the input buffer */ + char *in_base; + char *in_finger; /* location of next byte to be had */ + char *in_boundry; /* can read up to this location */ + u_int fbtbc; /* fragment bytes to be consumed */ + bool_t last_frag; + u_int sendsize; + u_int recvsize; + + bool_t nonblock; + bool_t in_haveheader; + u_int32_t in_header; + char *in_hdrp; + u_int in_hdrlen; + u_int in_reclen; + u_int in_received; + u_int in_maxrec; +} RECSTREAM; + +static u_int fix_buf_size(u_int); +static bool_t flush_out(RECSTREAM *, bool_t); +static bool_t fill_input_buf(RECSTREAM *); +static bool_t get_input_bytes(RECSTREAM *, char *, u_int); +static bool_t set_input_fragment(RECSTREAM *); +static bool_t skip_input_bytes(RECSTREAM *, u_int); +static bool_t realloc_stream(RECSTREAM *, u_int); + + +/* + * Create an xdr handle for xdrrec + * xdrrec_create fills in xdrs. Sendsize and recvsize are + * send and recv buffer sizes (0 => use default). + * tcp_handle is an opaque handle that is passed as the first parameter to + * the procedures readit and writeit. Readit and writeit are read and + * write respectively. They are like the system + * calls expect that they take an opaque handle rather than an fd. + */ +void +xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit) + XDR *xdrs; + u_int sendsize; + u_int recvsize; + void *tcp_handle; + /* like read, but pass it a tcp_handle, not sock */ + int (*readit)(void *, void *, int); + /* like write, but pass it a tcp_handle, not sock */ + int (*writeit)(void *, void *, int); +{ + RECSTREAM *rstrm = mem_alloc(sizeof(RECSTREAM)); + + if (rstrm == NULL) { + //warnx("xdrrec_create: out of memory"); + /* + * This is bad. Should rework xdrrec_create to + * return a handle, and in this case return NULL + */ + return; + } + rstrm->sendsize = sendsize = fix_buf_size(sendsize); + rstrm->out_base = mem_alloc(rstrm->sendsize); + if (rstrm->out_base == NULL) { + //warnx("xdrrec_create: out of memory"); + mem_free(rstrm, sizeof(RECSTREAM)); + return; + } + rstrm->recvsize = recvsize = fix_buf_size(recvsize); + rstrm->in_base = mem_alloc(recvsize); + if (rstrm->in_base == NULL) { + //warnx("xdrrec_create: out of memory"); + mem_free(rstrm->out_base, sendsize); + mem_free(rstrm, sizeof(RECSTREAM)); + return; + } + /* + * now the rest ... + */ + xdrs->x_ops = &xdrrec_ops; + xdrs->x_private = rstrm; + rstrm->tcp_handle = tcp_handle; + rstrm->readit = readit; + rstrm->writeit = writeit; + rstrm->out_finger = rstrm->out_boundry = rstrm->out_base; + rstrm->frag_header = (u_int32_t *)(void *)rstrm->out_base; + rstrm->out_finger += sizeof(u_int32_t); + rstrm->out_boundry += sendsize; + rstrm->frag_sent = FALSE; + rstrm->in_size = recvsize; + rstrm->in_boundry = rstrm->in_base; + rstrm->in_finger = (rstrm->in_boundry += recvsize); + rstrm->fbtbc = 0; + rstrm->last_frag = TRUE; + rstrm->in_haveheader = FALSE; + rstrm->in_hdrlen = 0; + rstrm->in_hdrp = (char *)(void *)&rstrm->in_header; + rstrm->nonblock = FALSE; + rstrm->in_reclen = 0; + rstrm->in_received = 0; +} + + +/* + * The reoutines defined below are the xdr ops which will go into the + * xdr handle filled in by xdrrec_create. + */ + +static bool_t +xdrrec_getlong(xdrs, lp) + XDR *xdrs; + long *lp; +{ + RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); + int32_t *buflp = (int32_t *)(void *)(rstrm->in_finger); + int32_t mylong; + + /* first try the inline, fast case */ + if ((rstrm->fbtbc >= sizeof(int32_t)) && + ((PtrToLong(rstrm->in_boundry) - PtrToLong(buflp)) >= sizeof(int32_t))) { + *lp = (long)ntohl((u_int32_t)(*buflp)); + rstrm->fbtbc -= sizeof(int32_t); + rstrm->in_finger += sizeof(int32_t); + } else { + if (! xdrrec_getbytes(xdrs, (char *)(void *)&mylong, + sizeof(int32_t))) + return (FALSE); + *lp = (long)ntohl((u_int32_t)mylong); + } + return (TRUE); +} + +static bool_t +xdrrec_putlong(xdrs, lp) + XDR *xdrs; + const long *lp; +{ + RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); + int32_t *dest_lp = ((int32_t *)(void *)(rstrm->out_finger)); + + if ((rstrm->out_finger += sizeof(int32_t)) > rstrm->out_boundry) { + /* + * this case should almost never happen so the code is + * inefficient + */ + rstrm->out_finger -= sizeof(int32_t); + rstrm->frag_sent = TRUE; + if (! flush_out(rstrm, FALSE)) + return (FALSE); + dest_lp = ((int32_t *)(void *)(rstrm->out_finger)); + rstrm->out_finger += sizeof(int32_t); + } + *dest_lp = (int32_t)htonl((u_int32_t)(*lp)); + return (TRUE); +} + +static bool_t /* must manage buffers, fragments, and records */ +xdrrec_getbytes(xdrs, addr, len) + XDR *xdrs; + char *addr; + u_int len; +{ + RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); + u_int current; + + while (len > 0) { + current = (int)rstrm->fbtbc; + if (current == 0) { + if (rstrm->last_frag) + return (FALSE); + if (! set_input_fragment(rstrm)) + return (FALSE); + continue; + } + current = (len < current) ? len : current; + if (! get_input_bytes(rstrm, addr, current)) + return (FALSE); + addr += current; + rstrm->fbtbc -= current; + len -= current; + } + return (TRUE); +} + +static bool_t +xdrrec_putbytes(xdrs, addr, len) + XDR *xdrs; + const char *addr; + u_int len; +{ + RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); + size_t current; + + while (len > 0) { + current = (size_t)(PtrToUlong(rstrm->out_boundry) - + PtrToUlong(rstrm->out_finger)); + current = (len < current) ? len : current; + memmove(rstrm->out_finger, addr, current); + rstrm->out_finger += current; + addr += current; + len -= current; + if (rstrm->out_finger == rstrm->out_boundry) { + rstrm->frag_sent = TRUE; + if (! flush_out(rstrm, FALSE)) + return (FALSE); + } + } + return (TRUE); +} + +static u_int +xdrrec_getpos(xdrs) + XDR *xdrs; +{ + RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; + off_t pos = 0; + + //pos = lseek((int)(u_long)rstrm->tcp_handle, (off_t)0, 1); + //pos = _lseek((int)PtrToUlong(rstrm->tcp_handle), (off_t)0, 1); + if (pos != -1) + switch (xdrs->x_op) { + + case XDR_ENCODE: + pos += PtrToLong(rstrm->out_finger) - PtrToLong(rstrm->out_base); + break; + + case XDR_DECODE: + pos -= PtrToLong(rstrm->in_boundry) - PtrToLong(rstrm->in_finger); + break; + + default: + pos = (off_t) -1; + break; + } + return ((u_int) pos); +} + +static bool_t +xdrrec_setpos(xdrs, pos) + XDR *xdrs; + u_int pos; +{ + RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; + u_int currpos = xdrrec_getpos(xdrs); + int delta = currpos - pos; + char *newpos; + + if ((int)currpos != -1) + switch (xdrs->x_op) { + + case XDR_ENCODE: + newpos = rstrm->out_finger - delta; + if ((newpos > (char *)(void *)(rstrm->frag_header)) && + (newpos < rstrm->out_boundry)) { + rstrm->out_finger = newpos; + return (TRUE); + } + break; + + case XDR_DECODE: + newpos = rstrm->in_finger - delta; + if ((delta < (int)(rstrm->fbtbc)) && + (newpos <= rstrm->in_boundry) && + (newpos >= rstrm->in_base)) { + rstrm->in_finger = newpos; + rstrm->fbtbc -= delta; + return (TRUE); + } + break; + + case XDR_FREE: + break; + } + return (FALSE); +} + +int32_t * +xdrrec_getoutbase(xdrs) + XDR *xdrs; +{ + RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; + int32_t *buf = NULL; + + switch (xdrs->x_op) { + + case XDR_ENCODE: + buf = rstrm->out_base; + break; + + case XDR_DECODE: + break; + + case XDR_FREE: + break; + } + return (buf); +} + +static int32_t * +xdrrec_inline(xdrs, len) + XDR *xdrs; + u_int len; +{ + RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; + int32_t *buf = NULL; + + switch (xdrs->x_op) { + + case XDR_ENCODE: + if ((rstrm->out_finger + len) <= rstrm->out_boundry) { + buf = (int32_t *)(void *)rstrm->out_finger; + rstrm->out_finger += len; + } + break; + + case XDR_DECODE: + if ((len <= rstrm->fbtbc) && + ((rstrm->in_finger + len) <= rstrm->in_boundry)) { + buf = (int32_t *)(void *)rstrm->in_finger; + rstrm->fbtbc -= len; + rstrm->in_finger += len; + } + break; + + case XDR_FREE: + break; + } + return (buf); +} + +static void +xdrrec_destroy(xdrs) + XDR *xdrs; +{ + RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; + + mem_free(rstrm->out_base, rstrm->sendsize); + mem_free(rstrm->in_base, rstrm->recvsize); + mem_free(rstrm, sizeof(RECSTREAM)); +} + + +/* + * Exported routines to manage xdr records + */ + +/* + * Before reading (deserializing from the stream, one should always call + * this procedure to guarantee proper record alignment. + */ +void xdrrec_setlastfrag(xdrs) + XDR *xdrs; +{ + RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); + rstrm->last_frag = 1; +} + +bool_t +xdrrec_skiprecord(xdrs) + XDR *xdrs; +{ + RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); + enum xprt_stat xstat; + + if (rstrm->nonblock) { + if (__xdrrec_getrec(xdrs, &xstat, FALSE)) + return TRUE; + + if (rstrm->in_finger == rstrm->in_boundry && + xstat == XPRT_MOREREQS) { + rstrm->fbtbc = 0; + return TRUE; + } + return FALSE; + } + + while (rstrm->fbtbc > 0 || (! rstrm->last_frag)) { + if (! skip_input_bytes(rstrm, rstrm->fbtbc)) + return (FALSE); + rstrm->fbtbc = 0; + if ((! rstrm->last_frag) && (! set_input_fragment(rstrm))) + return (FALSE); + } + rstrm->last_frag = FALSE; + return (TRUE); +} + +/* + * Look ahead function. + * Returns TRUE iff there is no more input in the buffer + * after consuming the rest of the current record. + */ +bool_t +xdrrec_eof(xdrs) + XDR *xdrs; +{ + RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); + + while (rstrm->fbtbc > 0 || (! rstrm->last_frag)) { + if (! skip_input_bytes(rstrm, rstrm->fbtbc)) + return (TRUE); + rstrm->fbtbc = 0; + if ((! rstrm->last_frag) && (! set_input_fragment(rstrm))) + return (TRUE); + } + if (rstrm->in_finger == rstrm->in_boundry) + return (TRUE); + return (FALSE); +} + +/* + * The client must tell the package when an end-of-record has occurred. + * The second paraemters tells whether the record should be flushed to the + * (output) tcp stream. (This let's the package support batched or + * pipelined procedure calls.) TRUE => immmediate flush to tcp connection. + */ +bool_t +xdrrec_endofrecord(xdrs, sendnow) + XDR *xdrs; + bool_t sendnow; +{ + RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); + u_long len; /* fragment length */ + + if (sendnow || rstrm->frag_sent || + (PtrToUlong(rstrm->out_finger) + sizeof(u_int32_t) >= + PtrToUlong(rstrm->out_boundry))) { + rstrm->frag_sent = FALSE; + return (flush_out(rstrm, TRUE)); + } + len = PtrToUlong(rstrm->out_finger) - PtrToUlong(rstrm->frag_header) - + sizeof(u_int32_t); + *(rstrm->frag_header) = htonl((u_int32_t)len | LAST_FRAG); + rstrm->frag_header = (u_int32_t *)(void *)rstrm->out_finger; + rstrm->out_finger += sizeof(u_int32_t); + return (TRUE); +} + +/* + * Fill the stream buffer with a record for a non-blocking connection. + * Return true if a record is available in the buffer, false if not. + */ +bool_t +__xdrrec_getrec(xdrs, statp, expectdata) + XDR *xdrs; + enum xprt_stat *statp; + bool_t expectdata; +{ + RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); + int n; + u_int fraglen; + + if (!rstrm->in_haveheader) { + n = rstrm->readit(rstrm->tcp_handle, rstrm->in_hdrp, + (int)sizeof (rstrm->in_header) - rstrm->in_hdrlen); + if (n == 0) { + *statp = expectdata ? XPRT_DIED : XPRT_IDLE; + return FALSE; + } + if (n < 0) { + *statp = XPRT_DIED; + return FALSE; + } + rstrm->in_hdrp += n; + rstrm->in_hdrlen += n; + if (rstrm->in_hdrlen < sizeof (rstrm->in_header)) { + *statp = XPRT_MOREREQS; + return FALSE; + } + rstrm->in_header = ntohl(rstrm->in_header); + fraglen = (int)(rstrm->in_header & ~LAST_FRAG); + if (fraglen == 0 || fraglen > rstrm->in_maxrec || + (rstrm->in_reclen + fraglen) > rstrm->in_maxrec) { + *statp = XPRT_DIED; + return FALSE; + } + rstrm->fbtbc = rstrm->in_header & (~LAST_FRAG); + rstrm->in_reclen += fraglen; + if (rstrm->in_reclen > rstrm->recvsize) + realloc_stream(rstrm, rstrm->in_reclen); + if (rstrm->in_header & LAST_FRAG) { + rstrm->in_header &= ~LAST_FRAG; + rstrm->last_frag = TRUE; + } + } + + do { + n = rstrm->readit(rstrm->tcp_handle, + rstrm->in_base + rstrm->in_received, + (rstrm->in_reclen - rstrm->in_received)); + + /* this case is needed for non-block as socket returns TIMEDOUT and -1 + * -2 is an error case and covered by the next if() statement */ + if (n == -1) continue; + + if (n < 0) { + *statp = XPRT_DIED; + return FALSE; + } + + if (n == 0) { + *statp = expectdata ? XPRT_DIED : XPRT_IDLE; + return FALSE; + } + + rstrm->in_received += n; + if (rstrm->in_received == rstrm->in_reclen) { + rstrm->in_haveheader = FALSE; + rstrm->in_hdrp = (char *)(void *)&rstrm->in_header; + rstrm->in_hdrlen = 0; + if (rstrm->last_frag) { + rstrm->in_boundry = rstrm->in_base + rstrm->in_reclen; + rstrm->in_finger = rstrm->in_base; + rstrm->in_reclen = rstrm->in_received = 0; + *statp = XPRT_MOREREQS; + return TRUE; + } + } + } while (1); + + *statp = XPRT_MOREREQS; + return FALSE; +} + +bool_t +__xdrrec_setnonblock(xdrs, maxrec) + XDR *xdrs; + int maxrec; +{ + RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); + + rstrm->nonblock = TRUE; + if (maxrec == 0) + maxrec = rstrm->recvsize; + rstrm->in_maxrec = maxrec; + return TRUE; +} + +bool_t +__xdrrec_setblock(xdrs) + XDR *xdrs; +{ + RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); + + rstrm->nonblock = FALSE; + return TRUE; +} +/* + * Internal useful routines + */ +static bool_t +flush_out(rstrm, eor) + RECSTREAM *rstrm; + bool_t eor; +{ + u_int32_t eormask = (eor == TRUE) ? LAST_FRAG : 0; + u_int32_t len = (u_int32_t)(PtrToUlong(rstrm->out_finger) - + PtrToUlong(rstrm->frag_header) - sizeof(u_int32_t)); + + *(rstrm->frag_header) = htonl(len | eormask); + len = (u_int32_t)(PtrToUlong(rstrm->out_finger) - + PtrToUlong(rstrm->out_base)); + if ((*(rstrm->writeit))(rstrm->tcp_handle, rstrm->out_base, (int)len) + != (int)len) + return (FALSE); + rstrm->frag_header = (u_int32_t *)(void *)rstrm->out_base; + rstrm->out_finger = (char *)rstrm->out_base + sizeof(u_int32_t); + return (TRUE); +} + +static bool_t /* knows nothing about records! Only about input buffers */ +fill_input_buf(rstrm) + RECSTREAM *rstrm; +{ + char *where; + u_int32_t i; + int len; + + if (rstrm->nonblock) + return FALSE; + + where = rstrm->in_base; + i = (u_int32_t)(PtrToUlong(rstrm->in_boundry) % BYTES_PER_XDR_UNIT); + where += i; + len = (u_int32_t)(rstrm->in_size - i); + if ((len = (*(rstrm->readit))(rstrm->tcp_handle, where, len)) == -1) + return (FALSE); + rstrm->in_finger = where; + where += len; + rstrm->in_boundry = where; + return (TRUE); +} + +static bool_t /* knows nothing about records! Only about input buffers */ +get_input_bytes(rstrm, addr, len) + RECSTREAM *rstrm; + char *addr; + u_int len; +{ + size_t current; + + if (rstrm->nonblock) { + if (len > (u_int)(rstrm->in_boundry - rstrm->in_finger)) + return FALSE; + memcpy(addr, rstrm->in_finger, (size_t)len); + rstrm->in_finger += len; + return TRUE; + } + + while (len > 0) { + current = (size_t)(PtrToLong(rstrm->in_boundry) - + PtrToLong(rstrm->in_finger)); + if (current == 0) { + if (! fill_input_buf(rstrm)) + return (FALSE); + continue; + } + current = (len < current) ? len : current; + memmove(addr, rstrm->in_finger, current); + rstrm->in_finger += current; + addr += current; + len -= current; + } + return (TRUE); +} + +static bool_t /* next two bytes of the input stream are treated as a header */ +set_input_fragment(rstrm) + RECSTREAM *rstrm; +{ + u_int32_t header; + + if (rstrm->nonblock) + return FALSE; + if (! get_input_bytes(rstrm, (char *)(void *)&header, sizeof(header))) + return (FALSE); + header = ntohl(header); + rstrm->last_frag = ((header & LAST_FRAG) == 0) ? FALSE : TRUE; + /* + * Sanity check. Try not to accept wildly incorrect + * record sizes. Unfortunately, the only record size + * we can positively identify as being 'wildly incorrect' + * is zero. Ridiculously large record sizes may look wrong, + * but we don't have any way to be certain that they aren't + * what the client actually intended to send us. + */ + if (header == 0) + return(FALSE); + rstrm->fbtbc = header & (~LAST_FRAG); + return (TRUE); +} + +static bool_t /* consumes input bytes; knows nothing about records! */ +skip_input_bytes(rstrm, cnt) + RECSTREAM *rstrm; + u_int cnt; +{ + u_int32_t current; + + while (cnt > 0) { + current = (u_int32_t)(PtrToUlong(rstrm->in_boundry) - + PtrToUlong(rstrm->in_finger)); + if (current == 0) { + if (! fill_input_buf(rstrm)) + return (FALSE); + continue; + } + current = (u_int32_t)((cnt < current) ? cnt : current); + rstrm->in_finger += current; + cnt -= current; + } + return (TRUE); +} + +static u_int +fix_buf_size(s) + u_int s; +{ + + if (s < 100) + s = 4000; + return (RNDUP(s)); +} + +/* + * Reallocate the input buffer for a non-block stream. + */ +static bool_t +realloc_stream(rstrm, size) + RECSTREAM *rstrm; + u_int size; +{ + ptrdiff_t diff; + char *buf; + + if (size > rstrm->recvsize) { + buf = realloc(rstrm->in_base, (size_t)size); + if (buf == NULL) + return FALSE; + diff = buf - rstrm->in_base; + rstrm->in_finger += diff; + rstrm->in_base = buf; + rstrm->in_boundry = buf + size; + rstrm->recvsize = size; + rstrm->in_size = size; + } + + return TRUE; +} diff --git a/libtirpc/tirpc/reentrant.h b/libtirpc/tirpc/reentrant.h index 0ab6f11..c81d1a0 100644 --- a/libtirpc/tirpc/reentrant.h +++ b/libtirpc/tirpc/reentrant.h @@ -1,190 +1,185 @@ -/*- - * Copyright (c) 1997,98 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by J.T. Conklin. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/lib/libc/include/reentrant.h,v 1.2 2002/11/01 09:37:17 dfr Exp $ - */ - -/* - * Requirements: - * - * 1. The thread safe mechanism should be lightweight so the library can - * be used by non-threaded applications without unreasonable overhead. - * - * 2. There should be no dependency on a thread engine for non-threaded - * applications. - * - * 3. There should be no dependency on any particular thread engine. - * - * 4. The library should be able to be compiled without support for thread - * safety. - * - * - * Rationale: - * - * One approach for thread safety is to provide discrete versions of the - * library: one thread safe, the other not. The disadvantage of this is - * that libc is rather large, and two copies of a library which are 99%+ - * identical is not an efficent use of resources. - * - * Another approach is to provide a single thread safe library. However, - * it should not add significant run time or code size overhead to non- - * threaded applications. - * - * Since the NetBSD C library is used in other projects, it should be - * easy to replace the mutual exclusion primitives with ones provided by - * another system. Similarly, it should also be easy to remove all - * support for thread safety completely if the target environment does - * not support threads. - * - * - * Implementation Details: - * - * The mutex primitives used by the library (mutex_t, mutex_lock, etc.) - * are macros which expand to the cooresponding primitives provided by - * the thread engine or to nothing. The latter is used so that code is - * not unreasonably cluttered with #ifdefs when all thread safe support - * is removed. - * - * The mutex macros can be directly mapped to the mutex primitives from - * pthreads, however it should be reasonably easy to wrap another mutex - * implementation so it presents a similar interface. - * - * Stub implementations of the mutex functions are provided with *weak* - * linkage. These functions simply return success. When linked with a - * thread library (i.e. -lpthread), the functions will override the - * stubs. - */ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/*- + * Copyright (c) 1997,98 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by J.T. Conklin. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD: src/lib/libc/include/reentrant.h,v 1.2 2002/11/01 09:37:17 dfr Exp $ + */ + +/* + * Requirements: + * + * 1. The thread safe mechanism should be lightweight so the library can + * be used by non-threaded applications without unreasonable overhead. + * + * 2. There should be no dependency on a thread engine for non-threaded + * applications. + * + * 3. There should be no dependency on any particular thread engine. + * + * 4. The library should be able to be compiled without support for thread + * safety. + * + * + * Rationale: + * + * One approach for thread safety is to provide discrete versions of the + * library: one thread safe, the other not. The disadvantage of this is + * that libc is rather large, and two copies of a library which are 99%+ + * identical is not an efficent use of resources. + * + * Another approach is to provide a single thread safe library. However, + * it should not add significant run time or code size overhead to non- + * threaded applications. + * + * Since the NetBSD C library is used in other projects, it should be + * easy to replace the mutual exclusion primitives with ones provided by + * another system. Similarly, it should also be easy to remove all + * support for thread safety completely if the target environment does + * not support threads. + * + * + * Implementation Details: + * + * The mutex primitives used by the library (mutex_t, mutex_lock, etc.) + * are macros which expand to the cooresponding primitives provided by + * the thread engine or to nothing. The latter is used so that code is + * not unreasonably cluttered with #ifdefs when all thread safe support + * is removed. + * + * The mutex macros can be directly mapped to the mutex primitives from + * pthreads, however it should be reasonably easy to wrap another mutex + * implementation so it presents a similar interface. + * + * Stub implementations of the mutex functions are provided with *weak* + * linkage. These functions simply return success. When linked with a + * thread library (i.e. -lpthread), the functions will override the + * stubs. + */ + +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. - */ - -#ifndef _REENTRANT_H -#define _REENTRANT_H -//#include -#include - -#include - - -#define mutex_t CRITICAL_SECTION -#define cond_t CONDITION_VARIABLE -#define rwlock_t SRWLOCK - - -#define thread_key_t DWORD -#define MUTEX_INITIALIZER -1 /*THIS_NEEDS_HELP*/ -#define RWLOCK_INITIALIZER -1 /*THIS_NEEDS_HELP*/ -#define mutex_init(m, a) InitializeCriticalSection(m) -#define mutex_lock(m) EnterCriticalSection(m) -#define mutex_unlock(m) LeaveCriticalSection(m) -#define mutex_trylock(m) TryEnterCriticalSection(m) - -#define cond_init(c, a, p) InitializeConditionVariable(c) -#define cond_signal(m) WakeConditionVariable(m) -#define cond_broadcast(m) WakeAllConditionVariable(m) -#define cond_wait(c, m) SleepConditionVariableCS(c, m, INFINITE) -#define cond_wait_timed(c, m, t) SleepConditionVariableCS(c, m, t) - -#define rwlock_init(l, a) InitializeSRWLock(l) -#define rwlock_rdlock(l) AcquireSRWLockShared(l) -#define rwlock_wrlock(l) AcquireSRWLockExclusive(l) -/* XXX Code will have to be changed to release the right kind!!! XXX */ -#define rwlock_unlock(l) ReleaseSRWLockExclusive(l) - -#define thr_keycreate(k, d) ((*k) = TlsAlloc()) -#define thr_keydelete(k) TlsFree(k) -#define thr_setspecific(k, p) TlsSetValue(k, p) -#define thr_getspecific(k) TlsGetValue(k) -#define thr_sigsetmask(f, n, o) dunno_sigmask(f, n, o) - -#define thr_self() GetCurrentThreadId() -#define thr_exit(x) ExitThread(x) - -/* -#define mutex_t pthread_mutex_t -#define cond_t pthread_cond_t -#define rwlock_t pthread_rwlock_t - -#define thread_key_t pthread_key_t -#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER -#define RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER -#define mutex_init(m, a) pthread_mutex_init(m, a) -#define mutex_lock(m) pthread_mutex_lock(m) -#define mutex_unlock(m) pthread_mutex_unlock(m) -#define mutex_trylock(m) pthread_mutex_trylock(m) - -#define cond_init(c, a, p) pthread_cond_init(c, a) -#define cond_signal(m) pthread_cond_signal(m) -#define cond_broadcast(m) pthread_cond_broadcast(m) -#define cond_wait(c, m) pthread_cond_wait(c, m) - -#define rwlock_init(l, a) pthread_rwlock_init(l, a) -#define rwlock_rdlock(l) pthread_rwlock_rdlock(l) -#define rwlock_wrlock(l) pthread_rwlock_wrlock(l) -#define rwlock_unlock(l) pthread_rwlock_unlock(l) - -#define thr_keycreate(k, d) pthread_key_create(k, d) -#define thr_keydelete(k) pthread_key_delete(k) -#define thr_setspecific(k, p) pthread_setspecific(k, p) -#define thr_getspecific(k) pthread_getspecific(k) -#define thr_sigsetmask(f, n, o) pthread_sigmask(f, n, o) - -#define thr_self() pthread_self() -#define thr_exit(x) pthread_exit(x) -*/ -#endif /* reentrant.h */ + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA + */ + +#ifndef _REENTRANT_H +#define _REENTRANT_H +//#include +#include + +#include + + +#define mutex_t CRITICAL_SECTION +#define cond_t CONDITION_VARIABLE +#define rwlock_t SRWLOCK + + +#define thread_key_t DWORD +#define MUTEX_INITIALIZER -1 /*THIS_NEEDS_HELP*/ +#define RWLOCK_INITIALIZER -1 /*THIS_NEEDS_HELP*/ +#define mutex_init(m, a) InitializeCriticalSection(m) +#define mutex_lock(m) EnterCriticalSection(m) +#define mutex_unlock(m) LeaveCriticalSection(m) +#define mutex_trylock(m) TryEnterCriticalSection(m) + +#define cond_init(c, a, p) InitializeConditionVariable(c) +#define cond_signal(m) WakeConditionVariable(m) +#define cond_broadcast(m) WakeAllConditionVariable(m) +#define cond_wait(c, m) SleepConditionVariableCS(c, m, INFINITE) +#define cond_wait_timed(c, m, t) SleepConditionVariableCS(c, m, t) + +#define rwlock_init(l, a) InitializeSRWLock(l) +#define rwlock_rdlock(l) AcquireSRWLockShared(l) +#define rwlock_wrlock(l) AcquireSRWLockExclusive(l) +/* XXX Code will have to be changed to release the right kind!!! XXX */ +#define rwlock_unlock(l) ReleaseSRWLockExclusive(l) + +#define thr_keycreate(k, d) ((*k) = TlsAlloc()) +#define thr_keydelete(k) TlsFree(k) +#define thr_setspecific(k, p) TlsSetValue(k, p) +#define thr_getspecific(k) TlsGetValue(k) +#define thr_sigsetmask(f, n, o) dunno_sigmask(f, n, o) + +#define thr_self() GetCurrentThreadId() +#define thr_exit(x) ExitThread(x) + +/* +#define mutex_t pthread_mutex_t +#define cond_t pthread_cond_t +#define rwlock_t pthread_rwlock_t + +#define thread_key_t pthread_key_t +#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER +#define RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER +#define mutex_init(m, a) pthread_mutex_init(m, a) +#define mutex_lock(m) pthread_mutex_lock(m) +#define mutex_unlock(m) pthread_mutex_unlock(m) +#define mutex_trylock(m) pthread_mutex_trylock(m) + +#define cond_init(c, a, p) pthread_cond_init(c, a) +#define cond_signal(m) pthread_cond_signal(m) +#define cond_broadcast(m) pthread_cond_broadcast(m) +#define cond_wait(c, m) pthread_cond_wait(c, m) + +#define rwlock_init(l, a) pthread_rwlock_init(l, a) +#define rwlock_rdlock(l) pthread_rwlock_rdlock(l) +#define rwlock_wrlock(l) pthread_rwlock_wrlock(l) +#define rwlock_unlock(l) pthread_rwlock_unlock(l) + +#define thr_keycreate(k, d) pthread_key_create(k, d) +#define thr_keydelete(k) pthread_key_delete(k) +#define thr_setspecific(k, p) pthread_setspecific(k, p) +#define thr_getspecific(k) pthread_getspecific(k) +#define thr_sigsetmask(f, n, o) pthread_sigmask(f, n, o) + +#define thr_self() pthread_self() +#define thr_exit(x) pthread_exit(x) +*/ +#endif /* reentrant.h */ diff --git a/libtirpc/tirpc/rpc/auth.h b/libtirpc/tirpc/rpc/auth.h index 281b5a5..bfea084 100644 --- a/libtirpc/tirpc/rpc/auth.h +++ b/libtirpc/tirpc/rpc/auth.h @@ -1,416 +1,411 @@ -/* $NetBSD: auth.h,v 1.15 2000/06/02 22:57:55 fvdl Exp $ */ - -/* - * Copyright (c) 2009, Sun Microsystems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of Sun Microsystems, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * from: @(#)auth.h 1.17 88/02/08 SMI - * from: @(#)auth.h 2.3 88/08/07 4.0 RPCSRC - * from: @(#)auth.h 1.43 98/02/02 SMI - * $FreeBSD: src/include/rpc/auth.h,v 1.20 2003/01/01 18:48:42 schweikh Exp $ - */ - -/* - * auth.h, Authentication interface. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - * - * The data structures are completely opaque to the client. The client - * is required to pass an AUTH * to routines that create rpc - * "sessions". - */ - -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* $NetBSD: auth.h,v 1.15 2000/06/02 22:57:55 fvdl Exp $ */ + +/* + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of Sun Microsystems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * from: @(#)auth.h 1.17 88/02/08 SMI + * from: @(#)auth.h 2.3 88/08/07 4.0 RPCSRC + * from: @(#)auth.h 1.43 98/02/02 SMI + * $FreeBSD: src/include/rpc/auth.h,v 1.20 2003/01/01 18:48:42 schweikh Exp $ + */ + +/* + * auth.h, Authentication interface. + * + * Copyright (C) 1984, Sun Microsystems, Inc. + * + * The data structures are completely opaque to the client. The client + * is required to pass an AUTH * to routines that create rpc + * "sessions". + */ + +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. - */ -#ifndef _TIRPC_AUTH_H -#define _TIRPC_AUTH_H - -#include -#include -//#include -//#include -#include - - -#define MAX_AUTH_BYTES 400 -#define MAXNETNAMELEN 255 /* maximum length of network user's name */ - -/* - * Client side authentication/security data - */ - -typedef struct sec_data { - u_int secmod; /* security mode number e.g. in nfssec.conf */ - u_int rpcflavor; /* rpc flavors:AUTH_UNIX,AUTH_DES,RPCSEC_GSS */ - int flags; /* AUTH_F_xxx flags */ - caddr_t data; /* opaque data per flavor */ -} sec_data_t; - -#ifdef _SYSCALL32_IMPL -struct sec_data32 { - uint32_t secmod; /* security mode number e.g. in nfssec.conf */ - uint32_t rpcflavor; /* rpc flavors:AUTH_UNIX,AUTH_DES,RPCSEC_GSS */ - int32_t flags; /* AUTH_F_xxx flags */ - caddr32_t data; /* opaque data per flavor */ -}; -#endif /* _SYSCALL32_IMPL */ - -/* - * AUTH_DES flavor specific data from sec_data opaque data field. - * AUTH_KERB has the same structure. - */ -typedef struct des_clnt_data { - struct netbuf syncaddr; /* time sync addr */ - struct knetconfig *knconf; /* knetconfig info that associated */ - /* with the syncaddr. */ - char *netname; /* server's netname */ - int netnamelen; /* server's netname len */ -} dh_k4_clntdata_t; - -#ifdef _SYSCALL32_IMPL -struct des_clnt_data32 { - struct netbuf32 syncaddr; /* time sync addr */ - caddr32_t knconf; /* knetconfig info that associated */ - /* with the syncaddr. */ - caddr32_t netname; /* server's netname */ - int32_t netnamelen; /* server's netname len */ -}; -#endif /* _SYSCALL32_IMPL */ - -#ifdef KERBEROS -/* - * flavor specific data to hold the data for AUTH_DES/AUTH_KERB(v4) - * in sec_data->data opaque field. - */ -typedef struct krb4_svc_data { - int window; /* window option value */ -} krb4_svcdata_t; - -typedef struct krb4_svc_data des_svcdata_t; -#endif /* KERBEROS */ - -/* - * authentication/security specific flags - */ -#define AUTH_F_RPCTIMESYNC 0x001 /* use RPC to do time sync */ -#define AUTH_F_TRYNONE 0x002 /* allow fall back to AUTH_NONE */ - - -/* - * Status returned from authentication check - */ -enum auth_stat { - AUTH_OK=0, - /* - * failed at remote end - */ - AUTH_BADCRED=1, /* bogus credentials (seal broken) */ - AUTH_REJECTEDCRED=2, /* client should begin new session */ - AUTH_BADVERF=3, /* bogus verifier (seal broken) */ - AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */ - AUTH_TOOWEAK=5, /* rejected due to security reasons */ - /* - * failed locally - */ - AUTH_INVALIDRESP=6, /* bogus response verifier */ - AUTH_FAILED=7, /* some unknown reason */ -#ifdef KERBEROS - /* - * kerberos errors - */ - AUTH_KERB_GENERIC = 8, /* kerberos generic error */ - AUTH_TIMEEXPIRE = 9, /* time of credential expired */ - AUTH_TKT_FILE = 10, /* something wrong with ticket file */ - AUTH_DECODE = 11, /* can't decode authenticator */ - AUTH_NET_ADDR = 12, /* wrong net address in ticket */ -#endif /* KERBEROS */ - - /* - * RPCSEC_GSS errors - */ - RPCSEC_GSS_CREDPROBLEM = 13, - RPCSEC_GSS_CTXPROBLEM = 14 - -}; - -typedef u_int32_t u_int32; /* 32-bit unsigned integers */ - -union des_block { - struct { - u_int32_t high; - u_int32_t low; - } key; - char c[8]; -}; -typedef union des_block des_block; -__BEGIN_DECLS -extern bool_t xdr_des_block(XDR *, des_block *); -__END_DECLS - -/* - * Authentication info. Opaque to client. - */ -struct opaque_auth { - enum_t oa_flavor; /* flavor of auth */ - caddr_t oa_base; /* address of more auth stuff */ - u_int oa_length; /* not to exceed MAX_AUTH_BYTES */ -}; - - -/* - * Auth handle, interface to client side authenticators. - */ -typedef struct __auth { - struct opaque_auth ah_cred; - struct opaque_auth ah_verf; - union des_block ah_key; - struct auth_ops { - void (*ah_nextverf) (struct __auth *); - /* nextverf & serialize */ - int (*ah_marshal) (struct __auth *, XDR *, u_int *); - /* validate verifier */ - int (*ah_validate) (struct __auth *, struct opaque_auth *, u_int); - /* refresh credentials */ - int (*ah_refresh) (struct __auth *, void *); - /* destroy this structure */ - void (*ah_destroy) (struct __auth *); - /* encode data for wire */ - int (*ah_wrap) (struct __auth *, XDR *, xdrproc_t, caddr_t); - /* decode data for wire */ - int (*ah_unwrap) (struct __auth *, XDR *, xdrproc_t, caddr_t, u_int); - - } *ah_ops; - void *ah_private; -} AUTH; - - -/* - * Authentication ops. - * The ops and the auth handle provide the interface to the authenticators. - * - * AUTH *auth; - * XDR *xdrs; - * struct opaque_auth verf; - */ -#define AUTH_NEXTVERF(auth) \ - ((*((auth)->ah_ops->ah_nextverf))(auth)) -#define auth_nextverf(auth) \ - ((*((auth)->ah_ops->ah_nextverf))(auth)) - -#define AUTH_MARSHALL(auth, xdrs, seq) \ - ((*((auth)->ah_ops->ah_marshal))(auth, xdrs, seq)) -#define auth_marshall(auth, xdrs, seq) \ - ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) - -#define AUTH_VALIDATE(auth, verfp, seq) \ - ((*((auth)->ah_ops->ah_validate))((auth), verfp, seq)) -#define auth_validate(auth, verfp, seq) \ - ((*((auth)->ah_ops->ah_validate))((auth), verfp, seq)) - -#define AUTH_REFRESH(auth, msg) \ - ((*((auth)->ah_ops->ah_refresh))(auth, msg)) -#define auth_refresh(auth, msg) \ - ((*((auth)->ah_ops->ah_refresh))(auth, msg)) - -#define AUTH_DESTROY(auth) \ - ((*((auth)->ah_ops->ah_destroy))(auth)) -#define auth_destroy(auth) \ - ((*((auth)->ah_ops->ah_destroy))(auth)) - -#define AUTH_WRAP(auth, xdrs, xfunc, xwhere) \ - ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ - xfunc, xwhere)) -#define auth_wrap(auth, xdrs, xfunc, xwhere) \ - ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ - xfunc, xwhere)) - -#define AUTH_UNWRAP(auth, xdrs, xfunc, xwhere, seq) \ - ((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ - xfunc, xwhere, seq)) -#define auth_unwrap(auth, xdrs, xfunc, xwhere, seq) \ - ((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ - xfunc, xwhere, seq)) - - -__BEGIN_DECLS -extern struct opaque_auth _null_auth; -__END_DECLS - -/* - * Any style authentication. These routines can be used by any - * authentication style that does not use the wrap/unwrap functions. - */ -int authany_wrap(void), authany_unwrap(void); - -/* - * These are the various implementations of client side authenticators. - */ - -/* - * System style authentication - * AUTH *authunix_create(machname, uid, gid, len, aup_gids) - * char *machname; - * int uid; - * int gid; - * int len; - * int *aup_gids; - */ -__BEGIN_DECLS -extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *); -extern AUTH *authunix_create_default(void); /* takes no parameters */ -extern AUTH *authnone_create(void); /* takes no parameters */ -__END_DECLS -/* - * DES style authentication - * AUTH *authsecdes_create(servername, window, timehost, ckey) - * char *servername; - network name of server - * u_int window; - time to live - * const char *timehost; - optional hostname to sync with - * des_block *ckey; - optional conversation key to use - */ -__BEGIN_DECLS -extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *); -extern AUTH *authdes_seccreate (const char *, const u_int, const char *, - const des_block *); -__END_DECLS - -__BEGIN_DECLS -extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *); -__END_DECLS - -#define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip)) -#define authsys_create_default() authunix_create_default() - -/* - * Netname manipulation routines. - */ -__BEGIN_DECLS -extern int getnetname(char *); -extern int host2netname(char *, const char *, const char *); -extern int user2netname(char *, const uid_t, const char *); -extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *); -extern int netname2host(char *, char *, const int); -extern void passwd2des ( char *, char * ); -__END_DECLS - -/* - * - * These routines interface to the keyserv daemon - * - */ -__BEGIN_DECLS -extern int key_decryptsession(const char *, des_block *); -extern int key_encryptsession(const char *, des_block *); -extern int key_gendes(des_block *); -extern int key_setsecret(const char *); -extern int key_secretkey_is_set(void); -__END_DECLS - -/* - * Publickey routines. - */ -__BEGIN_DECLS -extern int getpublickey (const char *, char *); -extern int getpublicandprivatekey (char *, char *); -extern int getsecretkey (char *, char *, char *); -__END_DECLS - -#ifdef KERBEROS -/* - * Kerberos style authentication - * AUTH *authkerb_seccreate(service, srv_inst, realm, window, timehost, status) - * const char *service; - service name - * const char *srv_inst; - server instance - * const char *realm; - server realm - * const u_int window; - time to live - * const char *timehost; - optional hostname to sync with - * int *status; - kerberos status returned - */ -__BEGIN_DECLS -extern AUTH *authkerb_seccreate(const char *, const char *, const char *, - const u_int, const char *, int *); -__END_DECLS - -/* - * Map a kerberos credential into a unix cred. - * - * authkerb_getucred(rqst, uid, gid, grouplen, groups) - * const struct svc_req *rqst; - request pointer - * uid_t *uid; - * gid_t *gid; - * short *grouplen; - * int *groups; - * - */ -__BEGIN_DECLS -extern int authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *, - short *, int * */); -__END_DECLS -#endif /* KERBEROS */ - -__BEGIN_DECLS -struct svc_req; -struct rpc_msg; -enum auth_stat _svcauth_null (struct svc_req *, struct rpc_msg *); -enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *); -enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *); -__END_DECLS - -#define AUTH_NONE 0 /* no authentication */ -#define AUTH_NULL 0 /* backward compatibility */ -#define AUTH_SYS 1 /* unix style (uid, gids) */ -#define AUTH_UNIX AUTH_SYS -#define AUTH_SHORT 2 /* short hand unix style */ -#define AUTH_DH 3 /* for Diffie-Hellman mechanism */ -#define AUTH_DES AUTH_DH /* for backward compatibility */ -#define AUTH_KERB 4 /* kerberos style */ -#define RPCSEC_GSS 6 /* RPCSEC_GSS */ - -#endif /* !_TIRPC_AUTH_H */ + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA + */ + +#ifndef _TIRPC_AUTH_H +#define _TIRPC_AUTH_H + +#include +#include +//#include +//#include +#include + + +#define MAX_AUTH_BYTES 400 +#define MAXNETNAMELEN 255 /* maximum length of network user's name */ + +/* + * Client side authentication/security data + */ + +typedef struct sec_data { + u_int secmod; /* security mode number e.g. in nfssec.conf */ + u_int rpcflavor; /* rpc flavors:AUTH_UNIX,AUTH_DES,RPCSEC_GSS */ + int flags; /* AUTH_F_xxx flags */ + caddr_t data; /* opaque data per flavor */ +} sec_data_t; + +#ifdef _SYSCALL32_IMPL +struct sec_data32 { + uint32_t secmod; /* security mode number e.g. in nfssec.conf */ + uint32_t rpcflavor; /* rpc flavors:AUTH_UNIX,AUTH_DES,RPCSEC_GSS */ + int32_t flags; /* AUTH_F_xxx flags */ + caddr32_t data; /* opaque data per flavor */ +}; +#endif /* _SYSCALL32_IMPL */ + +/* + * AUTH_DES flavor specific data from sec_data opaque data field. + * AUTH_KERB has the same structure. + */ +typedef struct des_clnt_data { + struct netbuf syncaddr; /* time sync addr */ + struct knetconfig *knconf; /* knetconfig info that associated */ + /* with the syncaddr. */ + char *netname; /* server's netname */ + int netnamelen; /* server's netname len */ +} dh_k4_clntdata_t; + +#ifdef _SYSCALL32_IMPL +struct des_clnt_data32 { + struct netbuf32 syncaddr; /* time sync addr */ + caddr32_t knconf; /* knetconfig info that associated */ + /* with the syncaddr. */ + caddr32_t netname; /* server's netname */ + int32_t netnamelen; /* server's netname len */ +}; +#endif /* _SYSCALL32_IMPL */ + +#ifdef KERBEROS +/* + * flavor specific data to hold the data for AUTH_DES/AUTH_KERB(v4) + * in sec_data->data opaque field. + */ +typedef struct krb4_svc_data { + int window; /* window option value */ +} krb4_svcdata_t; + +typedef struct krb4_svc_data des_svcdata_t; +#endif /* KERBEROS */ + +/* + * authentication/security specific flags + */ +#define AUTH_F_RPCTIMESYNC 0x001 /* use RPC to do time sync */ +#define AUTH_F_TRYNONE 0x002 /* allow fall back to AUTH_NONE */ + + +/* + * Status returned from authentication check + */ +enum auth_stat { + AUTH_OK=0, + /* + * failed at remote end + */ + AUTH_BADCRED=1, /* bogus credentials (seal broken) */ + AUTH_REJECTEDCRED=2, /* client should begin new session */ + AUTH_BADVERF=3, /* bogus verifier (seal broken) */ + AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */ + AUTH_TOOWEAK=5, /* rejected due to security reasons */ + /* + * failed locally + */ + AUTH_INVALIDRESP=6, /* bogus response verifier */ + AUTH_FAILED=7, /* some unknown reason */ +#ifdef KERBEROS + /* + * kerberos errors + */ + AUTH_KERB_GENERIC = 8, /* kerberos generic error */ + AUTH_TIMEEXPIRE = 9, /* time of credential expired */ + AUTH_TKT_FILE = 10, /* something wrong with ticket file */ + AUTH_DECODE = 11, /* can't decode authenticator */ + AUTH_NET_ADDR = 12, /* wrong net address in ticket */ +#endif /* KERBEROS */ + + /* + * RPCSEC_GSS errors + */ + RPCSEC_GSS_CREDPROBLEM = 13, + RPCSEC_GSS_CTXPROBLEM = 14 + +}; + +typedef u_int32_t u_int32; /* 32-bit unsigned integers */ + +union des_block { + struct { + u_int32_t high; + u_int32_t low; + } key; + char c[8]; +}; +typedef union des_block des_block; +__BEGIN_DECLS +extern bool_t xdr_des_block(XDR *, des_block *); +__END_DECLS + +/* + * Authentication info. Opaque to client. + */ +struct opaque_auth { + enum_t oa_flavor; /* flavor of auth */ + caddr_t oa_base; /* address of more auth stuff */ + u_int oa_length; /* not to exceed MAX_AUTH_BYTES */ +}; + + +/* + * Auth handle, interface to client side authenticators. + */ +typedef struct __auth { + struct opaque_auth ah_cred; + struct opaque_auth ah_verf; + union des_block ah_key; + struct auth_ops { + void (*ah_nextverf) (struct __auth *); + /* nextverf & serialize */ + int (*ah_marshal) (struct __auth *, XDR *, u_int *); + /* validate verifier */ + int (*ah_validate) (struct __auth *, struct opaque_auth *, u_int); + /* refresh credentials */ + int (*ah_refresh) (struct __auth *, void *); + /* destroy this structure */ + void (*ah_destroy) (struct __auth *); + /* encode data for wire */ + int (*ah_wrap) (struct __auth *, XDR *, xdrproc_t, caddr_t); + /* decode data for wire */ + int (*ah_unwrap) (struct __auth *, XDR *, xdrproc_t, caddr_t, u_int); + + } *ah_ops; + void *ah_private; +} AUTH; + + +/* + * Authentication ops. + * The ops and the auth handle provide the interface to the authenticators. + * + * AUTH *auth; + * XDR *xdrs; + * struct opaque_auth verf; + */ +#define AUTH_NEXTVERF(auth) \ + ((*((auth)->ah_ops->ah_nextverf))(auth)) +#define auth_nextverf(auth) \ + ((*((auth)->ah_ops->ah_nextverf))(auth)) + +#define AUTH_MARSHALL(auth, xdrs, seq) \ + ((*((auth)->ah_ops->ah_marshal))(auth, xdrs, seq)) +#define auth_marshall(auth, xdrs, seq) \ + ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) + +#define AUTH_VALIDATE(auth, verfp, seq) \ + ((*((auth)->ah_ops->ah_validate))((auth), verfp, seq)) +#define auth_validate(auth, verfp, seq) \ + ((*((auth)->ah_ops->ah_validate))((auth), verfp, seq)) + +#define AUTH_REFRESH(auth, msg) \ + ((*((auth)->ah_ops->ah_refresh))(auth, msg)) +#define auth_refresh(auth, msg) \ + ((*((auth)->ah_ops->ah_refresh))(auth, msg)) + +#define AUTH_DESTROY(auth) \ + ((*((auth)->ah_ops->ah_destroy))(auth)) +#define auth_destroy(auth) \ + ((*((auth)->ah_ops->ah_destroy))(auth)) + +#define AUTH_WRAP(auth, xdrs, xfunc, xwhere) \ + ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ + xfunc, xwhere)) +#define auth_wrap(auth, xdrs, xfunc, xwhere) \ + ((*((auth)->ah_ops->ah_wrap))(auth, xdrs, \ + xfunc, xwhere)) + +#define AUTH_UNWRAP(auth, xdrs, xfunc, xwhere, seq) \ + ((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ + xfunc, xwhere, seq)) +#define auth_unwrap(auth, xdrs, xfunc, xwhere, seq) \ + ((*((auth)->ah_ops->ah_unwrap))(auth, xdrs, \ + xfunc, xwhere, seq)) + + +__BEGIN_DECLS +extern struct opaque_auth _null_auth; +__END_DECLS + +/* + * Any style authentication. These routines can be used by any + * authentication style that does not use the wrap/unwrap functions. + */ +int authany_wrap(void), authany_unwrap(void); + +/* + * These are the various implementations of client side authenticators. + */ + +/* + * System style authentication + * AUTH *authunix_create(machname, uid, gid, len, aup_gids) + * char *machname; + * int uid; + * int gid; + * int len; + * int *aup_gids; + */ +__BEGIN_DECLS +extern AUTH *authunix_create(char *, uid_t, uid_t, int, uid_t *); +extern AUTH *authunix_create_default(void); /* takes no parameters */ +extern AUTH *authnone_create(void); /* takes no parameters */ +__END_DECLS +/* + * DES style authentication + * AUTH *authsecdes_create(servername, window, timehost, ckey) + * char *servername; - network name of server + * u_int window; - time to live + * const char *timehost; - optional hostname to sync with + * des_block *ckey; - optional conversation key to use + */ +__BEGIN_DECLS +extern AUTH *authdes_create (char *, u_int, struct sockaddr *, des_block *); +extern AUTH *authdes_seccreate (const char *, const u_int, const char *, + const des_block *); +__END_DECLS + +__BEGIN_DECLS +extern bool_t xdr_opaque_auth (XDR *, struct opaque_auth *); +__END_DECLS + +#define authsys_create(c,i1,i2,i3,ip) authunix_create((c),(i1),(i2),(i3),(ip)) +#define authsys_create_default() authunix_create_default() + +/* + * Netname manipulation routines. + */ +__BEGIN_DECLS +extern int getnetname(char *); +extern int host2netname(char *, const char *, const char *); +extern int user2netname(char *, const uid_t, const char *); +extern int netname2user(char *, uid_t *, gid_t *, int *, gid_t *); +extern int netname2host(char *, char *, const int); +extern void passwd2des ( char *, char * ); +__END_DECLS + +/* + * + * These routines interface to the keyserv daemon + * + */ +__BEGIN_DECLS +extern int key_decryptsession(const char *, des_block *); +extern int key_encryptsession(const char *, des_block *); +extern int key_gendes(des_block *); +extern int key_setsecret(const char *); +extern int key_secretkey_is_set(void); +__END_DECLS + +/* + * Publickey routines. + */ +__BEGIN_DECLS +extern int getpublickey (const char *, char *); +extern int getpublicandprivatekey (char *, char *); +extern int getsecretkey (char *, char *, char *); +__END_DECLS + +#ifdef KERBEROS +/* + * Kerberos style authentication + * AUTH *authkerb_seccreate(service, srv_inst, realm, window, timehost, status) + * const char *service; - service name + * const char *srv_inst; - server instance + * const char *realm; - server realm + * const u_int window; - time to live + * const char *timehost; - optional hostname to sync with + * int *status; - kerberos status returned + */ +__BEGIN_DECLS +extern AUTH *authkerb_seccreate(const char *, const char *, const char *, + const u_int, const char *, int *); +__END_DECLS + +/* + * Map a kerberos credential into a unix cred. + * + * authkerb_getucred(rqst, uid, gid, grouplen, groups) + * const struct svc_req *rqst; - request pointer + * uid_t *uid; + * gid_t *gid; + * short *grouplen; + * int *groups; + * + */ +__BEGIN_DECLS +extern int authkerb_getucred(/* struct svc_req *, uid_t *, gid_t *, + short *, int * */); +__END_DECLS +#endif /* KERBEROS */ + +__BEGIN_DECLS +struct svc_req; +struct rpc_msg; +enum auth_stat _svcauth_null (struct svc_req *, struct rpc_msg *); +enum auth_stat _svcauth_short (struct svc_req *, struct rpc_msg *); +enum auth_stat _svcauth_unix (struct svc_req *, struct rpc_msg *); +__END_DECLS + +#define AUTH_NONE 0 /* no authentication */ +#define AUTH_NULL 0 /* backward compatibility */ +#define AUTH_SYS 1 /* unix style (uid, gids) */ +#define AUTH_UNIX AUTH_SYS +#define AUTH_SHORT 2 /* short hand unix style */ +#define AUTH_DH 3 /* for Diffie-Hellman mechanism */ +#define AUTH_DES AUTH_DH /* for backward compatibility */ +#define AUTH_KERB 4 /* kerberos style */ +#define RPCSEC_GSS 6 /* RPCSEC_GSS */ + +#endif /* !_TIRPC_AUTH_H */ diff --git a/libtirpc/tirpc/rpc/auth_gss.h b/libtirpc/tirpc/rpc/auth_gss.h index c86331e..43692fe 100644 --- a/libtirpc/tirpc/rpc/auth_gss.h +++ b/libtirpc/tirpc/rpc/auth_gss.h @@ -1,156 +1,152 @@ -/* - auth_gss.h - - Copyright (c) 2000 The Regents of the University of Michigan. - All rights reserved. - - Copyright (c) 2000 Dug Song . - All rights reserved, all wrongs reversed. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the University nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* + auth_gss.h + + Copyright (c) 2000 The Regents of the University of Michigan. + All rights reserved. + + Copyright (c) 2000 Dug Song . + All rights reserved, all wrongs reversed. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. - */ -#ifndef _TIRPC_AUTH_GSS_H -#define _TIRPC_AUTH_GSS_H - -#include -#define SECURITY_WIN32 -#include - -/* RPCSEC_GSS control procedures. */ -typedef enum { - RPCSEC_GSS_DATA = 0, - RPCSEC_GSS_INIT = 1, - RPCSEC_GSS_CONTINUE_INIT = 2, - RPCSEC_GSS_DESTROY = 3 -} rpc_gss_proc_t; - -/* RPCSEC_GSS services. */ -typedef enum { - RPCSEC_GSS_SVC_NONE = 1, - RPCSEC_GSS_SVC_INTEGRITY = 2, - RPCSEC_GSS_SVC_PRIVACY = 3 -} rpc_gss_svc_t; - -#define RPCSEC_GSS_VERSION 1 - -/* RPCSEC_GSS security triple. */ -struct rpc_gss_sec { - gss_OID mech; /* mechanism */ - gss_qop_t qop; /* quality of protection */ - rpc_gss_svc_t svc; /* service */ - gss_cred_id_t cred; /* cred handle */ - u_int req_flags; /* req flags for init_sec_context */ -}; - -/* Private data required for kernel implementation */ -struct authgss_private_data { - gss_ctx_id_t pd_ctx; /* Session context handle */ - gss_buffer_desc pd_ctx_hndl; /* Credentials context handle */ - u_int pd_seq_win; /* Sequence window */ -}; - -#define g_OID_equal(o1, o2) \ - (((o1)->length == (o2)->length) && \ - ((o1)->elements != 0) && ((o2)->elements != 0) && \ - (memcmp((o1)->elements, (o2)->elements, (int) (o1)->length) == 0)) - -/* from kerberos source, gssapi_krb5.c */ -extern gss_OID_desc krb5oid; -extern gss_OID_desc spkm3oid; - -/* Credentials. */ -struct rpc_gss_cred { - u_int gc_v; /* version */ - rpc_gss_proc_t gc_proc; /* control procedure */ - u_int gc_seq; /* sequence number */ - rpc_gss_svc_t gc_svc; /* service */ - gss_buffer_desc gc_ctx; /* context handle */ -}; - -/* Context creation response. */ -struct rpc_gss_init_res { - gss_buffer_desc gr_ctx; /* context handle */ - u_int gr_major; /* major status */ - u_int gr_minor; /* minor status */ - u_int gr_win; /* sequence window */ - gss_buffer_desc gr_token; /* token */ -}; - -/* Maximum sequence number value. */ -#define MAXSEQ 0x80000000 - -/* Prototypes. */ -__BEGIN_DECLS -bool_t xdr_rpc_gss_cred __P((XDR *xdrs, struct rpc_gss_cred *p)); -bool_t xdr_rpc_gss_init_args __P((XDR *xdrs, gss_buffer_desc *p)); -bool_t xdr_rpc_gss_init_res __P((XDR *xdrs, struct rpc_gss_init_res *p)); -bool_t xdr_rpc_gss_data __P((XDR *xdrs, xdrproc_t xdr_func, - caddr_t xdr_ptr, gss_ctx_id_t ctx, - gss_qop_t qop, rpc_gss_svc_t svc, - u_int seq)); - -AUTH *authgss_create __P((CLIENT *, gss_name_t, - struct rpc_gss_sec *)); -AUTH *authgss_create_default __P((CLIENT *, char *, struct rpc_gss_sec *)); -bool_t authgss_service __P((AUTH *auth, int svc)); -bool_t authgss_get_private_data __P((AUTH *auth, - struct authgss_private_data *)); - -void log_debug __P((const char *fmt, ...)); -void log_status __P((char *m, OM_uint32 major, - OM_uint32 minor)); -void log_hexdump __P((const u_char *buf, int len, int offset)); - -__END_DECLS - -#endif /* !_TIRPC_AUTH_GSS_H */ + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA + */ + +#ifndef _TIRPC_AUTH_GSS_H +#define _TIRPC_AUTH_GSS_H + +#include +#define SECURITY_WIN32 +#include + +/* RPCSEC_GSS control procedures. */ +typedef enum { + RPCSEC_GSS_DATA = 0, + RPCSEC_GSS_INIT = 1, + RPCSEC_GSS_CONTINUE_INIT = 2, + RPCSEC_GSS_DESTROY = 3 +} rpc_gss_proc_t; + +/* RPCSEC_GSS services. */ +typedef enum { + RPCSEC_GSS_SVC_NONE = 1, + RPCSEC_GSS_SVC_INTEGRITY = 2, + RPCSEC_GSS_SVC_PRIVACY = 3 +} rpc_gss_svc_t; + +#define RPCSEC_GSS_VERSION 1 + +/* RPCSEC_GSS security triple. */ +struct rpc_gss_sec { + gss_OID mech; /* mechanism */ + gss_qop_t qop; /* quality of protection */ + rpc_gss_svc_t svc; /* service */ + gss_cred_id_t cred; /* cred handle */ + u_int req_flags; /* req flags for init_sec_context */ +}; + +/* Private data required for kernel implementation */ +struct authgss_private_data { + gss_ctx_id_t pd_ctx; /* Session context handle */ + gss_buffer_desc pd_ctx_hndl; /* Credentials context handle */ + u_int pd_seq_win; /* Sequence window */ +}; + +#define g_OID_equal(o1, o2) \ + (((o1)->length == (o2)->length) && \ + ((o1)->elements != 0) && ((o2)->elements != 0) && \ + (memcmp((o1)->elements, (o2)->elements, (int) (o1)->length) == 0)) + +/* from kerberos source, gssapi_krb5.c */ +extern gss_OID_desc krb5oid; +extern gss_OID_desc spkm3oid; + +/* Credentials. */ +struct rpc_gss_cred { + u_int gc_v; /* version */ + rpc_gss_proc_t gc_proc; /* control procedure */ + u_int gc_seq; /* sequence number */ + rpc_gss_svc_t gc_svc; /* service */ + gss_buffer_desc gc_ctx; /* context handle */ +}; + +/* Context creation response. */ +struct rpc_gss_init_res { + gss_buffer_desc gr_ctx; /* context handle */ + u_int gr_major; /* major status */ + u_int gr_minor; /* minor status */ + u_int gr_win; /* sequence window */ + gss_buffer_desc gr_token; /* token */ +}; + +/* Maximum sequence number value. */ +#define MAXSEQ 0x80000000 + +/* Prototypes. */ +__BEGIN_DECLS +bool_t xdr_rpc_gss_cred __P((XDR *xdrs, struct rpc_gss_cred *p)); +bool_t xdr_rpc_gss_init_args __P((XDR *xdrs, gss_buffer_desc *p)); +bool_t xdr_rpc_gss_init_res __P((XDR *xdrs, struct rpc_gss_init_res *p)); +bool_t xdr_rpc_gss_data __P((XDR *xdrs, xdrproc_t xdr_func, + caddr_t xdr_ptr, gss_ctx_id_t ctx, + gss_qop_t qop, rpc_gss_svc_t svc, + u_int seq)); + +AUTH *authgss_create __P((CLIENT *, gss_name_t, + struct rpc_gss_sec *)); +AUTH *authgss_create_default __P((CLIENT *, char *, struct rpc_gss_sec *)); +bool_t authgss_service __P((AUTH *auth, int svc)); +bool_t authgss_get_private_data __P((AUTH *auth, + struct authgss_private_data *)); + +void log_debug __P((const char *fmt, ...)); +void log_status __P((char *m, OM_uint32 major, + OM_uint32 minor)); +void log_hexdump __P((const u_char *buf, int len, int offset)); + +__END_DECLS + +#endif /* !_TIRPC_AUTH_GSS_H */ diff --git a/libtirpc/tirpc/rpc/auth_sspi.h b/libtirpc/tirpc/rpc/auth_sspi.h index c294eb7..fb965d7 100644 --- a/libtirpc/tirpc/rpc/auth_sspi.h +++ b/libtirpc/tirpc/rpc/auth_sspi.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef _TIRPC_AUTH_GSS_H diff --git a/libtirpc/tirpc/rpc/clnt.h b/libtirpc/tirpc/rpc/clnt.h index 31866df..0ee9724 100644 --- a/libtirpc/tirpc/rpc/clnt.h +++ b/libtirpc/tirpc/rpc/clnt.h @@ -39,32 +39,27 @@ * All rights reserved. */ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ + #ifndef _TIRPC_CLNT_H_ #define _TIRPC_CLNT_H_ diff --git a/libtirpc/tirpc/rpc/rpc_msg.h b/libtirpc/tirpc/rpc/rpc_msg.h index 957ffde..fea3da0 100644 --- a/libtirpc/tirpc/rpc/rpc_msg.h +++ b/libtirpc/tirpc/rpc/rpc_msg.h @@ -1,250 +1,245 @@ -/* $NetBSD: rpc_msg.h,v 1.11 2000/06/02 22:57:56 fvdl Exp $ */ - -/* - * Copyright (c) 2009, Sun Microsystems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of Sun Microsystems, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * from: @(#)rpc_msg.h 1.7 86/07/16 SMI - * from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC - * $FreeBSD: src/include/rpc/rpc_msg.h,v 1.15 2003/01/01 18:48:42 schweikh Exp $ - */ - -/* - * rpc_msg.h - * rpc message definition - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ - -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* $NetBSD: rpc_msg.h,v 1.11 2000/06/02 22:57:56 fvdl Exp $ */ + +/* + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of Sun Microsystems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * from: @(#)rpc_msg.h 1.7 86/07/16 SMI + * from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC + * $FreeBSD: src/include/rpc/rpc_msg.h,v 1.15 2003/01/01 18:48:42 schweikh Exp $ + */ + +/* + * rpc_msg.h + * rpc message definition + * + * Copyright (C) 1984, Sun Microsystems, Inc. + */ + +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. - */ -#ifndef _TIRPC_RPC_MSG_H -#define _TIRPC_RPC_MSG_H - -#define RPC_MSG_VERSION ((u_int32_t) 2) -#define RPC_SERVICE_PORT ((u_short) 2048) - -#include - -/* - * Bottom up definition of an rpc message. - * NOTE: call and reply use the same overall stuct but - * different parts of unions within it. - */ - -enum msg_type { - CALL=0, - REPLY=1 -}; - -enum reply_stat { - MSG_ACCEPTED=0, - MSG_DENIED=1 -}; - -enum accept_stat { - SUCCESS=0, - PROG_UNAVAIL=1, - PROG_MISMATCH=2, - PROC_UNAVAIL=3, - GARBAGE_ARGS=4, - SYSTEM_ERR=5 -}; - -enum reject_stat { - RPC_MISMATCH=0, - AUTH_ERROR=1 -}; - -/* - * Reply part of an rpc exchange - */ - -/* - * Reply to an rpc request that was accepted by the server. - * Note: there could be an error even though the request was - * accepted. - */ -struct accepted_reply { - struct opaque_auth ar_verf; - enum accept_stat ar_stat; - union { - struct { - rpcvers_t low; - rpcvers_t high; - } AR_versions; - struct { - caddr_t where; - xdrproc_t proc; - } AR_results; - /* and many other null cases */ - } ru; -#define ar_results ru.AR_results -#define ar_vers ru.AR_versions -}; - -/* - * Reply to an rpc request that was rejected by the server. - */ -struct rejected_reply { - enum reject_stat rj_stat; - union { - struct { - rpcvers_t low; - rpcvers_t high; - } RJ_versions; - enum auth_stat RJ_why; /* why authentication did not work */ - } ru; -#define rj_vers ru.RJ_versions -#define rj_why ru.RJ_why -}; - -/* - * Body of a reply to an rpc request. - */ -struct reply_body { - enum reply_stat rp_stat; - union { - struct accepted_reply RP_ar; - struct rejected_reply RP_dr; - } ru; -#define rp_acpt ru.RP_ar -#define rp_rjct ru.RP_dr -}; - -/* - * Body of an rpc request call. - */ -struct call_body { - rpcvers_t cb_rpcvers; /* must be equal to two */ - rpcprog_t cb_prog; - rpcvers_t cb_vers; - rpcproc_t cb_proc; - struct opaque_auth cb_cred; - struct opaque_auth cb_verf; /* protocol specific - provided by client */ -}; - -/* - * The rpc message - */ -struct rpc_msg { - u_int32_t rm_xid; - enum msg_type rm_direction; - union { - struct call_body RM_cmb; - struct reply_body RM_rmb; - } ru; -#define rm_call ru.RM_cmb -#define rm_reply ru.RM_rmb -}; -#define acpted_rply ru.RM_rmb.ru.RP_ar -#define rjcted_rply ru.RM_rmb.ru.RP_dr - -__BEGIN_DECLS -/* - * XDR routine to handle a rpc message. - * xdr_callmsg(xdrs, cmsg) - * XDR *xdrs; - * struct rpc_msg *cmsg; - */ -extern bool_t xdr_callmsg(XDR *, struct rpc_msg *); - -/* - * XDR routine to pre-serialize the static part of a rpc message. - * xdr_callhdr(xdrs, cmsg) - * XDR *xdrs; - * struct rpc_msg *cmsg; - */ -extern bool_t xdr_callhdr(XDR *, struct rpc_msg *); - -/* - * XDR routine to handle a rpc reply. - * xdr_replymsg(xdrs, rmsg) - * XDR *xdrs; - * struct rpc_msg *rmsg; - */ -extern bool_t xdr_replymsg(XDR *, struct rpc_msg *); - -/* - * XDR routine to read just xid and direction, then union - * xdr_getxiddir(xdrs, rmsg) - * XDR *xdrs; - * struct rpc_msg *rmsg; - */ -extern bool_t xdr_getxiddir(XDR *, struct rpc_msg *); -extern bool_t xdr_getreplyunion(XDR *, struct rpc_msg *); -extern bool_t xdr_getcallbody(XDR *, struct rpc_msg *); - -/* - * XDR routine to handle an accepted rpc reply. - * xdr_accepted_reply(xdrs, rej) - * XDR *xdrs; - * struct accepted_reply *rej; - */ -extern bool_t xdr_accepted_reply(XDR *, struct accepted_reply *); - -/* - * XDR routine to handle a rejected rpc reply. - * xdr_rejected_reply(xdrs, rej) - * XDR *xdrs; - * struct rejected_reply *rej; - */ -extern bool_t xdr_rejected_reply(XDR *, struct rejected_reply *); - -/* - * Fills in the error part of a reply message. - * _seterr_reply(msg, error) - * struct rpc_msg *msg; - * struct rpc_err *error; - */ -extern void _seterr_reply(struct rpc_msg *, struct rpc_err *); -__END_DECLS - -#endif /* !_TIRPC_RPC_MSG_H */ + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA + */ + +#ifndef _TIRPC_RPC_MSG_H +#define _TIRPC_RPC_MSG_H + +#define RPC_MSG_VERSION ((u_int32_t) 2) +#define RPC_SERVICE_PORT ((u_short) 2048) + +#include + +/* + * Bottom up definition of an rpc message. + * NOTE: call and reply use the same overall stuct but + * different parts of unions within it. + */ + +enum msg_type { + CALL=0, + REPLY=1 +}; + +enum reply_stat { + MSG_ACCEPTED=0, + MSG_DENIED=1 +}; + +enum accept_stat { + SUCCESS=0, + PROG_UNAVAIL=1, + PROG_MISMATCH=2, + PROC_UNAVAIL=3, + GARBAGE_ARGS=4, + SYSTEM_ERR=5 +}; + +enum reject_stat { + RPC_MISMATCH=0, + AUTH_ERROR=1 +}; + +/* + * Reply part of an rpc exchange + */ + +/* + * Reply to an rpc request that was accepted by the server. + * Note: there could be an error even though the request was + * accepted. + */ +struct accepted_reply { + struct opaque_auth ar_verf; + enum accept_stat ar_stat; + union { + struct { + rpcvers_t low; + rpcvers_t high; + } AR_versions; + struct { + caddr_t where; + xdrproc_t proc; + } AR_results; + /* and many other null cases */ + } ru; +#define ar_results ru.AR_results +#define ar_vers ru.AR_versions +}; + +/* + * Reply to an rpc request that was rejected by the server. + */ +struct rejected_reply { + enum reject_stat rj_stat; + union { + struct { + rpcvers_t low; + rpcvers_t high; + } RJ_versions; + enum auth_stat RJ_why; /* why authentication did not work */ + } ru; +#define rj_vers ru.RJ_versions +#define rj_why ru.RJ_why +}; + +/* + * Body of a reply to an rpc request. + */ +struct reply_body { + enum reply_stat rp_stat; + union { + struct accepted_reply RP_ar; + struct rejected_reply RP_dr; + } ru; +#define rp_acpt ru.RP_ar +#define rp_rjct ru.RP_dr +}; + +/* + * Body of an rpc request call. + */ +struct call_body { + rpcvers_t cb_rpcvers; /* must be equal to two */ + rpcprog_t cb_prog; + rpcvers_t cb_vers; + rpcproc_t cb_proc; + struct opaque_auth cb_cred; + struct opaque_auth cb_verf; /* protocol specific - provided by client */ +}; + +/* + * The rpc message + */ +struct rpc_msg { + u_int32_t rm_xid; + enum msg_type rm_direction; + union { + struct call_body RM_cmb; + struct reply_body RM_rmb; + } ru; +#define rm_call ru.RM_cmb +#define rm_reply ru.RM_rmb +}; +#define acpted_rply ru.RM_rmb.ru.RP_ar +#define rjcted_rply ru.RM_rmb.ru.RP_dr + +__BEGIN_DECLS +/* + * XDR routine to handle a rpc message. + * xdr_callmsg(xdrs, cmsg) + * XDR *xdrs; + * struct rpc_msg *cmsg; + */ +extern bool_t xdr_callmsg(XDR *, struct rpc_msg *); + +/* + * XDR routine to pre-serialize the static part of a rpc message. + * xdr_callhdr(xdrs, cmsg) + * XDR *xdrs; + * struct rpc_msg *cmsg; + */ +extern bool_t xdr_callhdr(XDR *, struct rpc_msg *); + +/* + * XDR routine to handle a rpc reply. + * xdr_replymsg(xdrs, rmsg) + * XDR *xdrs; + * struct rpc_msg *rmsg; + */ +extern bool_t xdr_replymsg(XDR *, struct rpc_msg *); + +/* + * XDR routine to read just xid and direction, then union + * xdr_getxiddir(xdrs, rmsg) + * XDR *xdrs; + * struct rpc_msg *rmsg; + */ +extern bool_t xdr_getxiddir(XDR *, struct rpc_msg *); +extern bool_t xdr_getreplyunion(XDR *, struct rpc_msg *); +extern bool_t xdr_getcallbody(XDR *, struct rpc_msg *); + +/* + * XDR routine to handle an accepted rpc reply. + * xdr_accepted_reply(xdrs, rej) + * XDR *xdrs; + * struct accepted_reply *rej; + */ +extern bool_t xdr_accepted_reply(XDR *, struct accepted_reply *); + +/* + * XDR routine to handle a rejected rpc reply. + * xdr_rejected_reply(xdrs, rej) + * XDR *xdrs; + * struct rejected_reply *rej; + */ +extern bool_t xdr_rejected_reply(XDR *, struct rejected_reply *); + +/* + * Fills in the error part of a reply message. + * _seterr_reply(msg, error) + * struct rpc_msg *msg; + * struct rpc_err *error; + */ +extern void _seterr_reply(struct rpc_msg *, struct rpc_err *); +__END_DECLS + +#endif /* !_TIRPC_RPC_MSG_H */ diff --git a/libtirpc/tirpc/rpc/types.h b/libtirpc/tirpc/rpc/types.h index 7d8e585..afb0a53 100644 --- a/libtirpc/tirpc/rpc/types.h +++ b/libtirpc/tirpc/rpc/types.h @@ -1,163 +1,159 @@ -/* $NetBSD: types.h,v 1.13 2000/06/13 01:02:44 thorpej Exp $ */ - -/* - * Copyright (c) 2009, Sun Microsystems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of Sun Microsystems, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * from: @(#)types.h 1.18 87/07/24 SMI - * from: @(#)types.h 2.3 88/08/15 4.0 RPCSRC - * $FreeBSD: src/include/rpc/types.h,v 1.10.6.1 2003/12/18 00:59:50 peter Exp $ - */ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* $NetBSD: types.h,v 1.13 2000/06/13 01:02:44 thorpej Exp $ */ + +/* + * Copyright (c) 2009, Sun Microsystems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * - Neither the name of Sun Microsystems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * from: @(#)types.h 1.18 87/07/24 SMI + * from: @(#)types.h 2.3 88/08/15 4.0 RPCSRC + * $FreeBSD: src/include/rpc/types.h,v 1.10.6.1 2003/12/18 00:59:50 peter Exp $ + */ + +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. - */ -/* - * Rpc additions to - */ -#ifndef _TIRPC_TYPES_H -#define _TIRPC_TYPES_H - -#include -//#include - -// Windows mappings of data types -// Fixed size things -typedef INT16 int16_t; -typedef INT32 int32_t; -typedef INT64 int64_t; -typedef UINT16 u_int16_t; -typedef UINT32 u_int32_t; -typedef UINT32 uint32_t; -typedef UINT64 u_int64_t; -typedef UINT64 uint64_t; -typedef PCHAR caddr_t; -// Scalable things -typedef UCHAR u_char; -typedef unsigned short u_short; -typedef UINT32 u_int; -typedef UINT32 uint; - -typedef INT64 quad_t; -typedef UINT64 u_quad_t; - -typedef UINT uid_t; -typedef UINT gid_t; -typedef DWORD pid_t; - -//typedef SIZE_T size_t; //This is causing a "benign redefinition error" -typedef SSIZE_T ssize_t; -// End of Windows... - -typedef int32_t bool_t; -typedef int32_t enum_t; - -typedef u_int32_t rpcprog_t; -typedef u_int32_t rpcvers_t; -typedef u_int32_t rpcproc_t; -typedef u_int32_t rpcprot_t; -typedef u_int32_t rpcport_t; -typedef int32_t rpc_inline_t; - -#ifndef NULL -# define NULL 0 -#endif -#define __dontcare__ -1 - -#ifndef FALSE -# define FALSE (0) -#endif -#ifndef TRUE -# define TRUE (1) -#endif - -#define mem_alloc(bsize) calloc(1, bsize) -#define mem_free(ptr, bsize) free(ptr) - -//#include -//#include -#include -#include - -/* - * The netbuf structure is defined here, because FreeBSD / NetBSD only use - * it inside the RPC code. It's in on SVR4, but it would be confusing - * to have an xti.h, since FreeBSD / NetBSD does not support XTI/TLI. - */ - -/* - * The netbuf structure is used for transport-independent address storage. - */ -struct netbuf { - unsigned int maxlen; - unsigned int len; - void *buf; -}; - -/* - * The format of the addres and options arguments of the XTI t_bind call. - * Only provided for compatibility, it should not be used. - */ - -struct t_bind { - struct netbuf addr; - unsigned int qlen; -}; - -/* - * Internal library and rpcbind use. This is not an exported interface, do - * not use. - */ -struct __rpc_sockinfo { - ADDRESS_FAMILY si_af; - int si_proto; - int si_socktype; - int si_alen; -}; - -#endif /* _TIRPC_TYPES_H */ + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA + */ + +/* + * Rpc additions to + */ +#ifndef _TIRPC_TYPES_H +#define _TIRPC_TYPES_H + +#include +//#include + +// Windows mappings of data types +// Fixed size things +typedef INT16 int16_t; +typedef INT32 int32_t; +typedef INT64 int64_t; +typedef UINT16 u_int16_t; +typedef UINT32 u_int32_t; +typedef UINT32 uint32_t; +typedef UINT64 u_int64_t; +typedef UINT64 uint64_t; +typedef PCHAR caddr_t; +// Scalable things +typedef UCHAR u_char; +typedef unsigned short u_short; +typedef UINT32 u_int; +typedef UINT32 uint; + +typedef INT64 quad_t; +typedef UINT64 u_quad_t; + +typedef UINT uid_t; +typedef UINT gid_t; +typedef DWORD pid_t; + +//typedef SIZE_T size_t; //This is causing a "benign redefinition error" +typedef SSIZE_T ssize_t; +// End of Windows... + +typedef int32_t bool_t; +typedef int32_t enum_t; + +typedef u_int32_t rpcprog_t; +typedef u_int32_t rpcvers_t; +typedef u_int32_t rpcproc_t; +typedef u_int32_t rpcprot_t; +typedef u_int32_t rpcport_t; +typedef int32_t rpc_inline_t; + +#ifndef NULL +# define NULL 0 +#endif +#define __dontcare__ -1 + +#ifndef FALSE +# define FALSE (0) +#endif +#ifndef TRUE +# define TRUE (1) +#endif + +#define mem_alloc(bsize) calloc(1, bsize) +#define mem_free(ptr, bsize) free(ptr) + +//#include +//#include +#include +#include + +/* + * The netbuf structure is defined here, because FreeBSD / NetBSD only use + * it inside the RPC code. It's in on SVR4, but it would be confusing + * to have an xti.h, since FreeBSD / NetBSD does not support XTI/TLI. + */ + +/* + * The netbuf structure is used for transport-independent address storage. + */ +struct netbuf { + unsigned int maxlen; + unsigned int len; + void *buf; +}; + +/* + * The format of the addres and options arguments of the XTI t_bind call. + * Only provided for compatibility, it should not be used. + */ + +struct t_bind { + struct netbuf addr; + unsigned int qlen; +}; + +/* + * Internal library and rpcbind use. This is not an exported interface, do + * not use. + */ +struct __rpc_sockinfo { + ADDRESS_FAMILY si_af; + int si_proto; + int si_socktype; + int si_alen; +}; + +#endif /* _TIRPC_TYPES_H */ diff --git a/libtirpc/tirpc/wintirpc.h b/libtirpc/tirpc/wintirpc.h index 6e49b2b..a2ed188 100644 --- a/libtirpc/tirpc/wintirpc.h +++ b/libtirpc/tirpc/wintirpc.h @@ -1,28 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley - * Kevin Coffman * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef _TIRPC_WINTIRPC_H diff --git a/mount/enum.c b/mount/enum.c index d19a6ba..c0de2bb 100644 --- a/mount/enum.c +++ b/mount/enum.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/mount/mount.c b/mount/mount.c index 2974173..24249f9 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/mount/options.c b/mount/options.c index fc53490..2a2166f 100644 --- a/mount/options.c +++ b/mount/options.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include diff --git a/mount/options.h b/mount/options.h index 0064b48..29bc0fe 100644 --- a/mount/options.h +++ b/mount/options.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef __NFS41_MOUNT_OPTIONS_H__ diff --git a/sys/nfs41_debug.c b/sys/nfs41_debug.c index cb95ecb..3c95198 100644 --- a/sys/nfs41_debug.c +++ b/sys/nfs41_debug.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #define MINIRDR__NAME "Value is ignored, only fact of definition" diff --git a/sys/nfs41_debug.h b/sys/nfs41_debug.h index eeb89af..6297a1a 100644 --- a/sys/nfs41_debug.h +++ b/sys/nfs41_debug.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef _NFS41_DEBUG_ diff --git a/sys/nfs41_driver.c b/sys/nfs41_driver.c index 59eada0..fd85a85 100644 --- a/sys/nfs41_driver.c +++ b/sys/nfs41_driver.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #define MINIRDR__NAME "Value is ignored, only fact of definition" diff --git a/sys/nfs41_driver.h b/sys/nfs41_driver.h index e1a70cb..f11eda8 100644 --- a/sys/nfs41_driver.h +++ b/sys/nfs41_driver.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef _NFS41_DRIVER_ diff --git a/sys/wmlkm.c b/sys/wmlkm.c index 68f5d5b..6c7161c 100644 --- a/sys/wmlkm.c +++ b/sys/wmlkm.c @@ -1,30 +1,26 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA * * Comments: RDBSS depends on wmlkm files. See comments in nulmrx/wmlkm */ + #pragma hdrstop #include diff --git a/sys/wmlkm.h b/sys/wmlkm.h index f2ca46b..cb42710 100644 --- a/sys/wmlkm.h +++ b/sys/wmlkm.h @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved - * +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan + * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #ifndef NFS41_WMLKM_H diff --git a/tests/asio/asio.c b/tests/asio/asio.c index 5423ec1..f8a2490 100644 --- a/tests/asio/asio.c +++ b/tests/asio/asio.c @@ -1,27 +1,22 @@ -/* Copyright (c) 2010, 2011 - * The Regents of the University of Michigan - * All Rights Reserved +/* NFSv4.1 client for Windows + * Copyright © 2012 The Regents of the University of Michigan * * Olga Kornievskaia * Casey Bodley * - * Permission is granted to use, copy and redistribute this software - * for noncommercial education and research purposes, so long as no - * fee is charged, and so long as the name of the University of Michigan - * is not used in any advertising or publicity pertaining to the use - * or distribution of this software without specific, written prior - * authorization. Permission to modify or otherwise create derivative - * works of this software is not granted. + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or (at + * your option) any later version. * - * This software is provided as is, without representation or warranty - * of any kind either express or implied, including without limitation - * the implied warranties of merchantability, fitness for a particular - * purpose, or noninfringement. The Regents of the University of - * Michigan shall not be liable for any damages, including special, - * indirect, incidental, or consequential damages, with respect to any - * claim arising out of or in connection with the use of the software, - * even if it has been or is hereafter advised of the possibility of - * such damages. + * This library is distributed in the hope that it will be useful, but + * without any warranty; without even the implied warranty of merchantability + * or fitness for a particular purpose. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ #include