From 3895995b320c206d11f1300dbb238ef45bb73d0a Mon Sep 17 00:00:00 2001 From: Jeff Lane Date: Tue, 5 May 2020 13:59:07 -0400 Subject: bin/removable_storage_test: add uid check so script is only run as root. lp: #1876966 --- bin/removable_storage_test | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bin') 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: -- cgit v1.2.3