This commit is contained in:
root
2025-06-24 10:55:51 +02:00
parent 677595835a
commit 1b3cf16d55

View File

@@ -333,8 +333,8 @@ EOF
# Validate the temporary file # Validate the temporary file
if sudo visudo -c -f /tmp/sudoers_additions; then if sudo visudo -c -f /tmp/sudoers_additions; then
# Append to sudoers if valid # Append to sudoers if valid using tee with sudo
sudo cat /tmp/sudoers_additions >> "$SUDOERS_FILE" cat /tmp/sudoers_additions | sudo EDITOR='tee -a' visudo >/dev/null 2>&1
print_success "Sudo authorization added" print_success "Sudo authorization added"
else else
print_error "Failed to add sudo rules - syntax validation failed" print_error "Failed to add sudo rules - syntax validation failed"