Skip to content

Commit 9c0e29a

Browse files
rhjdvsgsgkspbrisbin
authored andcommitted
fix: use EUID to check root
1 parent aa9beb5 commit 9c0e29a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/downgrade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ if ((!DOWNGRADE_LIB)); then
583583
done
584584

585585
# Check to ensure downgrade running as root
586-
if ((UID)); then
586+
if ((EUID)); then
587587
{
588588
gettext "downgrade must be run as root"
589589
echo

src/pacignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ parse_options() {
158158
pkgs=("$@")
159159

160160
# Check if run as root for `add` or `rm` subcommands
161-
if ((UID)) && [[ "$PACIGNORE_SUBCOMMAND" =~ ^(add|rm)$ ]]; then
161+
if ((EUID)) && [[ "$PACIGNORE_SUBCOMMAND" =~ ^(add|rm)$ ]]; then
162162
{
163163
gettext "pacignore must be run as root for this subcommand"
164164
printf "\n"

0 commit comments

Comments
 (0)