Do not pass whole environment for PIHOLE_SKIP_OS_CHECK=true

With `sudo -E`, the whole environment is passed to the root shell, which is a potential security and/or privacy issue when command overrides/functions, PATH or private user info are passed. To pass `PIHOLE_SKIP_OS_CHECK=true`, it can be passed alone to the bash/script call within the sudo session, so the `-E` flag can be omitted.

Signed-off-by: MichaIng <micha@dietpi.com>
This commit is contained in:
MichaIng 2022-04-13 21:30:12 +02:00 committed by GitHub
parent 9356d7bbb1
commit 2b124b1c69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -239,10 +239,10 @@ os_check() {
printf " If you wish to attempt to continue anyway, you can try one of the following commands to skip this check:\\n" printf " If you wish to attempt to continue anyway, you can try one of the following commands to skip this check:\\n"
printf "\\n" printf "\\n"
printf " e.g: If you are seeing this message on a fresh install, you can run:\\n" printf " e.g: If you are seeing this message on a fresh install, you can run:\\n"
printf " %bcurl -sSL https://install.pi-hole.net | PIHOLE_SKIP_OS_CHECK=true sudo -E bash%b\\n" "${COL_LIGHT_GREEN}" "${COL_NC}" printf " %bcurl -sSL https://install.pi-hole.net | sudo PIHOLE_SKIP_OS_CHECK=true bash%b\\n" "${COL_LIGHT_GREEN}" "${COL_NC}"
printf "\\n" printf "\\n"
printf " If you are seeing this message after having run pihole -up:\\n" printf " If you are seeing this message after having run pihole -up:\\n"
printf " %bPIHOLE_SKIP_OS_CHECK=true sudo -E pihole -r%b\\n" "${COL_LIGHT_GREEN}" "${COL_NC}" printf " %bsudo PIHOLE_SKIP_OS_CHECK=true pihole -r%b\\n" "${COL_LIGHT_GREEN}" "${COL_NC}"
printf " (In this case, your previous run of pihole -up will have already updated the local repository)\\n" printf " (In this case, your previous run of pihole -up will have already updated the local repository)\\n"
printf "\\n" printf "\\n"
printf " It is possible that the installation will still fail at this stage due to an unsupported configuration.\\n" printf " It is possible that the installation will still fail at this stage due to an unsupported configuration.\\n"