This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Fix BZ #18660 -- overflow in getusershell
- From: Tobias Stoeckmann <tobias at stoeckmann dot org>
- To: Tolga Dalman <tolga dot dalman at googlemail dot com>, Paul Pluzhnikov <ppluzhnikov at gmail dot com>, Joseph Myers <joseph at codesourcery dot com>, GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Sat, 29 Aug 2015 13:11:00 +0200
- Subject: Re: [patch] Fix BZ #18660 -- overflow in getusershell
- Authentication-results: sourceware.org; auth=none
- References: <CAPC3xaqdOk4EWQJEiBLidfVxSx1iH5F9k_DTZDamkjQR1xZ3Gw at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1508171058110 dot 9234 at digraph dot polyomino dot org dot uk> <CAPC3xaqRbCc1Ytd7AAkmEjgr_wtq_AA-hEvRPZiup2QwHMdS-w at mail dot gmail dot com> <20150819145531 dot GE1584 at vapier> <CAPC3xap4437=qzNpuo+dtusU_V_YFBd0i1CpNRsPTopEgZvc3w at mail dot gmail dot com> <20150819182758 dot GI1584 at vapier> <55DE2AA4 dot 7040604 at googlemail dot com> <20150826214004 dot GF3116 at vapier>
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