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