This is sources Bugzilla
Bugzilla Version 2.17.5
Bugzilla Bug 3266
  ldd doesn't work when /bin/sh is dash Last modified: 2007-07-04 17:53:29
Bug List: First Last (This bug is not in your list)   Show list      Query page      Enter new bug
Bug#: 3266   Hardware:   Reporter: sqweek <sqweek@gmail.com>
Host: Target: Build:
Product:     Add CC:
Component:   Version:   CC:
Remove selected CCs
Status: RESOLVED   Priority:  
Resolution: WONTFIX   Severity:  
Assigned To: Ulrich Drepper <drepper@redhat.com>   Target Milestone:  
Flags: Requestee:
  backport ()
  examined ()
  testsuite ()
Summary:
Keywords:

Attachment Description Type Created Actions
ldd.patch Fix ldd to rely on its proper interpreter patch 2006-10-02 08:38 Edit | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 3266 depends on: Show dependency tree
Show dependency graph
Bug 3266 blocks:

Additional Comments:


Leave as RESOLVED WONTFIX
Reopen bug
Mark bug as VERIFIED

View Bug Activity   |   Format For Printing


Description:   Last confirmed: 0000-00-00 00:00 Opened: 2006-09-26 16:02
The problem is in line 122:
122:if set -o pipefail 2> /dev/null; then

 When dash hits the unknown pipefail option, it prints a diagnostic (which is
suppressed of course) and then exits. This appears to be well within the rights
of a compliant shell
<http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_08_01>,
though it's arguable whether the specific case of "set -o foo" is covered
(especially since the table entries aren't exactly explicit about their
meaning). Anyway, I mean to contact dash about this aswell but I didn't find a
mailing list or bug database - only got as far as here tonight.

 As an aside, ldd also uses bash style $"" strings all over the place despite
claiming to be bourne compatible via #!/bin/sh (of course this still works in
dash you just get random $ signs in the output).

------- Additional Comment #1 From Ulrich Drepper 2006-09-27 17:00 -------
Then don't use dash.  bash is the only supported shell.

------- Additional Comment #2 From sqweek 2006-10-02 08:38 -------
Created an attachment (id=1342)
Fix ldd to rely on its proper interpreter

 Works for me, so long as ldd stops claiming to be POSIX compatible.

------- Additional Comment #3 From Ben Voigt 2007-07-04 15:44 -------
Do you really think it is appropriate for the C runtime library to dictate which
shells need to be installed?  That kind of dependency seems very backwards.

Note that one effect of this decision is to make ldd worthless on a busybox system.

------- Additional Comment #4 From Ben Voigt 2007-07-04 15:47 -------
Anyway, I have a much shorter, much cleaner patch:

 # 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
+if (set -o pipefail) 2> /dev/null; then
+  set -o pipefail
   try_trace() {
     eval $add_env '"$@"' | cat
   }

------- Additional Comment #5 From Ulrich Drepper 2007-07-04 16:46 -------
Stop reopening.  bash is the only supported shell.  Maintain your own changes if
you must but stop burdening others.

------- Additional Comment #6 From Ben Voigt 2007-07-04 17:53 -------
Just FYI -- I've never before reopened this bug.  If you are finding that the
bug keeps being opened, then it is something that a lot of your users care
about, not the same user bugging you continually.

Bug List: First Last (This bug is not in your list)   Show list      Query page      Enter new bug
Actions: New | Query | bug # | Reports | Requests   New Account | Log In