update
This commit is contained in:
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user