uid-range: error code tweak for uid_range_load_userns()
Let's return ENOSYS if /proc/ is not mounted (as that's what we usually return in that case in various helpers that operate on /proc/). Return EOPNOTSUPP if the kernel simply doesn't support userns.
This commit is contained in:
committed by
Yu Watanabe
parent
30633dbd32
commit
cdba12b34f
@@ -212,8 +212,8 @@ int uid_range_load_userns(UidRange **p, size_t *n, const char *path) {
|
||||
if (!f) {
|
||||
r = -errno;
|
||||
|
||||
if (r == -ENOENT && path_startswith(path, "/proc/") && proc_mounted() > 0)
|
||||
return -EOPNOTSUPP;
|
||||
if (r == -ENOENT && path_startswith(path, "/proc/"))
|
||||
return proc_mounted() > 0 ? -EOPNOTSUPP : -ENOSYS;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user