opendoas

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

commit 4356cb6b4cefb142d182784c264ce936a1ec3626
parent ae7c4bab7a4899d7bd9b71a21451729a58cb7af6
Author: tedu <tedu>
Date:   Sun,  7 Jul 2019 19:21:28 +0000

fix one last edge case regarding PATH, allows simpler config.

Diffstat:
Mdoas.conf.5 | 2+-
Menv.c | 5++++-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/doas.conf.5 b/doas.conf.5 @@ -133,7 +133,7 @@ while retaining the original PATH. permit persist setenv { PKG_CACHE PKG_PATH } aja cmd pkg_add permit setenv { -ENV PS1=$DOAS_PS1 SSH_AUTH_SOCK } :wheel permit nopass tedu as root cmd /usr/sbin/procmap -permit nopass keepenv setenv { PATH=$PATH } root as root +permit nopass keepenv setenv { PATH } root as root .Ed .Sh SEE ALSO .Xr doas 1 diff --git a/env.c b/env.c @@ -208,7 +208,10 @@ fillenv(struct env *env, const char **envlist) val = getenv(val + 1); } } else { - val = getenv(name); + if (strcmp(name, "PATH") == 0) + val = formerpath; + else + val = getenv(name); } /* at last, we have something to insert */ if (val) {