Skip to content

Commit e38ee51

Browse files
Damaj301damaj-lolagnostic-apollo
authored andcommitted
scripts/pkg.in: prevent pkg command from being run as root
1 parent 51c3694 commit e38ee51

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/pkg.in

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/bash
22
set -eu
33

4+
# Root Check
5+
if [[ "$(id -u)" == "0" ]]; then
6+
echo "Error: Cannot run 'pkg' command as root"
7+
exit 1
8+
fi
9+
410
# Setup TERMUX_APP_PACKAGE_MANAGER
511
source "@TERMUX_PREFIX@/bin/termux-setup-package-manager" || exit 1
612

0 commit comments

Comments
 (0)