char *path;
char *sudoers_args;
{
- int plen;
+ int plen, error;
static struct stat cst;
struct stat pst;
DIR *dirp;
/* Only need to stat cmnd once since it never changes */
if (cst.st_dev == 0) {
- if (stat(cmnd, &cst) == -1)
- return(FALSE);
+ if ((error = stat(cmnd, &cst))) {
+ if (runas_pw->pw_uid != 0) {
+ set_perms(PERM_RUNAS);
+ error = stat(cmnd, &cst);
+ set_perms(PERM_ROOT);
+ }
+ if (error)
+ return(FALSE);
+ }
if ((cmnd_base = strrchr(cmnd, '/')) == NULL)
cmnd_base = cmnd;
else