[patch] Fix BZ #18660 -- overflow in getusershell

Tobias Stoeckmann tobias@stoeckmann.org
Sat Aug 29 11:11:00 GMT 2015


> all i've done is post this patch.  if people are happy with it and the
> direction, i can add some tests.

I think the comment handling could be further adjusted.

After all, it IS possible to have a shell path containing '#' or ' '.
I won't argue that it's a sane thing to do, but the file system allows
it. And right now it's impossible to specify such a shell.

It is also specified that a valid shell must start with '/', i.e. it
must be an absolute path.

So, how about ignoring every line that does not define an absolute path?
That way, comments are supported, too.

Unfortunately I don't know if anyone writes comments next to the
absolute path in the file, like:

/bin/sh # korn shell



More information about the Libc-alpha mailing list