Date: Mon, 31 Dec 2012 20:03:59 GMT From: Garrett Cooper <yanegomi@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: docs/174868: mount(2) doesn't do a good job at describing all possible errors in manpage Message-ID: <201212312003.qBVK3xMI042898@red.freebsd.org> Resent-Message-ID: <201212312010.qBVKA0G4008116@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 174868 >Category: docs >Synopsis: mount(2) doesn't do a good job at describing all possible errors in manpage >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Dec 31 20:10:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 9.1-STABLE >Organization: EMC Isilon >Environment: FreeBSD forza.west.isilon.com 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r+336aa21: Wed Dec 19 18:05:45 PST 2012 gcooper@forza.west.isilon.com:/usr/obj/usr/src/sys/FORZA amd64 >Description: 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 } >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212312003.qBVK3xMI042898>