opendoas

my fork of doas with custom prompt
git clone git://git.kocotian.pl/opendoas.git
Log | Files | Refs | README | LICENSE

commit 6d8f0e61e0449a0446ef820521e94f5093b1da41
parent 3f08ab43f6e987220ef9711705368f1b49bde1cc
Author: tedu <tedu>
Date:   Sat, 29 Jun 2019 22:35:37 +0000

fix some more fallout from setting path in setusercontext. restore previous behavior of using user PATH if no cmd restriction in the rule. run into by espie

Diffstat:
Mdoas.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/doas.c b/doas.c @@ -500,10 +500,13 @@ main(int argc, char **argv) envp = prepenv(rule, mypw, targpw); + /* setusercontext set path for the next process, so reset it for us */ if (rule->cmd) { - /* do this again after setusercontext reset it */ if (setenv("PATH", safepath, 1) == -1) err(1, "failed to set PATH '%s'", safepath); + } else { + if (setenv("PATH", formerpath, 1) == -1) + err(1, "failed to set PATH '%s'", formerpath); } execvpe(cmd, argv, envp); if (errno == ENOENT)