Changeset View
Changeset View
Standalone View
Standalone View
bin/sh/exec.c
Show First 20 Lines • Show All 412 Lines • ▼ Show 20 Lines | if (stat(fullname, &statb) < 0) { | ||||
if (errno != ENOENT && errno != ENOTDIR) | if (errno != ENOENT && errno != ENOTDIR) | ||||
e = errno; | e = errno; | ||||
continue; | continue; | ||||
} | } | ||||
e = EACCES; /* if we fail, this will be the error */ | e = EACCES; /* if we fail, this will be the error */ | ||||
if (!S_ISREG(statb.st_mode)) | if (!S_ISREG(statb.st_mode)) | ||||
continue; | continue; | ||||
if (opt) { /* this is a %func directory */ | if (opt) { /* this is a %func directory */ | ||||
readcmdfile(fullname); | readcmdfile(fullname, -1 /* verify */); | ||||
if ((cmdp = cmdlookup(name, 0)) == NULL || cmdp->cmdtype != CMDFUNCTION) | if ((cmdp = cmdlookup(name, 0)) == NULL || cmdp->cmdtype != CMDFUNCTION) | ||||
error("%s not defined in %s", name, fullname); | error("%s not defined in %s", name, fullname); | ||||
stunalloc(fullname); | stunalloc(fullname); | ||||
goto success; | goto success; | ||||
} | } | ||||
#ifdef notdef | #ifdef notdef | ||||
if (statb.st_uid == geteuid()) { | if (statb.st_uid == geteuid()) { | ||||
if ((statb.st_mode & 0100) == 0) | if ((statb.st_mode & 0100) == 0) | ||||
▲ Show 20 Lines • Show All 394 Lines • Show Last 20 Lines |