When attempting to mount a non-directory which exists, return ENOTDIR instead
of ENOENT. If stat() or statfs() failed, don't pass part of the invalid
(struct statfs) to ex_search(). In that same case, preserve the value of "bad"
rather than overwriting with EACCES.
Details
Details
- Reviewers
rmacklem - Commits
- rS329682: mountd: Return proper errno values in a few error paths
- mount a mountpoint that doesn't exist. For example
mount -t nfs host:/usr0/bogus /mnt/host/usr0
(where the directory "bogus" does not exist).
The resulting error message should be "No such file or directory" rather than "Permission denied".
- using a server that does not allow exports of regular files as mount points (i.e. mountd is run without the -r option), mount a mountpoint that is a regular file. For example
mount -t nfs host /usr/smith/.cshrc /mnt/smith
(where ".cshrc" is a regular file).
The resulting error message should be "Not a directory" rather than "Permission denied" or "No such file or directory".
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Looks ok to me at a glance. I don't know of any "standard" for what errors should be
returned. (Long ago it would have been "what Solaris does", but that's no longer the
case. If you wanted to, you could check to see if the error returns are "Linux compatible",
which is as close to a "standard" as there is these days.