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)
This commit is contained in:
parent
43a55a72ef
commit
dc9c6194b5
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user