diff options
author | dfr <dfr@FreeBSD.org> | 1997-04-22 10:37:27 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1997-04-22 10:37:27 +0000 |
commit | a6bde6da85086f08d0ee2f36010aa9c2a5d354e4 (patch) | |
tree | 48111a4218388d04d72145a467de7ff8d282fdfb /usr.sbin/mountd/mountd.c | |
parent | e52cdb3cdfcdcb00a2c146e954e7b11a7966340a (diff) | |
download | FreeBSD-src-a6bde6da85086f08d0ee2f36010aa9c2a5d354e4.zip FreeBSD-src-a6bde6da85086f08d0ee2f36010aa9c2a5d354e4.tar.gz |
Add a -2 flag to mountd to allow an admin to disable NFSv3 services.
This is handy for testing and possibly to work around busted v3 clients.
Diffstat (limited to 'usr.sbin/mountd/mountd.c')
-rw-r--r-- | usr.sbin/mountd/mountd.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 1ca38ec..3a45237 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.17 1997/04/01 14:15:30 bde Exp $"; + "$Id: mountd.c,v 1.18 1997/04/09 20:17:15 guido Exp $"; #endif /*not lint*/ #include <sys/param.h> @@ -220,6 +220,7 @@ struct ucred def_anon = { 1, { (gid_t) -2 } }; +int force_v2 = 0; int resvport_only = 1; int dir_only = 1; int opt_flags; @@ -270,8 +271,11 @@ main(argc, argv) errx(1, "NFS support is not available in the running kernel"); #endif /* __FreeBSD__ */ - while ((c = getopt(argc, argv, "dnr")) != -1) + while ((c = getopt(argc, argv, "2dnr")) != -1) switch (c) { + case '2': + force_v2 = 1; + break; case 'n': resvport_only = 0; break; @@ -336,10 +340,14 @@ main(argc, argv) } pmap_unset(RPCPROG_MNT, 1); pmap_unset(RPCPROG_MNT, 3); + if (!force_v2) + if (!svc_register(udptransp, RPCPROG_MNT, 3, mntsrv, IPPROTO_UDP) || + !svc_register(tcptransp, RPCPROG_MNT, 3, mntsrv, IPPROTO_TCP)) { + syslog(LOG_ERR, "Can't register mount"); + exit(1); + } if (!svc_register(udptransp, RPCPROG_MNT, 1, mntsrv, IPPROTO_UDP) || - !svc_register(udptransp, RPCPROG_MNT, 3, mntsrv, IPPROTO_UDP) || - !svc_register(tcptransp, RPCPROG_MNT, 1, mntsrv, IPPROTO_TCP) || - !svc_register(tcptransp, RPCPROG_MNT, 3, mntsrv, IPPROTO_TCP)) { + !svc_register(tcptransp, RPCPROG_MNT, 1, mntsrv, IPPROTO_TCP)) { syslog(LOG_ERR, "Can't register mount"); exit(1); } |