Ted Unangst wrote: > Yes, I think it's better to always reset these things. Here's a diff. > > 1. Always set HOME, PATH, SHELL etc to the target.
Committed this. I'm not entirely happy with the wording. I think hiding them under an option in the config man page is the wrong place. The default behavior should be documented in a more default place. Also mention working directory is not changed. Index: doas.1 =================================================================== RCS file: /cvs/src/usr.bin/doas/doas.1,v retrieving revision 1.19 diff -u -p -r1.19 doas.1 --- doas.1 4 Sep 2016 15:20:37 -0000 1.19 +++ doas.1 17 Jun 2019 16:57:26 -0000 @@ -40,6 +40,23 @@ or .Fl s is specified. .Pp +By default, the environment is reset. +The variables +.Ev HOME , +.Ev LOGNAME , +.Ev PATH , +.Ev SHELL , +and +.Ev USER +are set to values appropriate for the target user. +The variables +.Ev DISPLAY +and +.Ev TERM +are inherited from the current environment. +This behavior may be modified by the config file. +The working directory is not changed. +.Pp The options are as follows: .Bl -tag -width tenletters .It Fl a Ar style