git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netns xfrm: ipcomp6 support
[safe/jmp/linux-2.6]
/
fs
/
binfmt_script.c
diff --git
a/fs/binfmt_script.c
b/fs/binfmt_script.c
index
9e3963f
..
0834350
100644
(file)
--- 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)
char interp[BINPRM_BUF_SIZE];
int retval;
char interp[BINPRM_BUF_SIZE];
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;
/*
* This section does the #! interpretation.
* Sorta complicated, but hopefully it will work. -TYT
*/
return -ENOEXEC;
/*
* This section does the #! interpretation.
* Sorta complicated, but hopefully it will work. -TYT
*/
- bprm->
sh_bang = 1
;
+ bprm->
recursion_depth++
;
allow_write_access(bprm->file);
fput(bprm->file);
bprm->file = NULL;
allow_write_access(bprm->file);
fput(bprm->file);
bprm->file = NULL;