Messages in this thread Patch in this message | | | Date | Wed, 17 Jun 1998 20:10:13 +0100 | From | Peter <> | Subject | Re: binfmt_script |
| |
Third time lucky - I really am brain-dead tonight:
--- binfmt_script.c.old Wed Jun 17 15:54:48 1998 +++ binfmt_script.c Wed Jun 17 20:05:13 1998 @@ -14,7 +14,7 @@ static int do_load_script(struct linux_binprm *bprm,struct pt_regs *regs) { - char *cp, *i_name, *i_name_start, *i_arg; + char *cp, *i_name, *i_name_start, *i_arg, *end; struct dentry * dentry; char interp[128]; int retval; @@ -41,6 +41,7 @@ else break; } + end = cp; for (cp = bprm->buf+2; (*cp == ' ') || (*cp == '\t'); cp++); if (*cp == '\0') return -ENOEXEC; /* No interpreter name found */ @@ -69,8 +70,19 @@ bprm->p = copy_strings(1, &bprm->filename, bprm->page, bprm->p, 2); bprm->argc++; if (i_arg) { - bprm->p = copy_strings(1, &i_arg, bprm->page, bprm->p, 2); - bprm->argc++; + cp = end; + while (cp>=i_arg) { + for (; (cp>=i_arg) && (*cp != ' ') && (*cp != '\t'); cp--); + cp++; + bprm->p = copy_strings(1, &cp, bprm->page, bprm->p, 2); + bprm->argc++; + if (cp>i_arg) { + cp--; + while ((*cp == ' ') || (*cp == '\t')) + cp--; + *(cp + 1) = 0; + } + } } bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2); bprm->argc++; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |