From c0dad1ff8de1b9d4994133bc779a792853883a4d Mon Sep 17 00:00:00 2001 From: guido Date: Wed, 9 Apr 1997 20:17:15 +0000 Subject: Make a sysconfig variable controlling if teh kernel should accept nfs requests from non-privileged ports. Change mountd such that it does never set this variable, but only clears it when run with -n. Also document this in the man page. --- usr.sbin/mountd/mountd.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'usr.sbin/mountd') diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 472440e..1ca38ec 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -43,7 +43,7 @@ static char copyright[] = #ifndef lint /*static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; */ static const char rcsid[] = - "$Id: mountd.c,v 1.16 1997/03/29 03:32:49 imp Exp $"; + "$Id: mountd.c,v 1.17 1997/04/01 14:15:30 bde Exp $"; #endif /*not lint*/ #include @@ -318,13 +318,15 @@ main(argc, argv) } } - mib[0] = CTL_VFS; - mib[1] = MOUNT_NFS; - mib[2] = NFS_NFSPRIVPORT; - if (sysctl(mib, 3, NULL, NULL, &resvport_only, - sizeof(resvport_only)) != 0 && errno != ENOENT) { - syslog(LOG_ERR, "sysctl: %m"); - exit(1); + if (!resvport_only) { + mib[0] = CTL_VFS; + mib[1] = MOUNT_NFS; + mib[2] = NFS_NFSPRIVPORT; + if (sysctl(mib, 3, NULL, NULL, &resvport_only, + sizeof(resvport_only)) != 0 && errno != ENOENT) { + syslog(LOG_ERR, "sysctl: %m"); + exit(1); + } } if ((udptransp = svcudp_create(RPC_ANYSOCK)) == NULL || -- cgit v1.1