tests: extend test coverage of setresgid syscall
* tests/setresgid.c: New file. * tests/setresgid.test: New test. * tests/.gitignore: Add setresgid. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add setresgid.test.
This commit is contained in:
parent
2b42d8e32f
commit
4f6d95dd58
1
tests/.gitignore
vendored
1
tests/.gitignore
vendored
@ -147,6 +147,7 @@ setgid32
|
||||
sethostname
|
||||
setregid
|
||||
setregid32
|
||||
setresgid
|
||||
setresuid
|
||||
setresuid32
|
||||
setreuid
|
||||
|
@ -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 \
|
||||
|
25
tests/setresgid.c
Normal file
25
tests/setresgid.c
Normal file
@ -0,0 +1,25 @@
|
||||
#include "tests.h"
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#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
|
6
tests/setresgid.test
Executable file
6
tests/setresgid.test
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Check setresgid syscall decoding.
|
||||
|
||||
. "${srcdir=.}/init.sh"
|
||||
run_strace_match_diff -a19
|
Loading…
Reference in New Issue
Block a user