Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jul 2003 05:49:02 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Ian Dowse <iedowse@maths.tcd.ie>
Cc:        arch@freebsd.org
Subject:   Re: *statfs exposure of file system IDs to non-root users
Message-ID:  <3F1A8FBE.E0ACB134@mindspring.com>
References:  <200307200306.aa17802@salmon.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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