[PATCH v2][BZ #832][BZ #3266] Make ldd try_trace more robust and portable
Mike Frysinger
vapier@gentoo.org
Tue Sep 10 20:58:00 GMT 2013
On Tuesday 10 September 2013 13:00:18 Patrick 'P. J.' McDermott wrote:
> On 2013-09-10 11:30, Mike Frysinger wrote:
> > On Saturday 07 September 2013 11:45:45 Patrick "P. J." McDermott wrote:
> >> This is a second version of my previous ldd try_trace patch [1], with
> >> feedback from Dmitry V. Levin [2][3].
> >>
> >> [1]: http://sourceware.org/ml/libc-alpha/2012-11/msg00663.html
> >> [2]: http://sourceware.org/ml/libc-alpha/2012-11/msg00736.html
> >> [3]: http://sourceware.org/ml/libc-alpha/2013-06/msg01155.html
> >
> > the commit message itself needs explanation. only referring to previous
> > mailing list entries is not sufficient.
>
> Ah yes, sorry. Is something like the explanation in [1] above
> sufficient?
yes, looks like it. you can still include all the mailing list links (we
actually prefer that).
> >> -# The following use of cat is needed to make ldd work in SELinux
> >> -# environments where the executed program might not have permissions
> >> -# to write to the console/tty. But only bash 3.x supports the pipefail
> >> -# option, and we don't bother to handle the case for older bash
> >> versions. -if set -o pipefail 2> /dev/null; then
> >
> > this seems like a simpler fix:
> > if (set -o pipefail) 2>/dev/null; then
> >
> > that works with dash and bash-2.05
>
> Right, but as Andreas Schwab noted, that needs one more command to
> affect the current shell.
that really doesn't matter. it's a one time execution which is hardly a big
deal considering everything else going on in this script.
> Also, it'll still break on non-Bash shells where the program lacks tty
> write permissions. With my patch, ldd should work with such shells and
> SELinux configurations (by always doing the tty writing in the shell,
> even without pipefail support).
this, however, is a sufficiently good reason for making the change.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20130910/fbae7449/attachment.sig>
More information about the Libc-alpha
mailing list