Skip to content

Commit

Permalink
Fix safepath to match de-facto Linux standards
Browse files Browse the repository at this point in the history
Linux distributions place `/usr/local` directories before their non-local counterparts in `$PATH`.

Unlike BSD, Linux distributions don't put packaged executables under `/usr/local`, instead it is used by the local user to place their own executables, potentially to replace system executables.
  • Loading branch information
TheDcoder authored Jun 15, 2023
1 parent b96106b commit 69b5347
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doas.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ mygetpwuid_r(uid_t uid, struct passwd *pwd, struct passwd **result)
int
main(int argc, char **argv)
{
const char *safepath = "/bin:/sbin:/usr/bin:/usr/sbin:"
"/usr/local/bin:/usr/local/sbin";
const char *safepath = "/usr/local/bin:/usr/local/sbin:"
"/bin:/sbin:/usr/bin:/usr/sbin";
const char *confpath = NULL;
char *shargv[] = { NULL, NULL };
char *sh;
Expand Down

0 comments on commit 69b5347

Please sign in to comment.