From b439ab8454467907d27b9cc287d6eb2cb0756a2e Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 23 May 2026 21:41:59 -0400 Subject: Do not allow running as root. --- sbosrcarch | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sbosrcarch b/sbosrcarch index b706cf5..b6f053b 100755 --- a/sbosrcarch +++ b/sbosrcarch @@ -425,6 +425,11 @@ our $totalfiles = 0; # check_single_instance() returns. our $self_fh; +# 20260523 bkw: as requested by Tadgy: +sub check_non_root { + die "$0 may not be run as root.\n" unless $<; +} + # 20260523 bkw: This may not be portable to non-Linux (or even to # Perl built on non-Slackware), but it doesn't have to be. sub check_single_instance { @@ -1992,6 +1997,7 @@ EOF $|++; usage() unless (defined $ARGV[0] && $ARGV[0] !~ /^-+h(?:elp)?/); +check_non_root(); check_single_instance(); read_config(); for ($ARGV[0]) { -- cgit v1.2.3