This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2][BZ #832][BZ #3266] Make ldd try_trace more robust and portable


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?

>> -# 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.

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).

-- 
Patrick "P. J." McDermott
  http://www.pehjota.net/
Lead Developer, ProteanOS
  http://www.proteanos.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]