Bug 26148

Summary: mountd: can't change attributes for /usr
Product: Base System Reporter: quinot <quinot>
Component: binAssignee: iedowse
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   

Description quinot 2001-03-27 15:50:00 UTC
Mar 27 16:42:01 shalmaneser mountd[347]: can't change attributes for /usr
Mar 27 16:42:01 shalmaneser mountd[347]: bad exports list line /usr -alldirs IR

/etc/exports contains:
/usr -alldirs IR

/usr is a mount point:
# mount
/dev/ad0s1f on /usr (ufs, NFS exported, local, soft-updates)

IR is a netgroup name.

This used to work with older 5.0-CURRENT binaries. No change is known
to have happened apart from upgrading world.

Fix: 

Unknown.
Comment 1 quinot 2001-04-11 14:45:34 UTC
Further investigation reveals that this problem is probably caused by
duplicate hosts in our netgroups.

Actually, we have a netgroup that contains hosts with both unqualified
and qualified domain names, as in:

MyNetgroup	(myhost,-,-) (myhost.dom.ain,-,-)

Names are then looked up and qualified by mountd, and do_mount()
is called twice for each host. The second call fails, and leaves an
empty export list.

It is unclear to me how and where this should be dealt with. Maybe
mount(2)
could return with EEXIST instead of EPERM when an attempt is made to
enter a duplicate host in the export list, and mountd could act
correctly upon
such an error?

Thomas.

-- 
Thomas Quinot ** Département Informatique & Réseaux **
quinot@inf.enst.fr
              ENST   //   46 rue Barrault   //   75634 PARIS CEDEX 13
Comment 2 mb 2001-04-13 15:06:29 UTC
Hi,

Please test the fix for this problem:

http://home.teleport.ch/freebsd/mountd.c.diff2

Martin

Martin Blapp, mb@imp.ch
------------------------------------------------
Improware AG, UNIX solution and service provider
Zurlindenstrasse 29, 4133 Pratteln, Switzerland
Phone: +41 79 370 26 05, Fax: +41 61 826 93 01
------------------------------------------------
Comment 3 quinot 2001-04-13 17:36:28 UTC
Le 2001-04-13, Martin Blapp écrivait :

> Please test the fix for this problem:
> http://home.teleport.ch/freebsd/mountd.c.diff2

The proposed fix does not entirely resolve the problem, because
only the first address in a host's gt_addrinfo list is checked.
On the other hand, the check on canonname is probably superfluous,
since the kernel only considers the address.

I have also replaced a direct struct sockaddr equality with a call
to sacmp(), which seemed safer.

I have modified your patch accordingly. The version available
at http://www.infres.enst.fr/~quinot/mountd.c.diff3 seems to
work here.

Thomas.

-- 
Thomas Quinot ** Département Informatique & Réseaux ** quinot@inf.enst.fr
              ENST   //   46 rue Barrault   //   75634 PARIS CEDEX 13
Comment 4 mb 2001-04-13 17:43:08 UTC
Looks good to me !

Thanks

Martin Blapp, mb@imp.ch
------------------------------------------------
Improware AG, UNIX solution and service provider
Zurlindenstrasse 29, 4133 Pratteln, Switzerland
Phone: +41 79 370 26 05, Fax: +41 61 826 93 01
------------------------------------------------
Comment 5 mb 2001-04-13 17:47:25 UTC
Hi,

> I have also replaced a direct struct sockaddr equality with a call
> to sacmp(), which seemed safer.

This seems to be the right solution.

> 
> I have modified your patch accordingly. The version available
> at http://www.infres.enst.fr/~quinot/mountd.c.diff3 seems to
> work here.

I tested the patch here. It solves the problem of doublicated adresses
and names entierly. Thanks a lot.

Martin
Comment 6 mb 2001-04-13 18:33:22 UTC
I've merged now the both mountd fixes to one.

http://home.teleport.ch/freebsd/mountd.c.diff

Martin

Martin Blapp, mb@imp.ch
------------------------------------------------
Improware AG, UNIX solution and service provider
Zurlindenstrasse 29, 4133 Pratteln, Switzerland
Phone: +41 79 370 26 05, Fax: +41 61 826 93 01
------------------------------------------------
Comment 7 iedowse freebsd_committer freebsd_triage 2001-04-18 01:54:37 UTC
State Changed
From-To: open->feedback

A change based on your patch was included in revision 1.45 of 
mountd.c. Has this fixed the problem? 


Comment 8 iedowse freebsd_committer freebsd_triage 2001-04-18 01:54:37 UTC
Responsible Changed
From-To: freebsd-bugs->iedowse

I'll take this one.
Comment 9 quinot 2001-04-18 14:18:52 UTC
Le 2001-04-18, iedowse@FreeBSD.org écrivait :

> A change based on your patch was included in revision 1.45 of
> mountd.c. Has this fixed the problem?

1.46 works great here, thanks a lot!

Thomas.

-- 
Thomas Quinot ** Département Informatique & Réseaux ** quinot@inf.enst.fr
              ENST   //   46 rue Barrault   //   75634 PARIS CEDEX 13
Comment 10 iedowse freebsd_committer freebsd_triage 2001-04-18 14:32:11 UTC
State Changed
From-To: feedback->closed


Submitter says that revision 1.46 of mountd.c has resolved 
the issue. Thanks for reporting this!