diff options
Diffstat (limited to 'fs/binfmt_script.c')
-rw-r--r-- | fs/binfmt_script.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c index 9e3963f7ebf1..08343505e184 100644 --- a/fs/binfmt_script.c +++ b/fs/binfmt_script.c | |||
@@ -22,14 +22,15 @@ static int load_script(struct linux_binprm *bprm,struct pt_regs *regs) | |||
22 | char interp[BINPRM_BUF_SIZE]; | 22 | char interp[BINPRM_BUF_SIZE]; |
23 | int retval; | 23 | int retval; |
24 | 24 | ||
25 | if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || (bprm->sh_bang)) | 25 | if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || |
26 | (bprm->recursion_depth > BINPRM_MAX_RECURSION)) | ||
26 | return -ENOEXEC; | 27 | return -ENOEXEC; |
27 | /* | 28 | /* |
28 | * This section does the #! interpretation. | 29 | * This section does the #! interpretation. |
29 | * Sorta complicated, but hopefully it will work. -TYT | 30 | * Sorta complicated, but hopefully it will work. -TYT |
30 | */ | 31 | */ |
31 | 32 | ||
32 | bprm->sh_bang = 1; | 33 | bprm->recursion_depth++; |
33 | allow_write_access(bprm->file); | 34 | allow_write_access(bprm->file); |
34 | fput(bprm->file); | 35 | fput(bprm->file); |
35 | bprm->file = NULL; | 36 | bprm->file = NULL; |