From 408420f51f6781081429fdfa7948f05679db1c90 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 16 Apr 2016 23:02:27 +0000 Subject: [PATCH] tests: check decoding of lchown syscall * tests/lchown.c: New file. * tests/lchown.test: New test. * tests/.gitignore: Add lchown. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add lchown.test. --- tests/.gitignore | 1 + tests/Makefile.am | 2 ++ tests/lchown.c | 19 +++++++++++++++++++ tests/lchown.test | 6 ++++++ 4 files changed, 28 insertions(+) create mode 100644 tests/lchown.c create mode 100755 tests/lchown.test diff --git a/tests/.gitignore b/tests/.gitignore index 49f20c67..1e138b00 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -69,6 +69,7 @@ ipc_sem ipc_shm ksysent ksysent.h +lchown libtests.a linkat llseek diff --git a/tests/Makefile.am b/tests/Makefile.am index 0888a5a8..83e0f7ba 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -120,6 +120,7 @@ check_PROGRAMS = \ ipc_sem \ ipc_shm \ ksysent \ + lchown \ linkat \ llseek \ lseek \ @@ -326,6 +327,7 @@ DECODER_TESTS = \ ipc_msgbuf.test \ ipc_sem.test \ ipc_shm.test \ + lchown.test \ linkat.test \ llseek.test \ lseek.test \ diff --git a/tests/lchown.c b/tests/lchown.c new file mode 100644 index 00000000..a1169018 --- /dev/null +++ b/tests/lchown.c @@ -0,0 +1,19 @@ +#include "tests.h" +#include + +#ifdef __NR_lchown + +# define SYSCALL_NR __NR_lchown +# define SYSCALL_NAME "lchown" + +# if defined __NR_lchown32 && __NR_lchown != __NR_lchown32 +# define UGID_TYPE_IS_SHORT +# endif + +# include "xchownx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_lchown") + +#endif diff --git a/tests/lchown.test b/tests/lchown.test new file mode 100755 index 00000000..ceeaa859 --- /dev/null +++ b/tests/lchown.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check lchown syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -- 2.40.0