@@ -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);
@@ -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 = {
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
Signed-off-by: Martin Doucha <mdoucha@suse.cz> --- testcases/cve/icmp_rate_limit01.c | 2 +- testcases/kernel/containers/userns/userns08.c | 2 +- testcases/kernel/syscalls/bind/bind06.c | 2 +- testcases/kernel/syscalls/sendto/sendto03.c | 2 +- testcases/kernel/syscalls/setsockopt/setsockopt05.c | 2 +- testcases/kernel/syscalls/setsockopt/setsockopt06.c | 2 +- testcases/kernel/syscalls/setsockopt/setsockopt07.c | 2 +- testcases/kernel/syscalls/setsockopt/setsockopt08.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)