From: Benny Halevy Date: Mon, 18 May 2009 14:47:51 +0000 (-0400) Subject: Extend -N command line option syntax to accept X-Git-Tag: nfs-utils-1-1-7-rc1~7 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=commitdiff_plain;h=7bd86b3cfb0d929ce1dae2b937c3ac9048e23644 Extend -N command line option syntax to accept . to disable support for . Only 4.1 is currently supported. Signed-off-by: Benny Halevy Signed-off-by: Steve Dickson --- diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c index ac264da..bd23d9d 100644 --- a/utils/nfsd/nfsd.c +++ b/utils/nfsd/nfsd.c @@ -50,6 +50,7 @@ main(int argc, char **argv) int count = 1, c, error, port, fd, found_one; struct servent *ent; struct hostent *hp; + char *p; ent = getservbyname ("nfs", "udp"); if (ent != NULL) @@ -80,10 +81,14 @@ main(int argc, char **argv) } break; case 'N': - switch((c = atoi(optarg))) { - case 2: - case 3: + switch((c = strtol(optarg, &p, 0))) { case 4: + if (*p == '.') { + minorvers4 = -atoi(p + 1); + break; + } + case 3: + case 2: NFSCTL_VERUNSET(versbits, c); break; default: