-
Notifications
You must be signed in to change notification settings - Fork 36
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
Too many PATH changes ? #53
Comments
There is just one place where its redundant in case the rule allows only a specific comment: But for sake of being closer to the upstream sources and simplifying patches/diffs, I don't really think there is a reason to remove the first one. The other two places 1. and 2. are for different features,
But why should
|
Ok, I confused the two the environments:
I am looking to the "permit user" use case. Sometime I want (e.g.) to run tune2fs which is under /usr/sbin (but it could be any other command under /usr/sbin). So I would like to do
Instead of
Currently doas doesn't allow to extend/change/replace that path. |
I don't know if I understand correctly, do you want that doas prepends some directories to the executing users PATH instead of changing the PATH variable in the users shell? |
doas allows to change the environment of the child. However the child executable is till searched only in the current PATH.
In the example abowe, the environment variable PATH of the child contains /usr/sbin. However doas doesn't search the excutable in /usr/sbin but only in the current PATH |
Ok yes that is the same as in the upstream sources, I don't think I really want to divert from that. My only idea would be to add an option to either enable or disable to use the PATH from the target environment. Generally I do think it would be better to use the PATH from the targets environment and add a option to enable the current behavior of using |
This is a very confusing behavior, I was trying to understand why the Can this at least be documented that you can't override this "safepath" for specific commands? |
Hi,
I tried to understand how the PATH is changed by opendoas. What I found is that opendoas update the path several times; the place that I found were:
OpenDoas/env.c
Line 207 in 9474e41
OpenDoas/env.c
Line 213 in 9474e41
OpenDoas/doas.c
Line 372 in 9474e41
and
OpenDoas/doas.c
Line 419 in 9474e41
Where only the last one should matter. My understanding is that 3) become useless, because the following lines were removed in the porting from openbsd doas:
(from https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/doas/doas.c?annotate=1.89)
Instead my understanding about 1) and 2) is that there was a merging of two unrelated changes in the original "openbsd doas".
What about simplifying the code removing the unneeded PATH setting ? Then I would like to discuss how insert the /sbin and /usr/sbin paths in the PATH before invoking the command; currently if I as user don't have /usr/sbin in my path, I have to explicit it in the doas invoking if I want to call a command which is under /sbin:/usr/sbin:
instead of
But this is another story...
The text was updated successfully, but these errors were encountered: