Bug 174868 - mount(2) doesn't do a good job at describing all possible errors in manpage
Summary: mount(2) doesn't do a good job at describing all possible errors in manpage
Status: Open
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-31 20:10 UTC by Enji Cooper
Modified: 2018-04-11 20:11 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2012-12-31 20:10:00 UTC
Several errors aren't properly documented when calling vfs_domount. In particular
these sections of code aren't documented properly:

1075                 if (fsflags & MNT_ROOTFS)
1076                         vfsp = vfs_byname(fstype);
1077                 else
1078                         vfsp = vfs_byname_kld(fstype, td, &error);
1079                 if (vfsp == NULL)
1080                         return (ENODEV);
1081                 if (jailed(td->td_ucred) && !(vfsp->vfc_flags & VFCF_JAIL))
1082                         return (EPERM);

- Line 975 seems like it should be ENOENT (according to kldload(2)), but that might cause confusion to any callers of mount(2).
- Line 976 is completely undocumented (if you don't have permissions to mount in a jail, fail with EPERM).

I'm also not entirely sure why this check exists in addition to the check on 1081 because it seems like unnecessary duplication, but I'd need to check priv_check a bit more to determine whether or not that's a disjoint set of requirements:

1045         if (jailed(td->td_ucred) || usermount == 0) {
1046                 if ((error = priv_check(td, PRIV_VFS_MOUNT)) != 0)
1047                         return (error);
1048         }
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:05 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped