|
@@ -22,14 +22,15 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
|
|
char interp[BINPRM_BUF_SIZE];
|
|
char interp[BINPRM_BUF_SIZE];
|
|
int retval;
|
|
int retval;
|
|
|
|
|
|
- if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || (bprm->sh_bang))
|
|
|
|
|
|
+ if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') ||
|
|
|
|
+ (bprm->recursion_depth > BINPRM_MAX_RECURSION))
|
|
return -ENOEXEC;
|
|
return -ENOEXEC;
|
|
/*
|
|
/*
|
|
* This section does the #! interpretation.
|
|
* This section does the #! interpretation.
|
|
* Sorta complicated, but hopefully it will work. -TYT
|
|
* Sorta complicated, but hopefully it will work. -TYT
|
|
*/
|
|
*/
|
|
|
|
|
|
- bprm->sh_bang = 1;
|
|
|
|
|
|
+ bprm->recursion_depth++;
|
|
allow_write_access(bprm->file);
|
|
allow_write_access(bprm->file);
|
|
fput(bprm->file);
|
|
fput(bprm->file);
|
|
bprm->file = NULL;
|
|
bprm->file = NULL;
|