added sudo to builder user
Some checks failed
Test setup and build APKs archlinux / Build-APK-Arch-Linux (push) Has been cancelled
Test setup and build APKs / Build-and-Create-Development-Environment (push) Has been cancelled

This commit is contained in:
2025-12-09 15:18:41 +01:00
parent d5abf98166
commit 8bea69a307

6
dist/pacman.sh vendored
View File

@@ -33,7 +33,13 @@ else
if [ "$EUID" -eq 0 ]; then if [ "$EUID" -eq 0 ]; then
echo "Building paru as root is not allowed. Creating a temporary user for building..." echo "Building paru as root is not allowed. Creating a temporary user for building..."
TEMP_USER="builder" TEMP_USER="builder"
pacman -S --noconfirm sudo
useradd -m "$TEMP_USER" useradd -m "$TEMP_USER"
# add user to sudoers with no password
echo "$TEMP_USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
usermod -aG wheel "$TEMP_USER"
usermod -aG sudo "$TEMP_USER"
echo "Adding temporary user pwd" echo "Adding temporary user pwd"
yes | passwd -d "$TEMP_USER" yes | passwd -d "$TEMP_USER"
chown -R "$TEMP_USER":"$TEMP_USER" . chown -R "$TEMP_USER":"$TEMP_USER" .