summaryrefslogtreecommitdiff
diff options
authorPMR <pmr@pmr-lander>2020-05-06 07:37:44 +0000
committerPMR <pmr@pmr-lander>2020-05-06 07:37:44 +0000
commitdf807248402e3c417d9b294c6ba7bded25a9849c (patch)
treebbc034664a143c954ab836e513504967918410ac
parent66feca8304774e1c82c8b70625502a0624ae4622 (diff)
parent33f3ac2a4f72fc8ac2efcb40fd212ee53be4bbc9 (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.
-rwxr-xr-xbin/removable_storage_test5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/removable_storage_test b/bin/removable_storage_test
index 1c31b45..82f1595 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: