From owner-freebsd-arch@FreeBSD.ORG Sun Jul 20 05:54:04 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C758F37B401 for ; Sun, 20 Jul 2003 05:54:04 -0700 (PDT) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id 438D743F75 for ; Sun, 20 Jul 2003 05:54:04 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc16o.dialup.mindspring.com ([209.86.4.216] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19eDdo-000029-00; Sun, 20 Jul 2003 05:50:17 -0700 Message-ID: <3F1A8FBE.E0ACB134@mindspring.com> Date: Sun, 20 Jul 2003 05:49:02 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Ian Dowse References: <200307200306.aa17802@salmon.maths.tcd.ie> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a44af72e78ed244cb1780ad3a0328a17b9350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c cc: arch@freebsd.org Subject: Re: *statfs exposure of file system IDs to non-root users X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2003 12:54:05 -0000 Ian Dowse wrote: > In changing umount(8) to use statfs(2), I just noticed that the > various *statfs calls hide the filesystem IDs from non-root users: > > if (suser(td)) { > bcopy(sp, &sb, sizeof(sb)); > sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0; > sp = &sb; > } > > This was added in vfs_syscalls.c revision 1.61 (March 1997) and > came from OpenBSD. I guess the reason was to hide information that > gets used in NFS filehandles, but it doesn't do us any good now as > you can get the real IDs from getfsstat() as a normal user. Being > able to get and compare file system IDs is useful for umount, and > umount can be used by non-root users when vfs.usermount is set. > > Is there a good reason not to delete this fsid hiding? The real question is "Why do you need this information?". If you can answer that, we can probably tell you a different approach to solving your problem. -- Terry