diff options
author | Jeff Lane <jeffrey.lane@canonical.com> | 2020-05-05 13:59:07 -0400 |
---|---|---|
committer | Jeff Lane <jeffrey.lane@canonical.com> | 2020-05-05 13:59:07 -0400 |
commit | 33f3ac2a4f72fc8ac2efcb40fd212ee53be4bbc9 (patch) | |
tree | ed81dcf7f80fd8f80407243636e8238e052e6068 /bin | |
parent | 63f70ab09a6d2b3fb73b6b0f1bece6d4332057f0 (diff) |
bin/removable_storage_test: add uid check so script is only run as root. lp: #1876966
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/removable_storage_test | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/removable_storage_test b/bin/removable_storage_test index bbace30..67c92fd 100755 --- a/bin/removable_storage_test +++ b/bin/removable_storage_test @@ -617,6 +617,11 @@ def main(): test = DiskTest(args.device, args.memorycard, args.lsblkcommand) + # LP:1876966 + if os.getuid() != 0: + print("ERROR: This script must be run as root!") + return 1 + errors = 0 # If we do have removable drives attached and mounted if len(test.rem_disks) > 0 or len(test.rem_disks_nm) > 0: |