mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Prevent web UI password change by web user
This commit is contained in:
parent
1509eb7d82
commit
004ba28378
1 changed files with 12 additions and 0 deletions
|
@ -41,6 +41,18 @@ SetTemperatureUnit(){
|
||||||
|
|
||||||
SetWebPassword(){
|
SetWebPassword(){
|
||||||
|
|
||||||
|
if[ "$SUDO_USER" == "www-data" ]; then
|
||||||
|
echo "Security measure: user www-data is not allowed to change webUI password!"
|
||||||
|
echo "Exiting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if[ "$SUDO_USER" == "lighttpd" ]; then
|
||||||
|
echo "Security measure: user lighttpd is not allowed to change webUI password!"
|
||||||
|
echo "Exiting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Remove password from file (create backup setupVars.conf.bak)
|
# Remove password from file (create backup setupVars.conf.bak)
|
||||||
sed -i.bak '/WEBPASSWORD/d' /etc/pihole/setupVars.conf
|
sed -i.bak '/WEBPASSWORD/d' /etc/pihole/setupVars.conf
|
||||||
# Set password only if there is one to be set
|
# Set password only if there is one to be set
|
||||||
|
|
Loading…
Reference in a new issue