diff options
Diffstat (limited to 'recipes-mac/smack/smack-test/notroot.py')
-rw-r--r-- | recipes-mac/smack/smack-test/notroot.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/recipes-mac/smack/smack-test/notroot.py b/recipes-mac/smack/smack-test/notroot.py index f0eb0b5..89f83f4 100644 --- a/recipes-mac/smack/smack-test/notroot.py +++ b/recipes-mac/smack/smack-test/notroot.py | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python3 |
2 | # | 2 | # |
3 | # Script used for running executables with custom labels, as well as custom uid/gid | 3 | # Script used for running executables with custom labels, as well as custom uid/gid |
4 | # Process label is changed by writing to /proc/self/attr/curent | 4 | # Process label is changed by writing to /proc/self/attr/curent |
@@ -9,8 +9,8 @@ | |||
9 | # """By default, each user in Debian GNU/Linux is given a corresponding group | 9 | # """By default, each user in Debian GNU/Linux is given a corresponding group |
10 | # with the same name. """ | 10 | # with the same name. """ |
11 | # | 11 | # |
12 | # Usage: root@desk:~# python notroot.py <uid> <label> <full_path_to_executable> [arguments ..] | 12 | # Usage: root@desk:~# python3 notroot.py <uid> <label> <full_path_to_executable> [arguments ..] |
13 | # eg: python notroot.py 1000 User::Label /bin/ping -c 3 192.168.1.1 | 13 | # eg: python3 notroot.py 1000 User::Label /bin/ping -c 3 192.168.1.1 |
14 | # | 14 | # |
15 | # Author: Alexandru Cornea <alexandru.cornea@intel.com> | 15 | # Author: Alexandru Cornea <alexandru.cornea@intel.com> |
16 | import os | 16 | import os |
@@ -28,6 +28,6 @@ try: | |||
28 | os.setuid(uid) | 28 | os.setuid(uid) |
29 | os.execv(path,sys.argv) | 29 | os.execv(path,sys.argv) |
30 | 30 | ||
31 | except Exception,e: | 31 | except Exception as e: |
32 | print e.message | 32 | print(e.strerror) |
33 | sys.exit(1) | 33 | sys.exit(-1) |