Bug 807 - /usr/bin/ldd depends on bash.
Summary: /usr/bin/ldd depends on bash.
Status: RESOLVED DUPLICATE of bug 832
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.3.4
: P2 enhancement
Target Milestone: ---
Assignee: GOTO Masanori
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-29 10:47 UTC by Han Boetes
Modified: 2023-10-28 17:30 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Han Boetes 2005-03-29 10:47:23 UTC
/usr/bin/ldd contains a bash shebang. Since I don't use bash ldd won't work.

Furthermore the shell I do use trips over the set -o pipefail. This is easily
fixed with the included patch:

--- ldd.orig    2005-03-29 12:35:17.820676992 +0200
+++ ldd 2005-03-29 12:34:36.324985296 +0200
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/sh
 # Copyright (C) 1996-2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
@@ -116,10 +116,12 @@
 fi
 
 # 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
+# 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 [ "${BASH_VERSION%%.*}" -ge 3 ]; then
+  set -o pipefail
   try_trace() {
     eval $add_env '"$@"' | cat
   }
Comment 1 Han Boetes 2005-04-07 09:41:32 UTC

*** This bug has been marked as a duplicate of 832 ***