Only care about mount namespace isolating

This commit is contained in:
残页 2021-12-05 09:52:25 +08:00 committed by John Wu
parent 7f4f95cf83
commit b5d80a88d1

View File

@ -153,7 +153,7 @@ DCL_HOOK_FUNC(int, fork) {
// Unmount stuffs in the process's private mount namespace // Unmount stuffs in the process's private mount namespace
DCL_HOOK_FUNC(int, unshare, int flags) { DCL_HOOK_FUNC(int, unshare, int flags) {
int res = old_unshare(flags); int res = old_unshare(flags);
if (g_ctx && res == 0) { if (g_ctx && (flags & CLONE_NEWNS) != 0 && res == 0) {
if (g_ctx->flags[UNMOUNT_FLAG]) { if (g_ctx->flags[UNMOUNT_FLAG]) {
revert_unmount(); revert_unmount();
} else { } else {