diff options
author | PMR <pmr@pmr-lander> | 2020-05-06 07:37:44 +0000 |
---|---|---|
committer | PMR <pmr@pmr-lander> | 2020-05-06 07:37:44 +0000 |
commit | fa65d1e478dd432044e7e024fdfa0f5667cf207f (patch) | |
tree | f0fbc91f6b4447a82018d8173e25530933116f07 /bin | |
parent | 59f8b4c3180e252f632d3e121099e649d8f47301 (diff) | |
parent | 3895995b320c206d11f1300dbb238ef45bb73d0a (diff) |
Merge #383451 from ~bladernr/plainbox-provider-checkbox:1876966-removable_storage_test-run-as-root
LP:1876966 - bin/removable_storage_test: added UID check to ensure it's only run as root.
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 1c31b45c..82f15959 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: |