sudosh adds current directory to PATH
Project moved to github: https://github.com/squash/sudosh2
Brought to you by:
squash
When using "clearenvironment=yes", the current directory is being added to the path. Reason for this is the following code in src/sudosh.c:
if (!strcmp (user.to, "root"))
snprintf (user.path.str, BUFSIZ - 1,
"PATH=/sbin:/bin:/usr/sbin:/usr/bin:");
else
snprintf (user.path.str, BUFSIZ - 1,
"PATH=/usr/bin:/bin:/usr/local/bin:");
Changing this (removing ":" at the end of PATH=) to read
if (!strcmp (user.to, "root"))
snprintf (user.path.str, BUFSIZ - 1,
"PATH=/sbin:/bin:/usr/sbin:/usr/bin");
else
snprintf (user.path.str, BUFSIZ - 1,
"PATH=/usr/bin:/bin:/usr/local/bin");
seems to fix this for me
Accepted into current build (1.0.5)