strace/uid16.c

3 lines
44 B
C
Raw Normal View History

Fix decoding of 16-bit *chown and [gs]et*[gu]id syscalls Define two sets of parsers on architectures that support (either directly or via multiarch) 16-bit and 32-bit uid/gid syscalls simultaneously. Since the code in these two sets is essentially the same and the key difference between them is the size of uid_t, implement it by parametrizing uid_t and names of parser functions. * defs.h (NEED_UID16_PARSERS): New macro. * linux/syscall.h [NEED_UID16_PARSERS] (sys_chown16, sys_fchown16, sys_getresuid16, sys_getuid16, sys_setfsuid16, sys_setresuid16, sys_setreuid16, sys_setuid16): New prototypes. * linux/dummy.h (sys_geteuid16): Alias to sys_getuid16. (sys_getegid16, sys_getgid16, sys_getresgid16, sys_setfsgid16, sys_setgid16, sys_setregid16, sys_setresgid16): Alias to corresponding sys_*uid16 functions. * uid.c: Stop including <asm/posix_types.h>. Parametrize uid_t and names of all exported functions. (get_print_uid): New function. (sys_getresuid): Use it. (printuid): Check for (uid_t) -1. * uid16.c: New file. * Makefile.am (strace_SOURCES): Add it. * linux/arm/syscallent.h: Use sys_chown16, sys_fchown16, sys_getegid16, sys_geteuid16, sys_getgid16, sys_getresgid16, sys_getresuid16, sys_getuid16, sys_setfsgid16, sys_setfsuid16, sys_setgid16, sys_setregid16, sys_setresgid16, sys_setresuid16, sys_setreuid16, and sys_setuid16 parsers for *chown and [gs]et*[gu]id syscall entries. * linux/bfin/syscallent.h: Likewise. * linux/i386/syscallent.h: Likewise. * linux/m68k/syscallent.h: Likewise. * linux/microblaze/syscallent.h: Likewise. * linux/s390/syscallent.h: Likewise. * linux/sparc/syscallent.h: Likewise. * linux/sh/syscallent.h: Likewise. * linux/sh64/syscallent.h: Likewise. * tests/uid16.c: New file. * tests/uid16.test: New test. * tests/Makefile.am (CHECK_PROGRAMS): Add uid16. (TESTS): Add uid16.test. * tests/.gitignore: Add uid16.
2014-12-14 00:49:01 +03:00
#define STRACE_UID_SIZE 16
#include "uid.c"