[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#629543: NFS support



tags 629543 patch
thanks

Here's a patch that adds NFS utilities to freebsd-utils.  It's based
on Karl Ramm's port with some cleanup of mine.

It depends on my requested addition to kfreebsd-kernel-headers
(bug just filed).  It can also be simplified further when
#629556 (libc0.1) is fixed.

2011/6/7 Robert Millan <rmh@debian.org>:
> Package: freebsd-utils
> Version: 8.2-1
> Severity: wishlist
>
> Karl Ramm <kcr@1ts.org> writes:
>> My work-in-progress package (not rc scripts, and the copyright file isn't
>> populated yet) can be found at
>>
>> http://people.debian.org/~kcr/freebsd/
>>
>> I'll put something about making tirpc (and rpcbind) build there in a bit.
>>
>> I'm not sure if I want to end up _maintaining_ this, but...
>
> Usual convention for this kind of things would be to merge it
> in freebsd-utils. I'm opening a bug to keep track of this.
> Could you consider merging your package there?
>
> --
> Robert Millan
>



-- 
Robert Millan
Index: debian/control
===================================================================
--- debian/control	(revision 3422)
+++ debian/control	(working copy)
@@ -5,7 +5,7 @@
 Uploaders: Aurelien Jarno <aurel32@debian.org>, Guillem Jover <guillem@debian.org>
 Build-Depends: debhelper (>= 7), po-debconf, freebsd-buildutils, sharutils,
  flex | flex-old,
- kfreebsd-kernel-headers (>= 0.54),
+ kfreebsd-kernel-headers (>= 0.56.xxx.FIXME),
 # libc0.1-dev (>= 2.11.2-3): ifconfig
  libc0.1-dev (>= 2.11.2),
  libbsd-dev (>= 0.2.0),
@@ -26,7 +26,9 @@
 # libcam-dev: camcontrol
  libcam-dev (>= 8.2),
 # libedit-dev: pppctl
- libedit-dev
+ libedit-dev,
+# libtirpc-dev: nfsd
+ libtirpc-dev,
 Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/freebsd-utils/
 Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/freebsd-utils/
 Standards-Version: 3.9.2
@@ -114,6 +116,16 @@
  .
  This is a minimal package for use in debian-installer.
 
+Package: freebsd-nfs-utils
+Section: net
+Priority: important
+Architecture: kfreebsd-any
+Depends: rpcbind, ${shlibs:Depends}
+Provides: nfs-common, nfs-server, nfs-kernel-server
+Description: FreeBSD utilities needed for NFS on GNU/kFreeBSD
+ This package provides FreeBSD NFS utilities needed for NFS client and server
+ on Debian GNU/kFreeBSD.
+
 # FIXME:
 # - add jail
 # - add ppp (ppp, pppd)
Index: debian/patches/series
===================================================================
--- debian/patches/series	(revision 3422)
+++ debian/patches/series	(working copy)
@@ -28,3 +28,4 @@
 029_arp.diff
 030_arp_libbsd.diff
 031_savecore.diff
+032_nfs.diff
Index: debian/patches/032_nfs.diff
===================================================================
--- debian/patches/032_nfs.diff	(revision 0)
+++ debian/patches/032_nfs.diff	(revision 0)
@@ -0,0 +1,848 @@
+--- a/sbin/mount_nfs/mount_nfs.c
++++ b/sbin/mount_nfs/mount_nfs.c
+@@ -130,14 +130,13 @@
+ 	TRYRET_LOCALERR		/* Local failure. */
+ };
+ 
+-static int	fallback_mount(struct iovec *iov, int iovlen, int mntflags);
+ static int	sec_name_to_num(char *sec);
+ static char	*sec_num_to_name(int num);
+ static int	getnfsargs(char *, struct iovec **iov, int *iovlen);
+ /* void	set_rpc_maxgrouplist(int); */
+ static struct netconfig *getnetconf_cached(const char *netid);
+ static const char	*netidbytype(int af, int sotype);
+-static void	usage(void) __dead2;
++static void	usage(void);
+ static int	xdr_dir(XDR *, char *);
+ static int	xdr_fh(XDR *, struct nfhret *);
+ static enum tryret nfs_tryproto(struct addrinfo *ai, char *hostp, char *spec,
+@@ -150,7 +149,6 @@
+ 	int c;
+ 	struct iovec *iov;
+ 	int mntflags, num, iovlen;
+-	int osversion;
+ 	char *name, *p, *spec, *fstype;
+ 	char mntpath[MAXPATHLEN], errmsg[255];
+ 	char hostname[MAXHOSTNAMELEN + 1], *gssname, gssn[MAXHOSTNAMELEN + 50];
+@@ -421,19 +419,7 @@
+ 	build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1);
+ 	build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
+ 
+-	/*
+-	 * XXX:
+-	 * Backwards compatibility routines for older kernels.
+-	 * Remove this and fallback_mount() code when we do not need to support
+-	 * NFS mounts against older kernels which still need
+-	 * struct nfs_args to be passed in via nmount().
+-	 */
+-	osversion = getosreldate();
+-	if (osversion >= 702100) {
+-		if (nmount(iov, iovlen, mntflags))
+-			err(1, "%s, %s", mntpath, errmsg);
+-	} else {
+-		if (fallback_mount(iov, iovlen, mntflags))
++        if (nmount(iov, iovlen, mntflags)) {
+ 			err(1, "%s, %s", mntpath, errmsg);
+ 	}
+ 
+@@ -441,236 +427,20 @@
+ }
+ 
+ static int
+-findopt(struct iovec *iov, int iovlen, const char *name,
+-    char **valuep, int *lenp)
+-{
+-	int i;
+-
+-	for (i = 0; i < iovlen/2; i++, iov += 2) {
+-		if (strcmp(name, iov[0].iov_base) == 0) {
+-			if (valuep)
+-				*valuep = iov[1].iov_base;
+-			if (lenp)
+-				*lenp = iov[1].iov_len;
+-			return (0);
+-		}
+-	}
+-	return (ENOENT);
+-}
+-
+-static void
+-copyopt(struct iovec **newiov, int *newiovlen,
+-    struct iovec *iov, int iovlen, const char *name)
+-{
+-	char *value;
+-	int len;
+-
+-	if (findopt(iov, iovlen, name, &value, &len) == 0)
+-		build_iovec(newiov, newiovlen, name, value, len);
+-}
+-
+-/*
+- * XXX: This function is provided for backwards
+- *      compatibility with older kernels which did not support
+- *      passing NFS mount options to nmount() as individual
+- *      parameters.  It should be eventually be removed.
+- */
+-static int
+-fallback_mount(struct iovec *iov, int iovlen, int mntflags)
+-{
+-	struct nfs_args args = {
+-	    .version = NFS_ARGSVERSION,
+-	    .addr = NULL,
+-	    .addrlen = sizeof (struct sockaddr_in),
+-	    .sotype = SOCK_STREAM,
+-	    .proto = 0,
+-	    .fh = NULL,
+-	    .fhsize = 0,
+-	    .flags = NFSMNT_RESVPORT,
+-	    .wsize = NFS_WSIZE,
+-	    .rsize = NFS_RSIZE,
+-	    .readdirsize = NFS_READDIRSIZE,
+-	    .timeo = 10,
+-	    .retrans = NFS_RETRANS,
+-	    .maxgrouplist = NFS_MAXGRPS,
+-	    .readahead = NFS_DEFRAHEAD,
+-	    .wcommitsize = 0,			/* was: NQ_DEFLEASE */
+-	    .deadthresh = NFS_MAXDEADTHRESH,	/* was: NQ_DEADTHRESH */
+-	    .hostname = NULL,
+-	    /* args version 4 */
+-	    .acregmin = NFS_MINATTRTIMO,
+-	    .acregmax = NFS_MAXATTRTIMO,
+-	    .acdirmin = NFS_MINDIRATTRTIMO,
+-	    .acdirmax = NFS_MAXDIRATTRTIMO,
+-	};
+-	int ret;
+-	char *opt;
+-	struct iovec *newiov;
+-	int newiovlen;
+-
+-	if (findopt(iov, iovlen, "dumbtimer", NULL, NULL) == 0)
+-		args.flags |= NFSMNT_DUMBTIMR;
+-	if (findopt(iov, iovlen, "noconn", NULL, NULL) == 0)
+-		args.flags |= NFSMNT_NOCONN;
+-	if (findopt(iov, iovlen, "conn", NULL, NULL) == 0)
+-		args.flags |= NFSMNT_NOCONN;
+-	if (findopt(iov, iovlen, "nolockd", NULL, NULL) == 0)
+-		args.flags |= NFSMNT_NOLOCKD;
+-	if (findopt(iov, iovlen, "lockd", NULL, NULL) == 0)
+-		args.flags &= ~NFSMNT_NOLOCKD;
+-	if (findopt(iov, iovlen, "intr", NULL, NULL) == 0)
+-		args.flags |= NFSMNT_INT;
+-	if (findopt(iov, iovlen, "rdirplus", NULL, NULL) == 0)
+-		args.flags |= NFSMNT_RDIRPLUS;
+-	if (findopt(iov, iovlen, "resvport", NULL, NULL) == 0)
+-		args.flags |= NFSMNT_RESVPORT;
+-	if (findopt(iov, iovlen, "noresvport", NULL, NULL) == 0)
+-		args.flags &= ~NFSMNT_RESVPORT;
+-	if (findopt(iov, iovlen, "soft", NULL, NULL) == 0)
+-		args.flags |= NFSMNT_SOFT;
+-	if (findopt(iov, iovlen, "hard", NULL, NULL) == 0)
+-		args.flags &= ~NFSMNT_SOFT;
+-	if (findopt(iov, iovlen, "mntudp", NULL, NULL) == 0)
+-		args.sotype = SOCK_DGRAM;
+-	if (findopt(iov, iovlen, "udp", NULL, NULL) == 0)
+-		args.sotype = SOCK_DGRAM;
+-	if (findopt(iov, iovlen, "tcp", NULL, NULL) == 0)
+-		args.sotype = SOCK_STREAM;
+-	if (findopt(iov, iovlen, "nfsv3", NULL, NULL) == 0)
+-		args.flags |= NFSMNT_NFSV3;
+-	if (findopt(iov, iovlen, "readdirsize", &opt, NULL) == 0) {
+-		if (opt == NULL) { 
+-			errx(1, "illegal readdirsize");
+-		}
+-		ret = sscanf(opt, "%d", &args.readdirsize);
+-		if (ret != 1 || args.readdirsize <= 0) {
+-			errx(1, "illegal readdirsize: %s", opt);
+-		}
+-		args.flags |= NFSMNT_READDIRSIZE;
+-	}
+-	if (findopt(iov, iovlen, "readahead", &opt, NULL) == 0) {
+-		if (opt == NULL) { 
+-			errx(1, "illegal readahead");
+-		}
+-		ret = sscanf(opt, "%d", &args.readahead);
+-		if (ret != 1 || args.readahead <= 0) {
+-			errx(1, "illegal readahead: %s", opt);
+-		}
+-		args.flags |= NFSMNT_READAHEAD;
+-	}
+-	if (findopt(iov, iovlen, "wsize", &opt, NULL) == 0) {
+-		if (opt == NULL) { 
+-			errx(1, "illegal wsize");
+-		}
+-		ret = sscanf(opt, "%d", &args.wsize);
+-		if (ret != 1 || args.wsize <= 0) {
+-			errx(1, "illegal wsize: %s", opt);
+-		}
+-		args.flags |= NFSMNT_WSIZE;
+-	}
+-	if (findopt(iov, iovlen, "rsize", &opt, NULL) == 0) {
+-		if (opt == NULL) { 
+-			errx(1, "illegal rsize");
+-		}
+-		ret = sscanf(opt, "%d", &args.rsize);
+-		if (ret != 1 || args.rsize <= 0) {
+-			errx(1, "illegal wsize: %s", opt);
+-		}
+-		args.flags |= NFSMNT_RSIZE;
+-	}
+-	if (findopt(iov, iovlen, "retrans", &opt, NULL) == 0) {
+-		if (opt == NULL) { 
+-			errx(1, "illegal retrans");
+-		}
+-		ret = sscanf(opt, "%d", &args.retrans);
+-		if (ret != 1 || args.retrans <= 0) {
+-			errx(1, "illegal retrans: %s", opt);
+-		}
+-		args.flags |= NFSMNT_RETRANS;
+-	}
+-	if (findopt(iov, iovlen, "acregmin", &opt, NULL) == 0) {
+-		ret = sscanf(opt, "%d", &args.acregmin);
+-		if (ret != 1 || args.acregmin < 0) {
+-			errx(1, "illegal acregmin: %s", opt);
+-		}
+-		args.flags |= NFSMNT_ACREGMIN;
+-	}
+-	if (findopt(iov, iovlen, "acregmax", &opt, NULL) == 0) {
+-		ret = sscanf(opt, "%d", &args.acregmax);
+-		if (ret != 1 || args.acregmax < 0) {
+-			errx(1, "illegal acregmax: %s", opt);
+-		}
+-		args.flags |= NFSMNT_ACREGMAX;
+-	}
+-	if (findopt(iov, iovlen, "acdirmin", &opt, NULL) == 0) {
+-		ret = sscanf(opt, "%d", &args.acdirmin);
+-		if (ret != 1 || args.acdirmin < 0) {
+-			errx(1, "illegal acdirmin: %s", opt);
+-		}
+-		args.flags |= NFSMNT_ACDIRMIN;
+-	}
+-	if (findopt(iov, iovlen, "acdirmax", &opt, NULL) == 0) {
+-		ret = sscanf(opt, "%d", &args.acdirmax);
+-		if (ret != 1 || args.acdirmax < 0) {
+-			errx(1, "illegal acdirmax: %s", opt);
+-		}
+-		args.flags |= NFSMNT_ACDIRMAX;
+-	}
+-	if (findopt(iov, iovlen, "deadthresh", &opt, NULL) == 0) {
+-		ret = sscanf(opt, "%d", &args.deadthresh);
+-		if (ret != 1 || args.deadthresh <= 0) {
+-			errx(1, "illegal deadthresh: %s", opt);
+-		}
+-		args.flags |= NFSMNT_DEADTHRESH;
+-	}
+-	if (findopt(iov, iovlen, "timeout", &opt, NULL) == 0) {
+-		ret = sscanf(opt, "%d", &args.timeo);
+-		if (ret != 1 || args.timeo <= 0) {
+-			errx(1, "illegal timeout: %s", opt);
+-		}
+-		args.flags |= NFSMNT_TIMEO;
+-	}
+-	if (findopt(iov, iovlen, "maxgroups", &opt, NULL) == 0) {
+-		ret = sscanf(opt, "%d", &args.maxgrouplist);
+-		if (ret != 1 || args.timeo <= 0) {
+-			errx(1, "illegal maxgroups: %s", opt);
+-		}
+-		args.flags |= NFSMNT_MAXGRPS;
+-	}
+-	if (findopt(iov, iovlen, "addr", &opt,
+-		&args.addrlen) == 0) {
+-		args.addr = (struct sockaddr *) opt;
+-	}
+-	if (findopt(iov, iovlen, "fh", &opt, &args.fhsize) == 0) {
+-		args.fh = opt;
+-	}
+-	if (findopt(iov, iovlen, "hostname", &args.hostname,
+-		NULL) == 0) {
+-	}
+-	if (args.hostname == NULL) {
+-		errx(1, "Invalid hostname");
+-	}
+-
+-	newiov = NULL;
+-	newiovlen = 0;
+-
+-	build_iovec(&newiov, &newiovlen, "nfs_args", &args, sizeof(args));
+-	copyopt(&newiov, &newiovlen, iov, iovlen, "fstype");
+-	copyopt(&newiov, &newiovlen, iov, iovlen, "fspath");
+-	copyopt(&newiov, &newiovlen, iov, iovlen, "errmsg");
+-
+-	return nmount(newiov, newiovlen, mntflags);
+-}
+-
+-static int
+ sec_name_to_num(char *sec)
+ {
++#ifdef RPCSEC_GSS_KRB5
+ 	if (!strcmp(sec, "krb5"))
+ 		return (RPCSEC_GSS_KRB5);
++#endif
++#ifdef RPCSEC_GSS_KRB5I
+ 	if (!strcmp(sec, "krb5i"))
+ 		return (RPCSEC_GSS_KRB5I);
++#endif
++#ifdef RPCSEC_GSS_KRB5P
+ 	if (!strcmp(sec, "krb5p"))
+ 		return (RPCSEC_GSS_KRB5P);
++#endif
+ 	if (!strcmp(sec, "sys"))
+ 		return (AUTH_SYS);
+ 	return (-1);
+@@ -680,12 +450,18 @@
+ sec_num_to_name(int flavor)
+ {
+ 	switch (flavor) {
++#ifdef RPCSEC_GSS_KRB5
+ 	case RPCSEC_GSS_KRB5:
+ 		return ("krb5");
++#endif
++#ifdef RPCSEC_GSS_KRB5I
+ 	case RPCSEC_GSS_KRB5I:
+ 		return ("krb5i");
++#endif
++#ifdef RPCSEC_GSS_KRB5P
+ 	case RPCSEC_GSS_KRB5P:
+ 		return ("krb5p");
++#endif
+ 	case AUTH_SYS:
+ 		return ("sys");
+ 	}
+@@ -830,9 +606,11 @@
+ 	freeaddrinfo(ai_nfs);
+ 
+ 	build_iovec(iov, iovlen, "hostname", nam, (size_t)-1);
++#if 0
+ 	/* Add mounted file system to PATH_MOUNTTAB */
+ 	if (!add_mtab(hostp, spec))
+ 		warnx("can't update %s for %s:%s", PATH_MOUNTTAB, hostp, spec);
++#endif
+ 	return (1);
+ }
+ 
+--- a/sbin/mount_nfs/Makefile
++++ b/sbin/mount_nfs/Makefile
+@@ -4,6 +4,7 @@
+ 
+ PROG=	mount_nfs
+ SRCS=	mount_nfs.c getmntopts.c mounttab.c
++LDADD=	-ltirpc
+ MAN=	mount_nfs.8
+ MLINKS=	mount_nfs.8 mount_newnfs.8
+ 
+--- a/sbin/mount/getmntopts.c
++++ b/sbin/mount/getmntopts.c
+@@ -36,6 +36,7 @@
+ __FBSDID("$FreeBSD$");
+ 
+ #include <sys/param.h>
++#include <sys/types.h>
+ #include <sys/mount.h>
+ #include <sys/stat.h>
+ #include <sys/uio.h>
+--- a/usr.sbin/mountd/Makefile
++++ b/usr.sbin/mountd/Makefile
+@@ -2,16 +2,16 @@
+ # $FreeBSD$
+ 
+ PROG=	mountd
+-SRCS=	mountd.c getmntopts.c
++SRCS=	mountd.c getmntopts.c getvfsbyname.c
+ MAN=	exports.5 netgroup.5 mountd.8
+ 
+ MOUNT=  ${.CURDIR}/../../sbin/mount
+-CFLAGS+= -I${MOUNT}
++CFLAGS+= -I${MOUNT} -I${.CURDIR}/../../sys
+ WARNS?= 2
+ 
+-.PATH: ${MOUNT}
++.PATH: ${MOUNT} ../../lib/libc/gen
+ 
+ DPADD=	${LIBUTIL}
+-LDADD=	-lutil
++LDADD=	-ltirpc -lbsd
+ 
+ .include <bsd.prog.mk>
+--- a/usr.sbin/mountd/mountd.c
++++ b/usr.sbin/mountd/mountd.c
+@@ -49,10 +49,32 @@
+ #include <sys/fcntl.h>
+ #include <sys/linker.h>
+ #include <sys/module.h>
++
+ #include <sys/mount.h>
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
+ #include <sys/stat.h>
+ #include <sys/sysctl.h>
+ #include <sys/syslog.h>
++#include <sys/syscall.h>
+ 
+ #include <rpc/rpc.h>
+ #include <rpc/rpc_com.h>
+@@ -79,6 +101,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <bsd/string.h>
+ #include <unistd.h>
+ #include "pathnames.h"
+ #include "mntopts.h"
+@@ -87,6 +110,14 @@
+ #include <stdarg.h>
+ #endif
+ 
++#ifndef IPPORT_MAX
++#define IPPORT_MAX 65535
++#endif
++
++static int nfssvc(int flags, void *args) {
++    return syscall(SYS_nfssvc, flags, args);
++}
++
+ /*
+  * Structures for keeping the mount list and export list
+  */
+@@ -1926,12 +1957,18 @@
+ 
+ 		if (!strcmp(seclist, "sys"))
+ 			flavor = AUTH_SYS;
++#ifdef RPCSEC_GSS_KRB5
+ 		else if (!strcmp(seclist, "krb5"))
+ 			flavor = RPCSEC_GSS_KRB5;
++#endif
++#ifdef RPCSEC_GSS_KRB5I
+ 		else if (!strcmp(seclist, "krb5i"))
+ 			flavor = RPCSEC_GSS_KRB5I;
++#endif
++#ifdef RPCSEC_GSS_KRB5P
+ 		else if (!strcmp(seclist, "krb5p"))
+ 			flavor = RPCSEC_GSS_KRB5P;
++#endif
+ 		else {
+ 			if (cp)
+ 				*cp = savedc;
+--- a/lib/libc/gen/getvfsbyname.c
++++ b/lib/libc/gen/getvfsbyname.c
+@@ -34,6 +34,7 @@
+ __FBSDID("$FreeBSD$");
+ 
+ #include <sys/param.h>
++#include <sys/types.h>
+ #include <sys/mount.h>
+ #include <sys/sysctl.h>
+ #include <errno.h>
+--- a/usr.sbin/nfsd/Makefile
++++ b/usr.sbin/nfsd/Makefile
+@@ -3,6 +3,8 @@
+ 
+ PROG=	nfsd
+ MAN=	nfsd.8 nfsv4.4 stablerestart.5
++CFLAGS+= -I${.CURDIR}/../../sys
++LDADD=   -ltirpc -lbsd
+ 
+ WARNS?=	6
+ 
+--- a/usr.sbin/nfsd/nfsd.c
++++ b/usr.sbin/nfsd/nfsd.c
+@@ -51,6 +51,7 @@
+ #include <sys/fcntl.h>
+ #include <sys/linker.h>
+ #include <sys/module.h>
++#include <sys/syscall.h>
+ 
+ #include <rpc/rpc.h>
+ #include <rpc/pmap_clnt.h>
+@@ -70,6 +71,10 @@
+ #include <unistd.h>
+ #include <netdb.h>
+ 
++static int nfssvc(int flags, void *args) {
++    return syscall(SYS_nfssvc, flags, args);
++}
++
+ /* Global defs */
+ #ifdef DEBUG
+ #define	syslog(e, s...)	fprintf(stderr,s)
+@@ -849,13 +854,13 @@
+ }
+ 
+ void
+-nonfs(__unused int signo)
++nonfs(int signo)
+ {
+ 	syslog(LOG_ERR, "missing system call: NFS not available");
+ }
+ 
+ void
+-reapchild(__unused int signo)
++reapchild(int signo)
+ {
+ 	pid_t pid;
+ 	int i;
+@@ -890,7 +895,7 @@
+  * Cleanup master after SIGUSR1.
+  */
+ void
+-cleanup(__unused int signo)
++cleanup(int signo)
+ {
+ 	nfsd_exit(0);
+ }
+@@ -899,7 +904,7 @@
+  * Cleanup child after SIGUSR1.
+  */
+ void
+-child_cleanup(__unused int signo)
++child_cleanup(int signo)
+ {
+ 	exit(0);
+ }
+--- a/sbin/nfsiod/Makefile
++++ b/sbin/nfsiod/Makefile
+@@ -2,7 +2,10 @@
+ # $FreeBSD$
+ 
+ PROG=	nfsiod
++SRCS=	nfsiod.c getvfsbyname.c
+ WARNS?=	6
+ MAN=	nfsiod.8
+ 
++.PATH: ${.CURDIR}/../../lib/libc/gen
++
+ .include <bsd.prog.mk>
+--- a/usr.sbin/rpc.lockd/Makefile
++++ b/usr.sbin/rpc.lockd/Makefile
+@@ -4,26 +4,29 @@
+ PROG=	rpc.lockd
+ MAN=	rpc.lockd.8
+ MLINKS=	rpc.lockd.8 lockd.8
+-SRCS=	kern.c nlm_prot_svc.c lockd.c lock_proc.c lockd_lock.c
++SRCS=	kern.c nlm_prot_svc.c nlm_prot_xdr.c lockd.c lock_proc.c lockd_lock.c sm_inter_xdr.c
+ 
+-CFLAGS+= -I. -I${DESTDIR}/usr/include/rpcsvc
++CFLAGS+= -I. -I${.CURDIR}/../../include/rpcsvc
+ #WARNS?= 2
+ 
+ DPADD=	${LIBRPCSVC} ${LIBUTIL}
+-LDADD=	-lrpcsvc -lutil
++LDADD=	-ltirpc -lbsd
+ 
+-CLEANFILES= nlm_prot_svc.c nlm_prot.h test
++CLEANFILES= nlm_prot_svc.c nlm_prot_xdr.c nlm_prot.h test
+ 
+-RPCSRC= ${DESTDIR}/usr/include/rpcsvc/nlm_prot.x
++RPCSRC= ${.CURDIR}/../../include/rpcsvc/nlm_prot.x
+ RPCGEN= rpcgen -L -C
+ 
++.PATH: ../rpc.statd
++
+ nlm_prot_svc.c: ${RPCSRC}
+ 	${RPCGEN} -m -o ${.TARGET} ${RPCSRC}
+ 
+-nlm_prot.h: ${RPCSRC}
+-	${RPCGEN} -h -o ${.TARGET} ${RPCSRC}
++nlm_prot_xdr.c: ${RPCSRC}
++	${RPCGEN} -c -o ${.TARGET} ${RPCSRC}
+ 
+ test: ${.CURDIR}/test.c
+ 	cc -o test ${.CURDIR}/test.c -lrpcsvc
+ 
++
+ .include <bsd.prog.mk>
+--- a/usr.sbin/rpc.lockd/lockd.c
++++ b/usr.sbin/rpc.lockd/lockd.c
+@@ -74,6 +74,10 @@
+ #include "lockd.h"
+ #include <rpcsvc/nlm_prot.h>
+ 
++#ifndef IPPORT_MAX
++#define IPPORT_MAX 65535
++#endif
++
+ int		debug_level = 0;	/* 0 = no debugging syslog() calls */
+ int		_rpcsvcdirty = 0;
+ 
+@@ -187,8 +191,7 @@
+ 		kernel_lockd = TRUE;
+ 	}
+ 	if (kernel_lockd) {
+-		if (getosreldate() >= 800040)
+-			kernel_lockd_client = TRUE;
++                kernel_lockd_client = TRUE;
+ 	}
+ 
+ 	(void)rpcb_unset(NLM_PROG, NLM_SM, NULL);
+@@ -358,7 +361,7 @@
+ 			 * wait for RPCs on our local domain socket.
+ 			 */
+ 			if (!fork())
+-				nlm_syscall(debug_level, grace_period,
++                                syscall(154, debug_level, grace_period,
+ 				    naddrs, addrs);
+ 			else
+ 				svc_run();
+@@ -368,7 +371,7 @@
+ 			 * both client and server so we don't need to
+ 			 * do anything else.
+ 			 */
+-			nlm_syscall(debug_level, grace_period, naddrs, addrs);
++                         syscall(154, debug_level, grace_period, naddrs, addrs);
+ 		}
+ 	} else {
+ 		grace_expired = 0;
+@@ -807,7 +810,7 @@
+ 		ret = callrpc("localhost", SM_PROG, SM_VERS, SM_UNMON_ALL,
+ 		    (xdrproc_t)xdr_my_id, &id, (xdrproc_t)xdr_sm_stat, &stat);
+ 		if (ret == RPC_PROGUNAVAIL) {
+-			syslog(LOG_WARNING, "%lu %s", SM_PROG,
++			syslog(LOG_WARNING, "%u %s", SM_PROG,
+ 			    clnt_sperrno(ret));
+ 			sleep(2);
+ 			continue;
+@@ -816,7 +819,7 @@
+ 	} while (0);
+ 
+ 	if (ret != 0) {
+-		syslog(LOG_ERR, "%lu %s", SM_PROG, clnt_sperrno(ret));
++		syslog(LOG_ERR, "%u %s", SM_PROG, clnt_sperrno(ret));
+ 		exit(1);
+ 	}
+ 
+--- a/usr.sbin/rpc.lockd/lock_proc.c
++++ b/usr.sbin/rpc.lockd/lock_proc.c
+@@ -770,7 +770,7 @@
+  */
+ void *
+ nlm_cancel_res_1_svc(arg, rqstp)
+-	nlm_res *arg __unused;
++	nlm_res *arg;
+ 	struct svc_req *rqstp;
+ {
+ 	if (debug_level)
+@@ -803,7 +803,7 @@
+  */
+ void *
+ nlm_granted_res_1_svc(arg, rqstp)
+-	nlm_res *arg __unused;
++	nlm_res *arg;
+ 	struct svc_req *rqstp;
+ {
+ 	if (debug_level)
+@@ -902,7 +902,7 @@
+  */
+ void *
+ nlm_free_all_3_svc(arg, rqstp)
+-	nlm_notify *arg __unused;
++	nlm_notify *arg;
+ 	struct svc_req *rqstp;
+ {
+ 	static char dummy;
+@@ -1260,7 +1260,7 @@
+  */
+ void *
+ nlm4_cancel_res_4_svc(arg, rqstp)
+-	nlm4_res *arg __unused;
++	nlm4_res *arg;
+ 	struct svc_req *rqstp;
+ {
+ 	if (debug_level)
+@@ -1275,7 +1275,7 @@
+  */
+ void *
+ nlm4_unlock_res_4_svc(arg, rqstp)
+-	nlm4_res *arg __unused;
++	nlm4_res *arg;
+ 	struct svc_req *rqstp;
+ {
+ 	if (debug_level)
+@@ -1290,7 +1290,7 @@
+  */
+ void *
+ nlm4_granted_res_4_svc(arg, rqstp)
+-	nlm4_res *arg __unused;
++	nlm4_res *arg;
+ 	struct svc_req *rqstp;
+ {
+ 	if (debug_level)
+@@ -1389,7 +1389,7 @@
+  */
+ void *
+ nlm4_free_all_4_svc(arg, rqstp)
+-	struct nlm4_notify *arg __unused;
++	struct nlm4_notify *arg;
+ 	struct svc_req *rqstp;
+ {
+ 	static char dummy;
+@@ -1407,7 +1407,7 @@
+ void *
+ nlm_sm_notify_0_svc(arg, rqstp)
+ 	struct nlm_sm_status *arg;
+-	struct svc_req *rqstp __unused;
++	struct svc_req *rqstp;
+ {
+ 	static char dummy;
+ 	notify(arg->mon_name, arg->state);
+--- a/usr.sbin/rpc.lockd/lockd_lock.c
++++ b/usr.sbin/rpc.lockd/lockd_lock.c
+@@ -1176,8 +1176,8 @@
+ 
+ enum hwlock_status
+ test_hwlock(fl, conflicting_fl)
+-	const struct file_lock *fl __unused;
+-	struct file_lock **conflicting_fl __unused;
++	const struct file_lock *fl;
++	struct file_lock **conflicting_fl;
+ {
+ 
+ 	/*
+@@ -1891,7 +1891,7 @@
+  */
+ 
+ struct nlm4_holder *
+-testlock(struct nlm4_lock *lock, bool_t exclusive, int flags __unused)
++testlock(struct nlm4_lock *lock, bool_t exclusive, int flags)
+ {
+ 	struct file_lock test_fl, *conflicting_fl;
+ 
+@@ -1991,7 +1991,7 @@
+ 
+ /* unlock a filehandle */
+ enum nlm_stats
+-unlock(nlm4_lock *lock, const int flags __unused)
++unlock(nlm4_lock *lock, const int flags)
+ {
+ 	struct file_lock fl;
+ 	enum nlm_stats err;
+@@ -2187,7 +2187,7 @@
+ void
+ send_granted(fl, opcode)
+ 	struct file_lock *fl;
+-	int opcode __unused;
++	int opcode;
+ {
+ 	CLIENT *cli;
+ 	static char dummy;
+--- a/usr.sbin/rpc.lockd/kern.c
++++ b/usr.sbin/rpc.lockd/kern.c
+@@ -51,8 +51,9 @@
+ #include <syslog.h>
+ #include <unistd.h>
+ #include <netdb.h>
++#include <signal.h>
+ 
+-#include "nlm_prot.h"
++#include <nlm_prot.h>
+ #include <nfs/nfsproto.h>
+ #include <nfs/nfs_lock.h>
+ 
+--- a/usr.sbin/rpc.statd/Makefile
++++ b/usr.sbin/rpc.statd/Makefile
+@@ -2,22 +2,25 @@
+ 
+ PROG=	rpc.statd
+ MAN=	rpc.statd.8
+-SRCS=	file.c sm_inter_svc.c sm_inter.h statd.c procs.c
++SRCS=	file.c sm_inter_svc.c sm_inter_xdr.c sm_inter.h statd.c procs.c
+ 
+ CFLAGS+= -I.
+ #WARNS?= 2
+ 
+ DPADD=	${LIBRPCSVC}
+-LDADD=	-lrpcsvc
++LDADD=	-ltirpc -lbsd
+ 
+-CLEANFILES= sm_inter_svc.c sm_inter.h
++CLEANFILES= sm_inter_svc.c sm_inter_xdr.c sm_inter.h
+ 
+-RPCSRC= ${DESTDIR}/usr/include/rpcsvc/sm_inter.x
++RPCSRC= ${.CURDIR}/../../include/rpcsvc/sm_inter.x
+ RPCGEN= rpcgen -L -C
+ 
+ sm_inter_svc.c: ${RPCSRC}
+ 	${RPCGEN} -m -o ${.TARGET} ${RPCSRC}
+ 
++sm_inter_xdr.c: ${RPCSRC}
++	${RPCGEN} -c -o ${.TARGET} ${RPCSRC}
++
+ sm_inter.h: ${RPCSRC}
+ 	${RPCGEN} -h -o ${.TARGET} ${RPCSRC}
+ 
+--- a/usr.sbin/rpc.statd/procs.c
++++ b/usr.sbin/rpc.statd/procs.c
+@@ -257,7 +257,7 @@
+ 		earlier call to sm_mon_1
+ */
+ 
+-struct sm_stat *sm_unmon_1_svc(mon_id *arg, struct svc_req *req __unused)
++struct sm_stat *sm_unmon_1_svc(mon_id *arg, struct svc_req *req)
+ {
+   static sm_stat res;
+   HostInfo *hp;
+@@ -295,7 +295,7 @@
+ 		host and program number.
+ */
+ 
+-struct sm_stat *sm_unmon_all_1_svc(my_id *arg, struct svc_req *req __unused)
++struct sm_stat *sm_unmon_all_1_svc(my_id *arg, struct svc_req *req)
+ {
+   static sm_stat res;
+   HostInfo *hp;
+@@ -332,7 +332,7 @@
+ 		and inform all hosts on the monitor list.
+ */
+ 
+-void *sm_simu_crash_1_svc(void *v __unused, struct svc_req *req __unused)
++void *sm_simu_crash_1_svc(void *v, struct svc_req *req)
+ {
+   static char dummy;
+   int work_to_do;
+@@ -377,7 +377,7 @@
+ 		that modify the list.
+ */
+ 
+-void *sm_notify_1_svc(stat_chge *arg, struct svc_req *req __unused)
++void *sm_notify_1_svc(stat_chge *arg, struct svc_req *req)
+ {
+   struct timeval timeout = { 20, 0 };	/* 20 secs timeout		*/
+   CLIENT *cli;
+--- a/usr.sbin/rpc.statd/statd.c
++++ b/usr.sbin/rpc.statd/statd.c
+@@ -55,6 +55,11 @@
+ #include <unistd.h>
+ #include "statd.h"
+ 
++#ifndef IPPORT_MAX
++#define IPPORT_MAX 65535
++#endif
++extern void sm_prog_1(struct svc_req *rqstp, register SVCXPRT *transp);
++
+ int debug = 0;		/* Controls syslog() calls for debug messages	*/
+ 
+ char **hosts, *svcport_str = NULL;
+@@ -446,7 +451,7 @@
+ 		children to exit when they have done their work.
+ */
+ 
+-static void handle_sigchld(int sig __unused)
++static void handle_sigchld(int sig)
+ {
+   int pid, status;
+   pid = wait4(-1, &status, WNOHANG, (struct rusage*)0);
Index: debian/freebsd-nfs-utils.install
===================================================================
--- debian/freebsd-nfs-utils.install	(revision 0)
+++ debian/freebsd-nfs-utils.install	(revision 0)
@@ -0,0 +1,7 @@
+#usr.bin/showmount/showmount		/sbin
+sbin/mount_nfs/mount_nfs		/sbin
+sbin/nfsiod/nfsiod			/sbin
+usr.sbin/rpc.statd/rpc.statd		/sbin
+usr.sbin/rpc.lockd/rpc.lockd		/sbin
+usr.sbin/mountd/mountd			/usr/sbin
+usr.sbin/nfsd/nfsd			/usr/sbin
Index: debian/freebsd-nfs-utils.manpages
===================================================================
--- debian/freebsd-nfs-utils.manpages	(revision 0)
+++ debian/freebsd-nfs-utils.manpages	(revision 0)
@@ -0,0 +1,9 @@
+#usr.bin/showmount/showmount.8
+sbin/mount_nfs/mount_nfs.8
+sbin/nfsiod/nfsiod.8
+usr.sbin/rpc.statd/rpc.statd.8
+usr.sbin/rpc.lockd/rpc.lockd.8
+usr.sbin/mountd/mountd.8
+usr.sbin/mountd/exports.5
+usr.sbin/mountd/netgroup.5
+usr.sbin/nfsd/nfsd.8
Index: debian/rules
===================================================================
--- debian/rules	(revision 3422)
+++ debian/rules	(working copy)
@@ -5,8 +5,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-CFLAGS = -Wall -g -pipe -fPIC -I. -D_GNU_SOURCE -D'__FBSDID(string)='
-CXXFLAGS = -Wall -g -pipe -fPIC -I. -D_GNU_SOURCE -D'__FBSDID(string)='
+CFLAGS = -Wall -g -pipe -fPIC -I. -D_GNU_SOURCE -D'__FBSDID(string)=' -D'__RCSID(string)='
+CXXFLAGS = -Wall -g -pipe -fPIC -I. -D_GNU_SOURCE -D'__FBSDID(string)=' -D'__RCSID(string)='
 
 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
 	CFLAGS += -O0
@@ -25,16 +25,28 @@
 
 PATH := /usr/lib/freebsd:$(PATH)
 DESTDIR = $(CURDIR)/debian/tmp
-PMAKE = COPTS="$(CFLAGS)" CFLAGS="$(CFLAGS) \
-        -I$(CURDIR)/debian/local/include" \
+PMAKE = COPTS="$(CFLAGS)" CFLAGS="$(CFLAGS) -I$(CURDIR)/debian/local/include -I$(CURDIR)/include -I/usr/include/tirpc" \
         NO_WERROR=1 NOGCCERROR=1 NOSHARED=NO NO_SHARED=NO \
         DESTDIR=$(DESTDIR) make
 
+RPCGENFLAGS=-DWANT_NFS3
+RPCHDRS=include/rpcsvc/nfs_prot.h include/rpcsvc/nlm_prot.h \
+	include/rpcsvc/mount.h include/rpcsvc/sm_inter.h \
+	sys/kgssapi/gssd.h
+
+.SUFFIXES: .x .h
+
+.x.h:
+	rpcgen -h $(RPCGENFLAGS) $< -o $@
+
 build: build-arch build-indep
 
 get-orig-source:
 	rm -rf $(ORIGDIR)
-	mkdir -p $(ORIGDIR)/sys/kern $(ORIGDIR)/etc
+	mkdir -p $(ORIGDIR)/sys/kern $(ORIGDIR)/etc \
+		$(ORIGDIR)/include/rpcsvc \
+		$(ORIGDIR)/lib/libc/gen \
+		$(ORIGDIR)/sys/kgssapi
 	for i in sbin/dmesg sbin/sysctl usr.bin/kdump usr.bin/ktrace \
 		 usr.sbin/jail bin/chflags sbin/devd usr.sbin/acpi/acpiconf \
 		 sbin/kldconfig sbin/kldload sbin/kldstat sbin/kldunload \
@@ -43,14 +55,25 @@
 		 usr.sbin/ppp usr.sbin/pppctl usr.sbin/arp usr.bin/mkuzip \
 		 sbin/ipfw contrib/pf sbin/pfctl usr.sbin/authpf \
 		 sbin/mount_std sbin/umount sbin/mount_autofs sbin/mount_cd9660 \
-		 sbin/mount_ext2fs sbin/mount_hpfs sbin/mount_msdosfs sbin/mount_nfs \
+		 sbin/mount_ext2fs sbin/mount_hpfs sbin/mount_msdosfs \
 		 sbin/mount_ntfs sbin/mount_nullfs sbin/mount_udf sbin/mount_unionfs \
 		 sbin/mount_reiserfs sbin/mount \
 		 sbin/mdconfig sbin/ccdconfig sbin/swapon sbin/atacontrol sbin/camcontrol \
 		 sbin/gbde sbin/geom bin/kenv \
 		 usr.sbin/kbdcontrol usr.sbin/vidcontrol share/syscons \
 		 sbin/savecore sbin/dumpon \
-		 sys/kern/syscalls.c etc/pf.os ; do \
+		 sys/kern/syscalls.c etc/pf.os \
+		 usr.sbin/mountd usr.sbin/rpc.statd usr.sbin/rpc.lockd \
+		 usr.sbin/gssd usr.sbin/nfsd usr.sbin/nfscbd \
+		 usr.sbin/nfsdumpstate usr.sbin/nfsuserd usr.sbin/nfsrevoke \
+		 sbin/nfsiod \
+		 sbin/mount_nfs \
+		 include/rpcsvc/nfs_prot.x include/rpcsvc/sm_inter.x \
+		 include/rpcsvc/nlm_prot.x include/rpcsvc/mount.x \
+		 lib/libc/gen/getvfsbyname.c \
+		 sys/kgssapi/gssd.x \
+		 usr.bin/showmount \
+	; do \
 	    svn export $(SVN)/$$i $(ORIGDIR)/$$i ; \
 	done
 	tar --numeric-owner --owner 0 --group 0 -czf ../$(TARNAME) $(ORIGDIR)
@@ -61,10 +84,10 @@
 	$(MAKE) -C lib
 	touch $@
 
-build-arch: freebsd-utils gbde geli kbdcontrol vidcontrol kldutils freebsd-net-tools
+build-arch: freebsd-utils gbde geli kbdcontrol vidcontrol kldutils freebsd-net-tools freebsd-nfs-utils
 
 freebsd-utils: freebsd-utils-stamp
-freebsd-utils-stamp:
+freebsd-utils-stamp: $(RPCHDRS)
 #	$(PMAKE) -C bin/chflags
 	$(PMAKE) -C bin/kenv
 	$(PMAKE) -C sbin/atacontrol
@@ -141,6 +164,22 @@
 	$(PMAKE) -C usr.sbin/pppctl
 	touch $@
 
+freebsd-nfs-utils: freebsd-nfs-utils-stamp
+freebsd-nfs-utils-stamp: lib-stamp
+#	$(PMAKE) -C usr.bin/showmount
+	$(PMAKE) -C sbin/mount_nfs
+	$(PMAKE) -C sbin/nfsiod
+#	$(PMAKE) -C usr.sbin/gssd
+#	$(PMAKE) -C usr.sbin/nfscbd
+#	$(PMAKE) -C usr.sbin/nfsuserd
+#	$(PMAKE) -C usr.sbin/nfsrevoke
+#	$(PMAKE) -C usr.sbin/nfsdumpstate
+	$(PMAKE) -C usr.sbin/rpc.statd
+	$(PMAKE) -C usr.sbin/rpc.lockd
+	$(PMAKE) -C usr.sbin/mountd
+	$(PMAKE) -C usr.sbin/nfsd
+	touch $@
+
 build-indep: build-indep-stamp
 build-indep-stamp:
 	touch $@
@@ -204,6 +243,19 @@
 	$(PMAKE) -C usr.sbin/authpf clean
 	$(PMAKE) -C usr.sbin/pppctl clean
 
+	$(PMAKE) -C sbin/nfsiod clean
+	$(PMAKE) -C usr.sbin/gssd clean
+	$(PMAKE) -C usr.sbin/nfscbd clean
+	$(PMAKE) -C usr.sbin/nfsuserd clean
+	$(PMAKE) -C usr.sbin/nfsrevoke clean
+	$(PMAKE) -C usr.sbin/nfsdumpstate clean
+	$(PMAKE) -C usr.sbin/rpc.statd clean
+	$(PMAKE) -C usr.sbin/rpc.lockd clean
+	$(PMAKE) -C usr.sbin/mountd clean
+	$(PMAKE) -C usr.sbin/nfsd clean
+
+	$(RM) $(RPCHDRS)
+
 	rm -f *stamp
 	dh_clean
 
Index: debian/copyright
===================================================================
--- debian/copyright	(revision 3422)
+++ debian/copyright	(working copy)
@@ -2846,3 +2846,234 @@
     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 Sun Microsystems, Inc.
+
+    Copyr 1987 Sun Micro
+    
+    Sun RPC is a product of Sun Microsystems, Inc. and is provided for
+    unrestricted use provided that this legend is included on all tape
+    media and as a part of the software program in whole or part.  Users
+    may copy or modify Sun RPC without charge, but are not authorized
+    to license or distribute it to anyone else except as part of a product or
+    program developed by the user.
+    
+    SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
+    WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
+    PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
+    
+    Sun RPC is provided with no support and without any obligation on the
+    part of Sun Microsystems, Inc. to assist in its use, correction,
+    modification or enhancement.
+    
+    SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
+    INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
+    OR ANY PART THEREOF.
+    
+    In no event will Sun Microsystems, Inc. be liable for any lost revenue
+    or profits or other special, indirect and consequential damages, even if
+    Sun has been advised of the possibility of such damages.
+    
+    Sun Microsystems, Inc.
+    2550 Garcia Avenue
+    Mountain View, California  94043
+
+    --
+
+    @(#) Copyright (c) 1989, 1993
+    	The Regents of the University of California.  All rights reserved.
+
+    Copyright (c) 1989, 1993
+         The Regents of the University of California.  All rights reserved.
+
+    Copyright (c) 1989, 1991, 1993
+        The Regents of the University of California.  All rights reserved.
+
+    Copyright (c) 1992, 1993
+        The Regents of the University of California.  All rights reserved.
+
+    Copyright (c) 1994
+         The Regents of the University of California.  All rights reserved.
+
+    Copyright (c) 1994
+         The Regents of the University of California.  All rights reserved.
+
+    Copyright (c) 1995
+         The Regents of the University of California.  All rights reserved.
+
+    Copyright (c) 1989, 1991, 1993
+        The Regents of the University of California.  All rights reserved.
+
+    Copyright (c) 1992, 1993, 1994, 1995
+        The Regents of the University of California.  All rights reserved.
+
+    Copyright (c) 1989, 1993
+         The Regents of the University of California.  All rights reserved.
+    
+    This code is derived from software contributed to Berkeley by
+    Rick Macklem at The University of Guelph.
+
+    Copyright (c) 1992, 1993, 1994
+         The Regents of the University of California.  All rights reserved.
+    
+    This code is derived from software contributed to Berkeley by
+    Rick Macklem at The University of Guelph.
+
+    Copyright (c) 1989, 1993, 1995
+         The Regents of the University of California.  All rights reserved.
+    
+    This code is derived from software contributed to Berkeley by
+    Rick Macklem at The University of Guelph.
+
+    Copyright (c) 1989, 1993
+         The Regents of the University of California.  All rights reserved.
+    
+    This code is derived from software contributed to Berkeley by
+    Rick Macklem at The University of Guelph.
+
+    Copyright (c) 1989, 1993, 1994
+         The Regents of the University of California.  All rights reserved.
+    
+    This code is derived from software contributed to Berkeley by
+    Rick Macklem at The University of Guelph.
+
+    Copyright (c) 1989, 1993, 1995
+         The Regents of the University of California.  All rights reserved.
+    
+    This code is derived from software contributed to Berkeley by
+    Rick Macklem at The University of Guelph.
+
+    Copyright (c) 1989, 1991, 1993
+        The Regents of the University of California.  All rights reserved.
+    
+    This code is derived from software contributed to Berkeley by
+    Rick Macklem at The University of Guelph.
+
+    Copyright (c) 1989, 1993
+         The Regents of the University of California.  All rights reserved.
+    
+    This code is derived from software contributed to Berkeley by
+    Herb Hasler and Rick Macklem at The University of Guelph.
+
+    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.
+    4. 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 BY THE REGENTS 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 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) 2008 Isilon Inc http://www.isilon.com/
+    Authors: Doug Rabson <dfr@rabson.org>
+    Developed with Red Inc: Alfred Perlstein <alfred@freebsd.org>
+
+    Copyright (c) 1999 Martin Blapp
+    All rights reserved.
+
+    Copyright (c) 2009 Rick Macklem, University of Guelph
+    All rights reserved.
+
+    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.
+    
+    THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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) 2001 Andrew P. Lentvorski, Jr.
+    Copyright (c) 2000 Manuel Bouyer.
+
+    Copyright (c) 1995 A.R.Gordon, andrew.gordon@net-tel.co.uk
+    All rights reserved.
+
+    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 University of
+        California, Berkeley and its contributors.
+    4. 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 BY THE AUTHOR 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 AUTHOR 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) 1997 Berkeley Software Design, 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:
+    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. Berkeley Software Design Inc's name may not be used to endorse or
+       promote products derived from this software without specific prior
+       written permission.
+    
+    THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN INC ``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 BERKELEY SOFTWARE DESIGN INC 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.

Reply to: