secure_path in sudoers: deal with possible quotes
Sometimes the secure_path option value in /etc/sudoers is surrounded by quotes, in this case the current command creates an invalid entry and it's not possible to sudo anymore. This fix adjust the sed command to deal with possible quotes Change-Id: Ifd6f9e29b3c0d04d6f65d3f55524ad202fb3294e
This commit is contained in:
parent
e49d347ba9
commit
5e957f6350
1 changed files with 1 additions and 1 deletions
|
@ -6,5 +6,5 @@ fi
|
|||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
sed -i '/secure_path/ s/$/:\/usr\/local\/bin/' /etc/sudoers
|
||||
sed -i -e "/secure_path/ s@\([\'\"]\?\)\$@:/usr/local/bin/\1@" /etc/sudoers
|
||||
visudo -c
|
||||
|
|
Loading…
Reference in a new issue