Added a minor fix to clitar.c for a bug.
[Samba/gbeck.git] / source3 / tests / trapdoor.c
blob83e10d061302c85005eff53a0b2f29e202cd9638
1 /* test for a trapdoor uid system */
3 #include <stdlib.h>
4 #include <unistd.h>
5 #include <stdio.h>
7 main()
9 if (getuid() != 0) {
10 fprintf(stderr,"ERROR: This test must be run as root - assuming non-trapdoor system\n");
11 exit(0);
14 if (seteuid(1) != 0) exit(1);
15 if (geteuid() != 1) exit(1);
16 if (seteuid(0) != 0) exit(1);
17 if (geteuid() != 0) exit(1);
19 if (setegid(1) != 0) exit(1);
20 if (getegid() != 1) exit(1);
21 if (setegid(0) != 0) exit(1);
22 if (getegid() != 0) exit(1);
24 exit(0);