diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-05-23 21:41:59 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-05-23 21:41:59 -0400 |
| commit | b439ab8454467907d27b9cc287d6eb2cb0756a2e (patch) | |
| tree | 085b11c568fbc9a604efd0b5abab70a387998d74 | |
| parent | 23f1b44654220fbff41b476f2a001a2797d53ba5 (diff) | |
| download | sbosrcarch-b439ab8454467907d27b9cc287d6eb2cb0756a2e.tar.gz | |
Do not allow running as root.
| -rwxr-xr-x | sbosrcarch | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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]) { |
