-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default locations to PATH to assure that all basic commands are available #3527
Conversation
…vailable Signed-off-by: MichaIng <micha@dietpi.com>
Do we want this for Pi-hole v5.2 ? |
I really, really, really don't like modifying PATH, and I think this is not the right approach. But if you can show me the docs that says the |
This is old bash syntax, search the man page for
Basically I agree, since users should know about the PATH whenever they run into "command not found" errors. But in fact there are users which open support requests with this (not many though). Before starting to code a check/handler around each and every executed command (as suggested in #3209), which still does not solve the issue for users but might just add more information, this is a much easier and solving approach. Actually I'd even consider overwriting the PATH to remove any custom binary locations which might contain degraded or unwanted (anyway required) binaries, although this might indeed break some strange custom setups. In fact running the script with |
Nice find, also that appending something to PATH is explicitly mentioned as example. |
Considering the information provided by the package maintainers, I'm second-guessing this merge and considering reverting it. |
Regards, |
Good that someone brings this issues with However, while this is an argument against But if you want to teach users about |
That's a fair point. |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/for-debian-10-4-and-greater-chech-if-useradd-command-exists/40626/14 |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-core-web-v5-2-and-ftl-v5-3-released/40909/1 |
By submitting this pull request, I confirm the following:
please fill any appropriate checkboxes, e.g: [X]
git rebase
)What does this PR aim to accomplish?:
In rare cases, e.g. when the installer is called via
su
, an incomplete/unprivileged PATH could be passed which can make basic commands unavailable, e.g.usermod
in this example: #3209To avoid larger coding effort to check (and in case search) for each and every basic external (i.e. not bash internal) command before using it, even that it is available in a usual executable location, it is reasonable to make all default locations available via PATH variable.
How does this PR accomplish the above?:
Add usual default locations to PATH, which matches by entries (not necessarily order) the
bash
default which is set if no PATH is set, e.g. when usingsudo
.What documentation changes (if any) are needed to support this PR?:
None