From owner-freebsd-bugs Sun Oct 11 08:10:12 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA04206 for freebsd-bugs-outgoing; Sun, 11 Oct 1998 08:10:12 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA04136 for ; Sun, 11 Oct 1998 08:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id IAA00950; Sun, 11 Oct 1998 08:10:01 -0700 (PDT) Received: from mnw.eas.slu.edu (mnw.eas.slu.edu [165.134.8.248]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA02574 for ; Sun, 11 Oct 1998 08:01:20 -0700 (PDT) (envelope-from ejh@gumbo.eas.slu.edu) Received: from gumbo.eas.slu.edu (gumbo.eas.slu.edu [165.134.8.219]) by mnw.eas.slu.edu (8.8.8/8.8.8) with ESMTP id KAA15384 for ; Sun, 11 Oct 1998 10:01:06 -0500 (CDT) Received: (from ejh@localhost) by gumbo.eas.slu.edu (8.9.1/8.8.8) id KAA00540; Sun, 11 Oct 1998 10:00:56 -0500 (CDT) (envelope-from ejh) Message-Id: <199810111500.KAA00540@gumbo.eas.slu.edu> Date: Sun, 11 Oct 1998 10:00:56 -0500 (CDT) From: ejh@eas.slu.edu Reply-To: ejh@eas.slu.edu To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/8266: nfsd should allow just nfs version two registration Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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