Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2002 11:30:03 -0700 (PDT)
From:      "Jin Guojun[DSD]" <j_guojun@lbl.gov>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/39896: netmask 0xffffff00 no longer works in /etc/exports
Message-ID:  <200206271830.g5RIU3Uv095813@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/39896; it has been noted by GNATS.

From: "Jin Guojun[DSD]" <j_guojun@lbl.gov>
To: cjclark@alum.mit.edu
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/39896: netmask 0xffffff00 no longer works in /etc/exports
Date: Thu, 27 Jun 2002 11:21:15 -0700

 "Crist J. Clark" wrote:
 > 
 > On Thu, Jun 27, 2002 at 09:38:14AM -0700, Jin Guojun[DSD] wrote:
 > > "Crist J. Clark" wrote:
 > 
 > [snip]
 > 
 > > > I can't reproduce this.
 > > >
 > > >   # uname -r
 > > >   4.6-RELEASE
 > > >   # grep ^/export /etc/exports
 > > >   /export         -alldirs -ro -network 192.168.64 -mask 255.255.255.0
 > > >   # kill -HUP `cat /var/run/mountd.pid`
 > > >   # showmount -e | grep ^/export
 > > >   /export                            192.168.64.0
 > > >
 > > > And on a different machine on that net, I can mount it fine.
 > >
 > > Are you sure that you understand or did things correctly? :-)
 > > (Assume that all lines you typed are not typo !!!)
 > >
 > > Your netmask is 255.255.255.0 not 0xffffff00. If not typo, plesse try
 > >  0xffffff00 , which is asked in "How-To-Repeat" section.
 > 
 > Sorry. Wrong cut-n-paste. I did use 0xffffff00 and it seemed to work
 > fine. When did you notice a change? src/sbin/mountd/mountd.c hasn't
 > changed since 4.4-RELEASE. I can't see anything that deals with
 > reading the netmask that has changed since 1998. The mask is actually
 > read with the inet_network(3) function, and I see no significant
 > changes in that for several years either.
 
 Yesterday, when upgrading OpenSSH, we upgraded FreeBSD to 4.6 and found
 this problem. I just repeat it now and pasted output below. The showmount
 does not show any problem, but mount does.
 
 The reason I would like to use 0xffffff00 is because we have an automated
 sys-admin process that grep the netmask from ifconfig, which uses
 0xffffffff notation instead of 255.255.255.255 notation, put it into 
 /etc/exports file, and test it locally first.
 During the upgrading, the server hung on mounting exported partition.
 So, I tried to mount this partition on a remote host, and got the same
 result -- Permission denied.
 
 After thought a little bit, I manually changed 0xffffff00 to 255.255.255.0
 and things started to work. So, I tried to upgrade all servers, which have
 different hardware, and they all had the same problem on netmask for
 exporting partitions.
 
 Since ifconfig uses hex notation (0xffffffff), and sed/awk/expr has no easy
 way to convert it to decimal notation (255.255.255.255), it is important
 to make this work; or ifconfig and exports should use the same notation,
 either all hex or all decimal.
 
 eubie# df /data
 Filesystem  1K-blocks  Used  Avail Capacity  Mounted on
 /dev/ad0s2g    546414 22126 480576     4%    /data
 eubie# uname -r
 4.6-RELEASE
 eubie# echo "/data -network 131.243.2 -mask 255.255.255.0" > /etc/exports
 eubie# kill -HUP `cat /var/run/mountd.pid`
 eubie# showmount -e
 Exports list on localhost:
 /data                              131.243.2.0 
 eubie# mount eubie:/data /mnt
 eubie# echo "/data -network 131.243.2 -mask 0xffffff00" > /etc/exports
 eubie# kill -HUP `cat /var/run/mountd.pid`
 eubie# showmount -e
 Exports list on localhost:
 /data                              131.243.2.0 
 eubie# mount eubie:/data /mnt
 eubie:/data: Permission denied
 ^C
 eubie# date
 Thu Jun 27 11:00:18 PDT 2002
 
 > --
 > Crist J. Clark                     |     cjclark@alum.mit.edu
 >                                    |     cjclark@jhu.edu
 > http://people.freebsd.org/~cjc/    |     cjc@freebsd.org
 
 -- 
 ------------ Jin Guojun ----------- v --- j_guojun@lbl.gov ---
 Distributed Systems Department		http://www.itg.lbl.gov/~jin
 M/S 50B-2239				Ph#:(510) 486-7531 Fax: 486-6363
 Lawrence Berkeley National Laboratory,	Berkeley, CA 94720

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




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