summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYang Xu <xuyang2018.jy@fujitsu.com>2022-05-08 00:01:25 +0800
committerZorro Lang <zlang@kernel.org>2022-05-07 23:08:34 +0800
commit6ac390bb605b70ef9d12eff9742379e13cfe0cd6 (patch)
tree52330d18047b7782d9ca43746a237ce287446d82 /src
parent9ae10c882550c48868e7c0baff889bb1a7c7c8e9 (diff)
idmapped-mounts: Reset errno to zero before run_test
If we run case on old kernel that doesn't support mount_setattr and then fail on our own function before call is_setgid/is_setuid function to reset errno, run_test will print "Function not implement" error. We also check whether system support user namespace, so reset errno to zero after userns check. Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'src')
-rw-r--r--src/idmapped-mounts/idmapped-mounts.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/idmapped-mounts/idmapped-mounts.c b/src/idmapped-mounts/idmapped-mounts.c
index ce3f73be..2e94bf71 100644
--- a/src/idmapped-mounts/idmapped-mounts.c
+++ b/src/idmapped-mounts/idmapped-mounts.c
@@ -14232,6 +14232,8 @@ int main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
t_has_userns = sys_has_userns();
+ /* don't copy ENOSYS errno to child process on older kernel */
+ errno = 0;
stash_overflowuid();
stash_overflowgid();