tests/uid*: use fchown* instead of chown*
Newer architectures have no chown syscall, so use fchown* syscalls
for testing printuid.
* tests/uid.test: Use fchown instead of chown.
* tests/uid.c: Test __NR_fchown instead of __NR_chown.
(main): Use __NR_fchown instead of __NR_chown.
* tests/uid32.c: Test __NR_fchown32 instead of __NR_chown32.
(main): Use __NR_fchown32 instead of __NR_chown32.
* tests/uid16.c: Test __NR_fchown and __NR_fchown32 instead
of __NR_chown and __NR_chown32.
(main): Use __NR_fchown instead of __NR_chown.
* tests/uid.awk: Update regexp.
diff --git a/tests/uid16.c b/tests/uid16.c
index a2006d7..c0ef120 100644
--- a/tests/uid16.c
+++ b/tests/uid16.c
@@ -15,7 +15,7 @@
&& defined(__NR_getresuid) \
&& defined(__NR_setreuid) \
&& defined(__NR_setresuid) \
- && defined(__NR_chown) \
+ && defined(__NR_fchown) \
&& defined(__NR_getgroups) \
\
&& defined(__NR_getuid32) \
@@ -23,7 +23,7 @@
&& defined(__NR_getresuid32) \
&& defined(__NR_setreuid32) \
&& defined(__NR_setresuid32) \
- && defined(__NR_chown32) \
+ && defined(__NR_fchown32) \
&& defined(__NR_getgroups32) \
\
&& __NR_getuid != __NR_getuid32 \
@@ -31,7 +31,7 @@
&& __NR_getresuid != __NR_getresuid32 \
&& __NR_setreuid != __NR_setreuid32 \
&& __NR_setresuid != __NR_setresuid32 \
- && __NR_chown != __NR_chown32 \
+ && __NR_fchown != __NR_fchown32 \
&& __NR_getgroups != __NR_getgroups32 \
/**/
int uid;
@@ -65,7 +65,7 @@
}
assert(syscall(__NR_setreuid, -1, 0xffff) == 0);
assert(syscall(__NR_setresuid, uid, -1, 0xffff) == 0);
- assert(syscall(__NR_chown, ".", -1, 0xffff) == 0);
+ assert(syscall(__NR_fchown, 1, -1, 0xffff) == 0);
assert((size = syscall(__NR_getgroups, 0, list)) >= 0);
assert(list = calloc(size + 1, sizeof(*list)));
assert(syscall(__NR_getgroups, size, list) == size);