daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Aug 19th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [root@antergos tmp]# ls -l test
  2. -rwxr-xr-x 1 dolly users 16640 Aug 19 19:15 test
  3. [root@antergos tmp]# chown root:root test
  4. [root@antergos tmp]# chmod u+s test
  5. [root@antergos tmp]# ls -l test
  6. -rwsr-xr-x 1 root root 16640 Aug 19 19:15 test
  7. [root@antergos tmp]# ./test
  8. Real UID: 0
  9. Effective UID: 0
  10. [root@antergos tmp]# exit
  11. logout
  12. [dolly@antergos tmp]$ ./test
  13. Real UID: 1000
  14. Effective UID: 1000
  15. [dolly@antergos tmp]$ cat test.c
  16. #include <stdio.h>
  17. #include <unistd.h>
  18.  
  19. int main() {
  20.     printf("Real UID: %d\n", getuid());
  21.     printf("Effective UID: %d\n", geteuid());
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top