Date: Sun, 11 Oct 1998 10:00:56 -0500 (CDT) From: ejh@eas.slu.edu To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/8266: nfsd should allow just nfs version two registration Message-ID: <199810111500.KAA00540@gumbo.eas.slu.edu>
next in thread | raw e-mail | index | archive | help
>Number: 8266 >Category: bin >Synopsis: nfsd should allow just nfs version two registration >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Oct 11 08:10:00 PDT 1998 >Last-Modified: >Originator: Eric J. Haug >Organization: Saint Louis University >Release: FreeBSD 3.0-BETA i386 >Environment: FreeBSD NFS server in a Solaris 2.5, 2.51, and 2.6 environment. >Description: The Solaris 2.6 system trying to automount using the /net mechanism will refuse negotiate down to nfs version 2 if it finds version 3 registered with the portmaper. Mountd is running and only allowing version 2 mounts. I believe BETA 3.0 is known to have NFS version 3 problems. >How-To-Repeat: Have a default 3.0 BETA system with exported filesystems login to a Solaris 2.6 system and try to list one of the exported directories. Note the failure. Also note that 3.0 BETA will reliably crash while an NFS version 3 client is doing a tar extract. >Fix: Allow nfsd to have a -2 option as well. The following diff could be applied to /usr/src/sbin/nfsd.c And -2 added to the nfsd options in the rc.conf script. 48c48 < "$Id: nfsd.c,v 1.14 1998/10/10 13:35:00 ejh Exp $"; --- > "$Id: nfsd.c,v 1.13 1998/07/15 06:33:15 charnier Exp $"; 148d147 < int twoonly; 189d187 < twoonly = 0; 194c192 < #define GETOPT "2n:rtu" --- > #define GETOPT "n:rtu" 199,201d196 < case '2': < twoonly = 1; < break; 267,278c262,269 < if (udpflag ) { < if (!pmap_set(RPCPROG_NFS, 2, IPPROTO_UDP, NFS_PORT)) < err(1, "can't register version 2 with portmap for UDP"); < if (!twoonly && !pmap_set(RPCPROG_NFS, 3, IPPROTO_UDP, NFS_PORT)) < err(1, "can't register version 3 with portmap for UDP"); < } < if (tcpflag ) { < if (!pmap_set(RPCPROG_NFS, 2, IPPROTO_TCP, NFS_PORT)) < err(1, "can't register version 2 with portmap for TCP"); < if (!twoonly && !pmap_set(RPCPROG_NFS, 3, IPPROTO_TCP, NFS_PORT)) < err(1, "can't register version 3 with portmap for TCP"); < } --- > if (udpflag && > (!pmap_set(RPCPROG_NFS, 2, IPPROTO_UDP, NFS_PORT) || > !pmap_set(RPCPROG_NFS, 3, IPPROTO_UDP, NFS_PORT))) > err(1, "can't register with portmap for UDP"); > if (tcpflag && > (!pmap_set(RPCPROG_NFS, 2, IPPROTO_TCP, NFS_PORT) || > !pmap_set(RPCPROG_NFS, 3, IPPROTO_TCP, NFS_PORT))) > err(1, "can't register with portmap for TCP"); 400,405c391,393 < if (!pmap_set(RPCPROG_NFS, 2, IPPROTO_UDP, NFS_PORT)) { < syslog(LOG_ERR, "can't register version 2 with udp portmap"); < exit(1); < } < if ( !twoonly && !pmap_set(RPCPROG_NFS, 3, IPPROTO_UDP, NFS_PORT)) { < syslog(LOG_ERR, "can't register version 3 with udp portmap"); --- > if (!pmap_set(RPCPROG_NFS, 2, IPPROTO_UDP, NFS_PORT) || > !pmap_set(RPCPROG_NFS, 3, IPPROTO_UDP, NFS_PORT)) { > syslog(LOG_ERR, "can't register with udp portmap"); 484,489c472,474 < if (!pmap_set(RPCPROG_NFS, 2, IPPROTO_TCP, NFS_PORT)) { < syslog(LOG_ERR, "can't register version 2 tcp with portmap"); < exit(1); < } < if (!twoonly && !pmap_set(RPCPROG_NFS, 3, IPPROTO_TCP, NFS_PORT)) { < syslog(LOG_ERR, "can't register version 3 tcp with portmap"); --- > if (!pmap_set(RPCPROG_NFS, 2, IPPROTO_TCP, NFS_PORT) || > !pmap_set(RPCPROG_NFS, 3, IPPROTO_TCP, NFS_PORT)) { > syslog(LOG_ERR, "can't register tcp with portmap"); >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810111500.KAA00540>