Skip to content

Commit

Permalink
Fix failures due to missing max_user_namespaces procfile
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
  • Loading branch information
mdoucha authored and metan-ucw committed Sep 23, 2021
1 parent 0710448 commit 51b6cee
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion testcases/cve/icmp_rate_limit01.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static void setup(void)
for (i = 0; i < SRCADDR_COUNT; i++)
fds[i] = -1;

SAFE_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);
SAFE_TRY_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);

SAFE_UNSHARE(CLONE_NEWUSER);
SAFE_UNSHARE(CLONE_NEWNET);
Expand Down
2 changes: 1 addition & 1 deletion testcases/kernel/containers/userns/userns08.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static void setup(void)
SAFE_WRITE(fd, 1, "\n", 1);
SAFE_CLOSE(fd);

SAFE_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);
SAFE_TRY_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);
}

static struct tst_test test = {
Expand Down
2 changes: 1 addition & 1 deletion testcases/kernel/syscalls/bind/bind06.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static void setup(void)
int real_gid = getgid();
struct ifreq ifr;

SAFE_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);
SAFE_TRY_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);

SAFE_UNSHARE(CLONE_NEWUSER);
SAFE_UNSHARE(CLONE_NEWNET);
Expand Down
2 changes: 1 addition & 1 deletion testcases/kernel/syscalls/sendto/sendto03.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static void setup(void)
int real_gid = getgid();
struct ifreq ifr;

SAFE_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);
SAFE_TRY_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);

SAFE_UNSHARE(CLONE_NEWUSER);
SAFE_UNSHARE(CLONE_NEWNET);
Expand Down
2 changes: 1 addition & 1 deletion testcases/kernel/syscalls/setsockopt/setsockopt05.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static void setup(void)
struct ifreq ifr;
socklen_t addrlen = sizeof(addr);

SAFE_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);
SAFE_TRY_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);

SAFE_UNSHARE(CLONE_NEWUSER);
SAFE_UNSHARE(CLONE_NEWNET);
Expand Down
2 changes: 1 addition & 1 deletion testcases/kernel/syscalls/setsockopt/setsockopt06.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static void setup(void)
int real_uid = getuid();
int real_gid = getgid();

SAFE_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);
SAFE_TRY_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);

SAFE_UNSHARE(CLONE_NEWUSER);
SAFE_UNSHARE(CLONE_NEWNET);
Expand Down
2 changes: 1 addition & 1 deletion testcases/kernel/syscalls/setsockopt/setsockopt07.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static void setup(void)
int real_uid = getuid();
int real_gid = getgid();

SAFE_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);
SAFE_TRY_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);

SAFE_UNSHARE(CLONE_NEWUSER);
SAFE_UNSHARE(CLONE_NEWNET);
Expand Down
2 changes: 1 addition & 1 deletion testcases/kernel/syscalls/setsockopt/setsockopt08.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void setup(void)
"The vulnerability was only present in 32-bit compat mode");
}

SAFE_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);
SAFE_TRY_FILE_PRINTF("/proc/sys/user/max_user_namespaces", "%d", 10);

SAFE_UNSHARE(CLONE_NEWUSER);
SAFE_UNSHARE(CLONE_NEWNET);
Expand Down

0 comments on commit 51b6cee

Please sign in to comment.