diff options
| author | mo khan <mo@mokhan.ca> | 2014-07-23 20:34:20 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-07-23 20:34:20 -0600 |
| commit | a7e6b519e7bbbb41d79d844ecfcd5da260979c27 (patch) | |
| tree | fd4c91fa4b9dcb2f5be693847233824c1b05c363 | |
| parent | ebef19bdc50f7bf4f4eb78ef36ef7a9de8f8edf6 (diff) | |
add example of reading the real user id and the effective user id with chmod u+s"
| -rw-r--r-- | uid_demo.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/uid_demo.c b/uid_demo.c new file mode 100644 index 0000000..bcb77cc --- /dev/null +++ b/uid_demo.c @@ -0,0 +1,9 @@ +#include <stdio.h> +#include <unistd.h> + +int main(int argc, const char *argv[]) +{ + printf("real uid: %d\n", getuid()); + printf("effective uid: %d\n", geteuid()); + return 0; +} |
