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
commit3895995b320c206d11f1300dbb238ef45bb73d0a (patch)
tree7be0a9f23f855911c99e6e19b6962a57c3922618 /bin
parentf870ea9c13a856cfbc123987cc9df3bea5c340b5 (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 bbace305..67c92fdb 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: