Make pwswitch off cover sudo -v, so Panama's installer runs without a password
This commit is contained in:
1 parent
cb089b39ea
commit
7cc98cd318
1 file changed
+4
-1
+4
-1
@@ -13,7 +13,10 @@ case "${1:-}" in
|
|||||||
off)
|
off)
|
||||||
tmp="$(mktemp)"
|
tmp="$(mktemp)"
|
||||||
trap 'rm -f "$tmp"' EXIT
|
trap 'rm -f "$tmp"' EXIT
|
||||||
echo "${user} ALL=(ALL) NOPASSWD: ALL" >"$tmp"
|
# verifypw=any lets `sudo -v` pass on NOPASSWD alone. Without it, the
|
||||||
|
# wheel group's password rule still makes -v (and Panama's installer,
|
||||||
|
# which starts with it) ask for a password.
|
||||||
|
printf '%s\n' "Defaults:${user} verifypw=any" "${user} ALL=(ALL) NOPASSWD: ALL" >"$tmp"
|
||||||
# Validate before installing so a bad file can never lock sudo.
|
# Validate before installing so a bad file can never lock sudo.
|
||||||
sudo visudo -cqf "$tmp"
|
sudo visudo -cqf "$tmp"
|
||||||
sudo install -m 0440 -o root -g root "$tmp" "$dropin"
|
sudo install -m 0440 -o root -g root "$tmp" "$dropin"
|
||||||
|
|||||||
Reference in new issue
Block a user