X-Git-Url: https://git.armaanb.net/?a=blobdiff_plain;f=env.c;h=e2286fc83b0232425f67a8cda355ef1453f7739f;hb=29123f7c5b7cfb79419425ad4d2b7af153e06472;hp=2090897ea1738601eb9b82efe25d37b8660a4541;hpb=2103dd548aaa63339fd9137a4c9bb1e041921c28;p=opendoas.git diff --git a/env.c b/env.c index 2090897..e2286fc 100644 --- a/env.c +++ b/env.c @@ -15,6 +15,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "config.h" + #include #include "sys-tree.h" @@ -26,8 +28,8 @@ #include #include +#include "openbsd.h" #include "doas.h" -#include "includes.h" const char *formerpath; @@ -208,7 +210,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) {