From owner-freebsd-bugs@FreeBSD.ORG Tue May 11 01:29:10 2004 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 01FEC16A4CE for ; Tue, 11 May 2004 01:29:10 -0700 (PDT) Received: from ipb.redline.ru (ipb.redline.ru [217.144.98.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0553043D62 for ; Tue, 11 May 2004 01:29:09 -0700 (PDT) (envelope-from zakharov@ipb.redline.ru) Received: from starfall.tv.interprom.msk.su ([192.232.12.98]) by ipb.redline.ru (8.12.9/8.12.9) with ESMTP id i4B8T4YF078649 for ; Tue, 11 May 2004 12:29:05 +0400 (MSD) (envelope-from zakharov@ipb.redline.ru) Date: Tue, 11 May 2004 12:29:04 +0400 From: "Mikhail E. Zakharov" X-Mailer: The Bat! (v2.00.6) CD5BF9353B3B7091 Organization: =?koi8-r?B?+uHvIOHr4iAi6c7UxdLQ0s/NwsHOyyI=?= X-Priority: 3 (Normal) Message-ID: <139315656.20040511122904@ipb.redline.ru> To: freebsd-bugs@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Subject: NFS bug? X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Mikhail E. Zakharov" List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 May 2004 08:29:10 -0000 Hi! When playing with NFS under FreeBSD, I've noticed something strange. You know it's impossible to export 2 directories of the same filesystem to one nfs-client: server# cat /etc/exports /usr/c client /usr/d client server# killall -HUP mountd server# showmount -e /usr/c Everyone There is no /usr/d exported. And we got errors in /var/log/messages: mountd[377]: can't change attributes for /usr/d mountd[377]: bad exports list line /usr/d But it's possible(!) to fool mountd when using the -network key. Let's try to export /usr/a as read-only system for the whole network, and /usr/b writable for one host, and not readable for others. NB! Our NFS-client (192.168.12.98) is from 192.168.0.0/16 network. See this example: server# cat /etc/exports /usr/a -ro -network 192.168.0.0 -mask 255.255.0.0 /usr/b -mapall=root 192.168.12.98 server# killall -HUP mountd server# showmount -e Exports list on localhost: /usr/b 192.168.12.98 /usr/a 192.168.0.0 As you see /usr/a and /usr/b successfully exported without errors. Now, from the client (192.168.12.98) we can mount both of them: client# mount server:/usr/b /mnt1 client# mount server:/usr/a /mnt client# mount server:/usr/b on /mnt1 (nfs) server:/usr/a on /mnt (nfs) When we successfully mounted them on client. Let's make additional tests: client# echo "something stupid" > /mnt/test.txt client# echo "something stupid1" > /mnt1/test1.txt client# cat /mnt/test.txt something stupid client# cat /mnt1/test1.txt something stupid1 Oh, my God! Both of the exported directories are writable. Best regards, Mikhail