diff --git a/tests/.gitignore b/tests/.gitignore index b0698fa6..c2ac5c85 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -147,6 +147,7 @@ setgid32 sethostname setregid setregid32 +setresgid setresuid setresuid32 setreuid diff --git a/tests/Makefile.am b/tests/Makefile.am index 3c3ea5b1..250081d7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -197,6 +197,7 @@ check_PROGRAMS = \ sethostname \ setregid \ setregid32 \ + setresgid \ setresuid \ setresuid32 \ setreuid \ @@ -414,6 +415,7 @@ DECODER_TESTS = \ sethostname.test \ setregid.test \ setregid32.test \ + setresgid.test \ setresuid.test \ setresuid32.test \ setreuid.test \ diff --git a/tests/setresgid.c b/tests/setresgid.c new file mode 100644 index 00000000..6754c2fe --- /dev/null +++ b/tests/setresgid.c @@ -0,0 +1,25 @@ +#include "tests.h" +#include + +#ifdef __NR_setresgid + +# define SYSCALL_NR __NR_setresgid +# define SYSCALL_NAME "setresgid" + +# if defined __NR_setresgid32 && __NR_setresgid != __NR_setresgid32 +# define UGID_TYPE short +# define GETUGID syscall(__NR_getegid) +# define CHECK_OVERFLOWUGID(arg) check_overflowgid(arg) +# else +# define UGID_TYPE int +# define GETUGID getegid() +# define CHECK_OVERFLOWUGID(arg) +# endif + +# include "setresugid.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_setresgid") + +#endif diff --git a/tests/setresgid.test b/tests/setresgid.test new file mode 100755 index 00000000..5a695742 --- /dev/null +++ b/tests/setresgid.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check setresgid syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19