Internal routine to get nobody's uid
()
| 1020 | nobody = None |
| 1021 | |
| 1022 | def nobody_uid(): |
| 1023 | """Internal routine to get nobody's uid""" |
| 1024 | global nobody |
| 1025 | if nobody: |
| 1026 | return nobody |
| 1027 | try: |
| 1028 | import pwd |
| 1029 | except ImportError: |
| 1030 | return -1 |
| 1031 | try: |
| 1032 | nobody = pwd.getpwnam('nobody')[2] |
| 1033 | except KeyError: |
| 1034 | nobody = 1 + max(x[2] for x in pwd.getpwall()) |
| 1035 | return nobody |
| 1036 | |
| 1037 | |
| 1038 | def executable(path): |