Interestingly, the kernel code in question (C, not perl I'm afraid :-) already does this:
while (cp > bprm->buf) {
cp--;
if ((*cp == ' ') || (*cp == '\t'))
*cp = '\0';
else
break;
}
i.e. it finished the executable name at the first space or tab. I guess a better patch would be to change that if test to also null out '\r' (hmm...and probably form-feed and others whilst we're at it).
I wonder how loudly people would scream if this were proposed as a kosher kernel patch. It breaks backwards compatability quite badly, but perhaps only for people who deserve it... |