diff options
author | pjd <pjd@FreeBSD.org> | 2004-02-02 18:37:30 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-02-02 18:37:30 +0000 |
commit | 9354393ea0bc54c02e6b91362112ae33101217eb (patch) | |
tree | e652f47028e51739b788087703efcb8dc45cd4d1 /sbin/mount | |
parent | aab2ee19bb8b542a528c396f18ccc604fb3f83a2 (diff) | |
download | FreeBSD-src-9354393ea0bc54c02e6b91362112ae33101217eb.zip FreeBSD-src-9354393ea0bc54c02e6b91362112ae33101217eb.tar.gz |
Made use of MNT_USER flag and inform about user responsible for mount
in those cases:
1. File system was mounted by an unprivileged user.
2. File system was mounted by an unprivileged root user.
3. File system was mounted by a privileged non-root user.
Point 1 is when file system was mounted by unprivileged user
(sysctl vfs.usermount was equal to 1 then).
Point 2 is when file system was mounted by root, while sysctl
security.bsd.suser_enabled is set to 0 and sysctl vfs.usermount
is set to 1.
Point 3 is because we want to be ready for capabilities.
Reviewed by: rwatson
Approved by: scottl (mentor)
Diffstat (limited to 'sbin/mount')
-rw-r--r-- | sbin/mount/mount.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index e968786..f944671 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -524,7 +524,11 @@ prmount(sfp) (void)printf(", %s", o->o_name); flags &= ~o->o_opt; } - if (sfp->f_owner) { + /* + * Inform when file system is mounted by an unprivileged user + * or privileged non-root user. + */ + if ((flags & MNT_USER) != 0 || sfp->owner != 0) { (void)printf(", mounted by "); if ((pw = getpwuid(sfp->f_owner)) != NULL) (void)printf("%s", pw->pw_name); |