diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2012-12-22 20:29:13 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2012-12-22 22:48:39 -0500 |
commit | 7da069f24f757a892492d3639bd253106c3b8a05 (patch) | |
tree | 0432ee62906056cdbafe26e31e1622a4c0fda4a5 /scripts | |
parent | scripts/paxmodule.c: fix logic of finding either PT_PAX or XATTR_PAX (diff) | |
download | elfix-7da069f24f757a892492d3639bd253106c3b8a05.tar.gz elfix-7da069f24f757a892492d3639bd253106c3b8a05.tar.bz2 elfix-7da069f24f757a892492d3639bd253106c3b8a05.zip |
scripts/migrate-pax, misc/alt-revdep-pax: immediately bail if we are not root
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/migrate-pax | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/migrate-pax b/scripts/migrate-pax index 1d5c2f7..09a41e2 100755 --- a/scripts/migrate-pax +++ b/scripts/migrate-pax @@ -55,6 +55,12 @@ def run_usage(): def main(): + # Are we root? + uid = os.getuid() + if uid != 0: + print('This program must be run as root') + sys.exit(1) + try: opts, args = getopt.getopt(sys.argv[1:], 'vmdh') except getopt.GetoptError as err: @@ -95,12 +101,6 @@ def main(): run_usage() sys.exit(1) - # Are we root? - uid = os.getuid() - if uid != 0 and do_migration: - print('RUN AS ROOT: cannot migrate flags') - sys.exit(1) - # Do we have XATTR_PAX support? if do_migration or do_deleteall: try: |