From kenner@vlsi1.ultra.nyu.edu Mon Oct  7 16:22:09 1991
Received: from VLSI1.ULTRA.NYU.EDU by jan.ultra.nyu.edu (5.61/1.34)
	id AA00719; Mon, 7 Oct 91 16:22:07 -0400
Received: by vlsi1.ultra.nyu.edu (5.61/1.34)
	id AA08819; Mon, 7 Oct 91 16:21:09 -0400
Date: Mon, 7 Oct 91 16:21:09 -0400
From: kenner@vlsi1.ultra.nyu.edu (Richard Kenner)
Message-Id: <9110072021.AA08819@vlsi1.ultra.nyu.edu>
To: edler@jan.ultra.nyu.edu, gottlieb@allan.ultra.nyu.edu
Subject: NFS patch
Status: RO

----- Begin Included Message -----

>From jfc@ATHENA.MIT.EDU Mon Oct  7 16:12:49 1991
Received: from ACHATES.MIT.EDU by vlsi1.ultra.nyu.edu (5.61/1.34)
	id AA08806; Mon, 7 Oct 91 16:12:27 -0400
Received: by Achates.MIT.EDU (5.61) id AA12035; Mon, 7 Oct 91 16:13:11 -0400
Message-Id: <9110072013.AA12035@Achates.MIT.EDU>
To: kenner@vlsi1.ultra.nyu.edu (Richard Kenner)
Subject: Re: NFS problem DEC->RT 
In-Reply-To: Your message of Mon, 07 Oct 91 15:15:45 -0400.
             <9110071915.AA08764@vlsi1.ultra.nyu.edu> 
Date: Mon, 07 Oct 91 16:13:10 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>
Status: R


We had a similar problem with our newer clients and older servers.  We're
running old (early 1987) NFS code on our main fileservers.  Sun changed the
spec of the RPC credentials structure a few years back.  There used to be a
limit of 8 groups in an RPC request.  Now it is at least 10, maybe 32.  If
this is the problem, NFS should work if the user (and maybe also root) is in
less than 8 groups.

This is the change we made to our kernel to fix.  I don't know how similar
our NFS code is to yours.

*** /tmp/,RCSt1000407	Mon Oct  7 16:11:03 1991
--- svc_auth_unix.c	Wed Feb 27 21:39:15 1991
***************
*** 1,6 ****
  #ifndef lint
  static char rcs_id[] =
! 	{"$Header: /afs/rel-eng.athena.mit.edu/project/release/current/source/bsd-4.3/common/lib/libc/rpc/RCS/svc_auth_unix.c,v 1.8 89/11/07 18:41:01 probe Exp $"};
  #endif not lint
  /*
   * RCS Info
--- 1,6 ----
  #ifndef lint
  static char rcs_id[] =
! 	{"$Header: /afs/rel-eng.athena.mit.edu/project/release/current/source/bsd-4.3/common/lib/libc/rpc/RCS/svc_auth_unix.c,v 1.9 91/02/27 21:36:01 probe Exp $"};
  #endif not lint
  /*
   * RCS Info
***************
*** 38,43 ****
--- 38,44 ----
  #else
  #include <stdio.h>
  #include "types.h"	/* <> */
+ #include <sys/param.h>
  #include <sys/time.h>
  #include <netinet/in.h>
  #include "xdr.h"	/* <> */
***************
*** 74,80 ****
  	} *area;
  	u_int auth_len;
  	int str_len, gid_len;
! 	register int i;
  
  	area = (struct area *) rqst->rq_clntcred;
  	aup = &area->area_aup;
--- 75,81 ----
  	} *area;
  	u_int auth_len;
  	int str_len, gid_len;
! 	register int i, j;
  
  	area = (struct area *) rqst->rq_clntcred;
  	aup = &area->area_aup;
***************
*** 97,102 ****
--- 98,104 ----
  		aup->aup_uid = IXDR_GET_U_SHORT(buf);
  		aup->aup_gid = IXDR_GET_U_SHORT(buf);
  		gid_len = IXDR_GET_U_LONG(buf);
+ #if 0
  		if (gid_len > NGRPS) {
  			stat = AUTH_BADCRED;
  			goto done;
***************
*** 105,110 ****
--- 107,133 ----
  		for (i = 0; i < gid_len; i++) {
  			aup->aup_gids[i] = IXDR_GET_U_SHORT(buf);
  		}
+ #else
+ 		/*
+ 		 * Allow for implementations that send more than our
+ 		 * NGRPS number of groups in the credentials request.
+ 		 * 
+ 		 * However, we do impose a maximum to try to avoid
+ 		 * bogus requests from causing Segmentation Violations.
+ 		 * Here, we assume that NGROUPS is sufficiently large.
+ 		 */
+ 		if (gid_len > NGROUPS) {
+ 			stat = AUTH_BADCRED;
+ 			goto done;
+ 		}
+ 		aup->aup_len = (gid_len > NGRPS) ? NGRPS : gid_len;
+ 		for (i = 0; i < gid_len; i++) {
+ 		    if (i < NGRPS)
+ 			aup->aup_gids[i] = IXDR_GET_U_SHORT(buf);
+ 		    else
+ 			j = IXDR_GET_U_SHORT(buf);
+ 		}
+ #endif
  		/*
  		 * five is the smallest unix credentials structure -
  		 * timestamp, hostname len (0), uid, gid, and gids len (0).


----- End Included Message -----



