Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/imgact_shell.c
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
const char *image_header = imgp->image_header; | const char *image_header = imgp->image_header; | ||||
const char *ihp, *interpb, *interpe, *maxp, *optb, *opte, *fname; | const char *ihp, *interpb, *interpe, *maxp, *optb, *opte, *fname; | ||||
int error, offset; | int error, offset; | ||||
size_t length; | size_t length; | ||||
struct vattr vattr; | struct vattr vattr; | ||||
struct sbuf *sname; | struct sbuf *sname; | ||||
/* | |||||
* This image activator doesn't support an explicit interpreter. | |||||
* TODO(JA): consider adding support for an explicit shell interpreter | |||||
*/ | |||||
if (imgp->args->interpreter != -1) { | |||||
return (EINVAL); | |||||
} | |||||
/* a shell script? */ | /* a shell script? */ | ||||
if (((const short *)image_header)[0] != SHELLMAGIC) | if (((const short *)image_header)[0] != SHELLMAGIC) | ||||
return (-1); | return (-1); | ||||
/* | /* | ||||
* Don't allow a shell script to be the shell for a shell | * Don't allow a shell script to be the shell for a shell | ||||
* script. :-) | * script. :-) | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |