From 64578c0589a3a741f81fb55c16eeb882128da00b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 29 Jul 1998 03:08:05 +0000 Subject: merge from the autoconf2 branch to the main branch (This used to be commit 3bda7ac417107a7b01d91805ca71c4330657ed21) --- source3/tests/trapdoor.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 source3/tests/trapdoor.c (limited to 'source3/tests/trapdoor.c') diff --git a/source3/tests/trapdoor.c b/source3/tests/trapdoor.c new file mode 100644 index 0000000000..83e10d0613 --- /dev/null +++ b/source3/tests/trapdoor.c @@ -0,0 +1,25 @@ +/* test for a trapdoor uid system */ + +#include +#include +#include + +main() +{ + if (getuid() != 0) { + fprintf(stderr,"ERROR: This test must be run as root - assuming non-trapdoor system\n"); + exit(0); + } + + if (seteuid(1) != 0) exit(1); + if (geteuid() != 1) exit(1); + if (seteuid(0) != 0) exit(1); + if (geteuid() != 0) exit(1); + + if (setegid(1) != 0) exit(1); + if (getegid() != 1) exit(1); + if (setegid(0) != 0) exit(1); + if (getegid() != 0) exit(1); + + exit(0); +} -- cgit