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