| 1 | /* $Cambridge: exim/test/src/showids.c,v 1.1 2006/02/06 16:24:05 ph10 Exp $ */ |
| 2 | |
| 3 | #include <stdio.h> |
| 4 | #include <unistd.h> |
| 5 | #include <sys/types.h> |
| 6 | |
| 7 | int main(void) |
| 8 | { |
| 9 | int count, i; |
| 10 | gid_t grouplist[100]; |
| 11 | |
| 12 | printf("uid=%d gid=%d euid=%d egid=%d\n", |
| 13 | getuid(), getgid(), geteuid(), getegid()); |
| 14 | |
| 15 | /* Can no longer use this because on different systems, the supplemental |
| 16 | groups will be different. */ |
| 17 | |
| 18 | #ifdef NEVER |
| 19 | printf("supplemental groups: "); |
| 20 | count = getgroups(100, grouplist); |
| 21 | for (i = 0; i < count; i++) printf("%d ", grouplist[i]); |
| 22 | printf("\n"); |
| 23 | #endif |
| 24 | |
| 25 | return 0; |
| 26 | } |