Merge pull request #17977 from yuwata/namespace-mount-procfs-follow-up

core/namespace: do not ignore non-EPERM mount error
This commit is contained in:
Yu Watanabe 2020-12-15 12:07:30 +09:00 committed by GitHub
commit fc874bf3bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -914,7 +914,8 @@ static int mount_procfs(const MountEntry *m, const NamespaceInfo *ns_info) {
if (r == 0)
/* /proc is not mounted. Propagate the original error code. */
return -EPERM;
}
} else if (r < 0)
return r;
return 1;
}
@ -1691,12 +1692,10 @@ int setup_namespace(
*(m++) = (MountEntry) {
.path_const = "/proc/sys/kernel/hostname",
.mode = READONLY,
.ignore = true,
};
*(m++) = (MountEntry) {
.path_const = "/proc/sys/kernel/domainname",
.mode = READONLY,
.ignore = true,
};
}