Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/imgact_binmisc.c
Show First 20 Lines • Show All 643 Lines • ▼ Show 20 Lines | default: | ||||
printf("%s: Unknown macro #%c sequence in " | printf("%s: Unknown macro #%c sequence in " | ||||
"interpreter string\n", KMOD_NAME, *(s + 1)); | "interpreter string\n", KMOD_NAME, *(s + 1)); | ||||
error = EINVAL; | error = EINVAL; | ||||
goto done; | goto done; | ||||
} | } | ||||
s++; | s++; | ||||
} | } | ||||
/* Check to make sure we won't overrun the stringspace. */ | /* Make room for the interpreter */ | ||||
if (offset > imgp->args->stringspace) { | error = exec_args_adjust_args(imgp->args, 0, offset); | ||||
if (error != 0) { | |||||
sx_sunlock(&interp_list_sx); | sx_sunlock(&interp_list_sx); | ||||
error = E2BIG; | |||||
goto done; | goto done; | ||||
} | } | ||||
/* Make room for the interpreter */ | |||||
bcopy(imgp->args->begin_argv, imgp->args->begin_argv + offset, | |||||
imgp->args->endp - imgp->args->begin_argv); | |||||
/* Adjust everything by the offset. */ | |||||
imgp->args->begin_envv += offset; | |||||
imgp->args->endp += offset; | |||||
imgp->args->stringspace -= offset; | |||||
/* Add the new argument(s) in the count. */ | /* Add the new argument(s) in the count. */ | ||||
imgp->args->argc += ibe->ibe_interp_argcnt; | imgp->args->argc += ibe->ibe_interp_argcnt; | ||||
/* | /* | ||||
* The original arg[] list has been shifted appropriately. Copy in | * The original arg[] list has been shifted appropriately. Copy in | ||||
* the interpreter path. | * the interpreter path. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |