Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 May 1999 11:19:08 +0200
From:      Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To:        "Sergey Ayukov (mailing lists)" <asv1@crydee.sai.msu.ru>
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: NFS question..
Message-ID:  <19990512111908.A58262@internal>
In-Reply-To: <Pine.BSF.4.05.9905092147020.569-100000@crydee.sai.msu.ru>; from Sergey Ayukov (mailing lists) on Sun, May 09, 1999 at 10:30:30PM %2B0400
References:  <XFMail.990509142452.jobaldwi@vt.edu> <Pine.BSF.4.05.9905092147020.569-100000@crydee.sai.msu.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 09-May-1999 at 22:30:30 +0400, Sergey Ayukov (mailing lists) wrote:
> On Sun, 9 May 1999, John Baldwin wrote:
> 
> > >> Looks like you already have /var or a subdirectory under it in another
> > >> exports
> > >> line that contains a host from 195.208.220
> > > 
> > > No. Here's /etc/exports which causes the above error:
> > > 
> > >#
> > ># This file contains a list of all directories exported to other computers.
> > ># It is used by rpc.nfsd and rpc.mountd.
> > > 
> > > /vol1/ftp/pub/.1      -ro             -network 195.208.220 -mask 255.255.255.0
> > > /vol1/ftp/pub/.2      -ro             -network 195.208.220 -mask 255.255.255.0
> > > 
> > > /var/spool/pcnfs                      -alldirs        -network 195.208.220
> > -mask 255.255.255.0
> > > /var/spool/pcnfs                      -alldirs        -network 158.250.29 
> > -mask 255.255.255.0
> > > 
> > > /vol1/ftp/pub/.1      -ro             -network 158.250.29 -mask 255.255.255.0
> > > /vol1/ftp/pub/.2      -ro             -network 158.250.29 -mask 255.255.255.0
> > > 
> > > /vol1                                 lab
> > > /vol1/ftp/pub/.1                      lab
> > > /vol1/ftp/pub/.2                      lab
> > > /home                 -alldirs        lab
> > > /tmp1                                 lab
> > 
> > Does it still give an error if you take the "-alldirs" option out of the
> > /var/spool/pcnfs lines?
> 
> Surprisingly, no. This looks quite interesting. The reason I was putting
> -alldirs flag is in stupid pcnfs printing which mounts directories like
> /var/spool/pcnfs/machine-name. The solution I have settled on is rather
> ugly but seems to work:
> 
> /var/spool/pcnfs/fine \
>  /var/spool/pcnfs/fine2 \
>  /var/spool/pcnfs/lyambda \
>  /var/spool/pcnfs/solar \
>  /var/spool/pcnfs/universe \
>  /var/spool/pcnfs/silden \
>  /var/spool/pcnfs/rillanon
>  /var/spool/pcnfs/practic \
>  /var/spool/pcnfs/prof \
>  /var/spool/pcnfs/spiral \
>  lab friends
> 
> (lab and friends are netgroups; this BSD feature I quite like). At least
> one problem with NFS seems to go away... Thank you very much, John!


OK, a lot of people will tell me now that this is terribly bad/insecure/
hacked/false/... (pick what you want), but this is what I do:

/var/spool/pcnfs	-network 192.168.1.0


and the following patch to mountd.c (compile with -DANDRE, of course):

*** mountd.c.ORI	Wed May 12 09:08:11 1999
--- mountd.c	Wed May 12 11:13:31 1999
***************
*** 1230,1236 ****
--- 1230,1240 ----
  	int cmp;
  
  	if (dp) {
+ #ifdef ANDRE
+ 		cmp = strncmp(dp->dp_dirp, dirpath, strlen(dp->dp_dirp));
+ #else
  		cmp = strcmp(dp->dp_dirp, dirpath);
+ #endif
  		if (cmp > 0)
  			return (dirp_search(dp->dp_left, dirpath));
  		else if (cmp < 0)


This implies -alldirs for every line in /etc/exports and this even if it
isn't the root of a filesystem. It worked well for years now here...

	-Andre


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990512111908.A58262>