]> arthur.barton.de Git - bup.git/blob - dev/root-status
drecurse: replace OsFile (and __del__) with finalized fd
[bup.git] / dev / root-status
1 #!/bin/sh
2 """": # -*-python-*-
3 python="$(dirname "$0")/python" || exit $?
4 exec "$python" "$0" ${1+"$@"}
5 """
6
7 from __future__ import absolute_import, print_function
8 import os, sys
9
10 if sys.platform.startswith('cygwin'):
11     groups = os.getgroups()
12     if 544 in groups or 0 in groups:
13         print('root')
14     else:
15         print('none')
16 else:
17     if os.environ.get('FAKEROOTKEY'):
18         print('fake')
19     else:
20         if os.geteuid() == 0:
21             print('root')
22         else:
23             print('none')