]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* elf/ldd.bash.in: For -u, set bind_now=yes. cvs/fedora-glibc-2_3_3-89
authorJakub Jelinek <jakub@redhat.com>
Wed, 8 Dec 2004 10:57:20 +0000 (10:57 +0000)
committerJakub Jelinek <jakub@redhat.com>
Wed, 8 Dec 2004 10:57:20 +0000 (10:57 +0000)
If eval $add_env '"$file"' exits with exitcode 5, retry with
eval $add_env \${RTLD} '"$file"'.
Remove | cat usage, it breaks exit code propagation.
* elf/rtld.c (process_envvars): If __libc_enable_secure and
mode != normal, exit with exitcode 5.

ChangeLog
elf/ldd.bash.in
elf/rtld.c

index 17b59283eaa2adea1e6f1a2647e717f68bc269e8..75a4f15a4d1396807b59100481cde96bb766531d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-12-08  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf/ldd.bash.in: For -u, set bind_now=yes.
+       If eval $add_env '"$file"' exits with exitcode 5, retry with
+       eval $add_env \${RTLD} '"$file"'.
+       Remove | cat usage, it breaks exit code propagation.
+       * elf/rtld.c (process_envvars): If __libc_enable_secure and
+       mode != normal, exit with exitcode 5.
+
 2004-12-07  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/posix/sysconf.c (__sysconf_check_spec): Only define
index f40092421728e9a494803806756c46579cc4edb5..c91886a1e694cfd626b6688013a01fe3a09cb18c 100644 (file)
@@ -74,6 +74,7 @@ For bug reporting instructions, please see:
     ;;
   -u | --u | --un | --unu | --unus | --unuse | --unused)
     unused=yes
+    bind_now=yes
     shift
     ;;
   --v | --ve | --ver)
@@ -153,7 +154,11 @@ warning: you do not have execution permission for" "\`$file'" >&2
     fi
     case $ret in
     0)
-      eval $add_env '"$file"' || result=1
+      # If the program exits with exit code 5, it means the process has been
+      # invoked with __libc_enable_secure.  Fall back to running it through
+      # the dynamic linker.
+      ( eval $add_env '"$file"'; ret=$?; [ $ret != 5 ] && exit $ret;
+        eval $add_env \${RTLD} '"$file"'; ) || result=1
       ;;
     1)
       # This can be a non-ELF binary or no binary at all.
@@ -163,10 +168,7 @@ warning: you do not have execution permission for" "\`$file'" >&2
       }
       ;;
     2)
-      # 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.
-      eval $add_env \${RTLD} '"$file"' | cat || result=1
+      eval $add_env \${RTLD} '"$file"' || result=1
       ;;
     *)
       echo 'ldd:' ${RTLD} $"exited with unknown exit code" "($ret)" >&2
index 45c65af9047b6a29db95534bc042f4dee008da06..ee7291477f6aa7534cd5dce5aa2a414607fa9885 100644 (file)
@@ -2377,9 +2377,11 @@ process_envvars (enum mode *modep)
       if (__access ("/etc/suid-debug", F_OK) != 0)
         {
          unsetenv ("MALLOC_CHECK_");
-         if (mode == normal)
-           GLRO(dl_debug_mask) = 0;
+         GLRO(dl_debug_mask) = 0;
         }
+
+      if (mode != normal)
+       _exit (5);
     }
   /* If we have to run the dynamic linker in debugging mode and the
      LD_DEBUG_OUTPUT environment variable is given, we write the debug