1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-18 14:18:15 +00:00

Merge pull request #1023 from pi-hole/fix/fedora_sudo

Fix Fedora sudo permissions
This commit is contained in:
DL6ER 2016-12-23 17:13:57 +01:00 committed by GitHub
commit 5b4653cf39

View File

@ -809,6 +809,13 @@ installPiholeWeb() {
cp /etc/.pihole/advanced/pihole.sudo /etc/sudoers.d/pihole cp /etc/.pihole/advanced/pihole.sudo /etc/sudoers.d/pihole
# Add lighttpd user (OS dependent) to sudoers file # Add lighttpd user (OS dependent) to sudoers file
echo "${LIGHTTPD_USER} ALL=NOPASSWD: /usr/local/bin/pihole" >> /etc/sudoers.d/pihole echo "${LIGHTTPD_USER} ALL=NOPASSWD: /usr/local/bin/pihole" >> /etc/sudoers.d/pihole
if [[ "$LIGHTTPD_USER" == "lighttpd" ]]; then
# Allow executing pihole via sudo with Fedora
# Usually /usr/local/bin is not permitted as directory for sudoable programms
echo "Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin" >> /etc/sudoers.d/pihole
fi
chmod 0440 /etc/sudoers.d/pihole chmod 0440 /etc/sudoers.d/pihole
echo " done!" echo " done!"
} }