<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://sourceware.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="4.4+"
          urlbase="http://sourceware.org/bugzilla/"
          
          maintainer="overseers@sourceware.org"
>

    <bug>
          <bug_id>3266</bug_id>
          
          <creation_ts>2006-09-26 16:02:00 +0000</creation_ts>
          <short_desc>ldd doesn&apos;t work when /bin/sh is dash</short_desc>
          <delta_ts>2010-08-09 18:38:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>glibc</product>
          <component>libc</component>
          <version>2.3.6</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="sqweek">sqweek</reporter>
          <assigned_to name="Ulrich Drepper">drepper.fsp</assigned_to>
          <cc>glibc-bugs</cc>
    
    <cc>richardvoigt</cc>
          <cf_gcchost></cf_gcchost>
          <cf_gcctarget></cf_gcctarget>
          <cf_gccbuild></cf_gccbuild>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>12394</commentid>
    <comment_count>0</comment_count>
    <who name="sqweek">sqweek</who>
    <bug_when>2006-09-26 16:02:42 +0000</bug_when>
    <thetext>The problem is in line 122:
122:if set -o pipefail 2&gt; /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
&lt;http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_08_01&gt;,
though it&apos;s arguable whether the specific case of &quot;set -o foo&quot; is covered
(especially since the table entries aren&apos;t exactly explicit about their
meaning). Anyway, I mean to contact dash about this aswell but I didn&apos;t find a
mailing list or bug database - only got as far as here tonight.

 As an aside, ldd also uses bash style $&quot;&quot; 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).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12422</commentid>
    <comment_count>1</comment_count>
    <who name="Ulrich Drepper">drepper.fsp</who>
    <bug_when>2006-09-27 17:00:16 +0000</bug_when>
    <thetext>Then don&apos;t use dash.  bash is the only supported shell.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12517</commentid>
    <comment_count>2</comment_count>
      <attachid>1342</attachid>
    <who name="sqweek">sqweek</who>
    <bug_when>2006-10-02 08:38:39 +0000</bug_when>
    <thetext>Created attachment 1342
Fix ldd to rely on its proper interpreter

 Works for me, so long as ldd stops claiming to be POSIX compatible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17793</commentid>
    <comment_count>3</comment_count>
    <who name="Ben Voigt">richardvoigt</who>
    <bug_when>2007-07-04 15:44:13 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17794</commentid>
    <comment_count>4</comment_count>
    <who name="Ben Voigt">richardvoigt</who>
    <bug_when>2007-07-04 15:47:08 +0000</bug_when>
    <thetext>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&apos;t bother to handle the case for older bash versions.
-if set -o pipefail 2&gt; /dev/null; then
+if (set -o pipefail) 2&gt; /dev/null; then
+  set -o pipefail
   try_trace() {
     eval $add_env &apos;&quot;$@&quot;&apos; | cat
   }
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17796</commentid>
    <comment_count>5</comment_count>
    <who name="Ulrich Drepper">drepper.fsp</who>
    <bug_when>2007-07-04 16:46:51 +0000</bug_when>
    <thetext>Stop reopening.  bash is the only supported shell.  Maintain your own changes if
you must but stop burdening others.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17798</commentid>
    <comment_count>6</comment_count>
    <who name="Ben Voigt">richardvoigt</who>
    <bug_when>2007-07-04 17:53:29 +0000</bug_when>
    <thetext>Just FYI -- I&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44277</commentid>
    <comment_count>7</comment_count>
    <who name="Henk Stubbe">a4239214</who>
    <bug_when>2010-07-30 11:56:39 +0000</bug_when>
    <thetext>This is stupid.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44278</commentid>
    <comment_count>8</comment_count>
    <who name="Jakub Jelinek">jakub</who>
    <bug_when>2010-07-30 12:02:14 +0000</bug_when>
    <thetext>See #c5.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44491</commentid>
    <comment_count>9</comment_count>
    <who name="sqweek">sqweek</who>
    <bug_when>2010-08-09 18:38:47 +0000</bug_when>
    <thetext>i agree, that the assumption /bin/sh is bash continues to be deemed correct IS 
incredibly stupid. &quot;all the world&apos;s a vax&quot; -&gt; &quot;all the shs are bash&quot;.

if you don&apos;t want to support other shells, that is FINE and understandable. just 
ask the kernel for what you actually want, /bin/bash.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>1342</attachid>
            <date>2006-10-02 08:38:00 +0000</date>
            <delta_ts>2006-10-02 08:38:39 +0000</delta_ts>
            <desc>Fix ldd to rely on its proper interpreter</desc>
            <filename>ldd.patch</filename>
            <type>text/plain</type>
            <size>251</size>
            <attacher name="sqweek">sqweek</attacher>
            
              <data encoding="base64">LS0tIGxkZC1zaAkyMDA2LTEwLTAyIDE2OjUwOjAwLjAwMDAwMDAwMCArMDgwMAorKysgL3Vzci9i
aW4vbGRkCTIwMDYtMTAtMDIgMTY6NTA6MTIuMDAwMDAwMDAwICswODAwCkBAIC0xLDQgKzEsNCBA
QAotIyEgL2Jpbi9zaAorIyEgL2Jpbi9iYXNoCiAjIENvcHlyaWdodCAoQykgMTk5Ni0yMDA0LCAy
MDA1IEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbiwgSW5jLgogIyBUaGlzIGZpbGUgaXMgcGFydCBv
ZiB0aGUgR05VIEMgTGlicmFyeS4KIAo=
</data>

          </attachment>
      

    </bug>

</bugzilla>