X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=fs%2Fbinfmt_script.c;h=08343505e18455dedebace59a8c489ecb3b1cf7a;hb=67acd8b4b7a3f1b183ae358e1dfdb8a80e170736;hp=ab33939b12a7efb8d754fcc80b89bfc88651a33b;hpb=96de0e252cedffad61b3cb5e05662c591898e69a;p=safe%2Fjmp%2Flinux-2.6 diff --git a/fs/binfmt_script.c b/fs/binfmt_script.c index ab33939..0834350 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) 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 */ - bprm->sh_bang++; + bprm->recursion_depth++; allow_write_access(bprm->file); fput(bprm->file); bprm->file = NULL;