From ejh@gumbo.eas.slu.edu  Sun Oct 11 08:01:22 1998
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 <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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
Subject: nfsd should allow just nfs version two registration
X-Send-Pr-Version: 3.2

>Number:         8266
>Category:       bin
>Synopsis:       [patch] nfsd should allow just nfs version two registration
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    dillon
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 11 08:10:00 PDT 1998
>Closed-Date:    Mon Aug 14 07:47:59 PDT 2000
>Last-Modified:  Mon Aug 14 07:50:46 PDT 2000
>Originator:     Eric J. Haug
>Release:        FreeBSD 3.0-BETA i386
>Organization:
Saint Louis University
>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");
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: johan 
State-Changed-When: Mon Aug 14 06:52:18 PDT 2000 
State-Changed-Why:  
Eric, is this still a problem in more recent verion of FreeBSD? 



Responsible-Changed-From-To: freebsd-bugs->dillon 
Responsible-Changed-By: johan 
Responsible-Changed-When: Mon Aug 14 06:52:18 PDT 2000 
Responsible-Changed-Why:  
Matt is out NFS maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=8266 
State-Changed-From-To: feedback->closed 
State-Changed-By: johan 
State-Changed-When: Mon Aug 14 07:47:59 PDT 2000 
State-Changed-Why:  
I received this from Eric: 

From: "Eric J. Haug" <ejh@eas.slu.edu> 
To: johan@FreeBSD.org 
Subject: Re: bin/8266: [patch] nfsd should allow just nfs version two registration 

Hi Johan, 

I guess tossing that pr out would be appropriate. 
The problem that i was attempting to work around was fixed 
by later nfs kernel patch. 
While the pr patch looks like it does the right thing, Solaris 
still would find a way to bypass version 2 and use version 3. 
So the patch is incomplete. 

I have identified another problem that occurs with version 2.7 
of solaris, and not version 2.8. 
The Solaris systems are clients and the nfs server is any of 
FreeSBD 3.5, 4.0, 4.1, 5.0-CURRENT 
It is reproducable by starting on the solaris system 
a gzip or gunzip of any large file on the nfs server. 
I may send Matt a note soon, although i see from the EMail lists 
that the problem is occurning on another network 
I do not think a pr has been sent in. 

cheers 

eric haug 
Saint Louis Univ 




http://www.freebsd.org/cgi/query-pr.cgi?pr=8266 
>Unformatted:
