Introduce a -N option that disables the use of reserved ports, now

that -P is on by default.  Remove do-nothing code in the -P case (but
leave the option itself for backward compatibility).

PR:	bin/4500
This commit is contained in:
Joerg Wunsch 1997-10-19 16:40:01 +00:00
parent 70ebe6afcb
commit cc75b131a6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30580
2 changed files with 14 additions and 5 deletions

View File

@ -31,7 +31,7 @@
.\"
.\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95
.\"
.\" $Id: mount_nfs.8,v 1.8 1997/03/11 12:31:54 peter Exp $
.\" $Id: mount_nfs.8,v 1.9 1997/04/18 16:23:09 dfr Exp $
.\""
.Dd March 29, 1995
.Dt MOUNT_NFS 8
@ -41,7 +41,7 @@
.Nd mount nfs file systems
.Sh SYNOPSIS
.Nm mount_nfs
.Op Fl 23KPTUbcdilqs
.Op Fl 23KNPTUbcdilqs
.Op Fl D Ar deadthresh
.Op Fl I Ar readdirsize
.Op Fl L Ar leaseterm
@ -104,8 +104,14 @@ for more information.)
Used with NQNFS to set the lease term to the specified number of seconds.
Only use this argument for mounts with a large round trip delay.
Values are normally in the 10-30 second range.
.It Fl N
Do
.Em not
use a reserved socket port number (see below).
.It Fl P
Use a reserved socket port number.
This flag is obsolete, and only retained for compatibility reasons.
Reserved port numbers are used by default now.
This is useful for mounting servers that require clients to use a
reserved port number on the mistaken belief that this makes NFS
more secure. (For the rare case where the client has a trusted root account

View File

@ -45,7 +45,7 @@ static char copyright[] =
static char sccsid[] = "@(#)mount_nfs.c 8.11 (Berkeley) 5/4/95";
*/
static const char rcsid[] =
"$Id: mount_nfs.c,v 1.22 1997/05/01 12:30:02 dfr Exp $";
"$Id: mount_nfs.c,v 1.23 1997/06/03 13:49:26 dfr Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -269,7 +269,7 @@ main(argc, argv)
nfsargs = nfsdefargs;
nfsargsp = &nfsargs;
while ((c = getopt(argc, argv,
"23a:bcdD:g:I:iKL:lm:o:PpqR:r:sTt:w:x:U")) != -1)
"23a:bcdD:g:I:iKL:lm:No:PpqR:r:sTt:w:x:U")) != -1)
switch (c) {
case '2':
mountmode = V2;
@ -341,6 +341,9 @@ main(argc, argv)
realm[REALM_SZ - 1] = '\0';
break;
#endif
case 'N':
nfsargsp->flags &= ~NFSMNT_RESVPORT;
break;
case 'o':
altflags = 0;
setflags(&altflags, &nfsargsp->flags, TRUE);
@ -375,7 +378,7 @@ main(argc, argv)
mountmode = V3;
break;
case 'P':
nfsargsp->flags |= NFSMNT_RESVPORT;
/* obsolete for NFSMNT_RESVPORT, now default */
break;
#ifdef ISO
case 'p':