summaryrefslogtreecommitdiff
path: root/bin
diff options
authorJeff Lane <jeffrey.lane@canonical.com>2020-05-05 13:59:07 -0400
committerJeff Lane <jeffrey.lane@canonical.com>2020-05-05 13:59:07 -0400
commit33f3ac2a4f72fc8ac2efcb40fd212ee53be4bbc9 (patch)
treeed81dcf7f80fd8f80407243636e8238e052e6068 /bin
parent63f70ab09a6d2b3fb73b6b0f1bece6d4332057f0 (diff)
bin/removable_storage_test: add uid check so script is only run as root. lp: #1876966
Diffstat (limited to 'bin')
-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 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: