From owner-freebsd-current Wed Oct 22 17:06:47 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA11508 for current-outgoing; Wed, 22 Oct 1997 17:06:47 -0700 (PDT) (envelope-from owner-freebsd-current) Received: from ocean.campus.luth.se (ocean.campus.luth.se [130.240.194.116]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id RAA11502 for ; Wed, 22 Oct 1997 17:06:44 -0700 (PDT) (envelope-from karpen@ocean.campus.luth.se) Received: (from karpen@localhost) by ocean.campus.luth.se (8.8.5/8.8.5) id CAA07555; Thu, 23 Oct 1997 02:14:12 +0200 (CEST) From: Mikael Karpberg Message-Id: <199710230014.CAA07555@ocean.campus.luth.se> Subject: Re: -STABLE reboots In-Reply-To: <199710220213.MAA22074@godzilla.zeta.org.au> from Bruce Evans at "Oct 22, 97 12:13:50 pm" To: bde@zeta.org.au (Bruce Evans) Date: Thu, 23 Oct 1997 02:14:12 +0200 (CEST) Cc: current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31H (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk According to Bruce Evans: > >> The problem is more serious in -current, since mount(2) is unprivileged, > >> so even `mount /foo /foo' panics (if the mounter is root or owns /foo). > > > >Er... Isn't that easilly solvable by mount checking for the two arguments > >being the same? > > Of course not, or it would have been fixed years ago. `mkdir foo; ln foo Thought that there might be such problems... > bar; mount foo bar' also panics. Checking inodes isn't enough either, Umm, but I thought hardlinking of directories were historic things used nowadays only to scare children with? > since `mkdir foo foo/foo; mount foo/foo foo' also panics. Ack, the last example never occured to me. Wouldn't it help to loop through arg1's part by part, from the root, and check the inodes against arg2's inode, then? cd /a/b/x/ mkdir y mount y x -> inode(a) == inode(x)? inode(b) == inode(x)? inode(x) == inode(x)? Yupp! Abort. Or is there a problem with this too? Except speed maybe? But that shouldn't matter THAT much in mount, should it? /Mikael