[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r4760 - in glibc-package/trunk/debian: . debhelper.in



Author: aurel32
Date: 2011-06-28 18:27:22 +0000 (Tue, 28 Jun 2011)
New Revision: 4760

Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/debhelper.in/libc.preinst
Log:
  * libc.preinst: detect broken LD_LIBRARY_PATH.  Closes: #630608.



Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog	2011-06-28 17:58:06 UTC (rev 4759)
+++ glibc-package/trunk/debian/changelog	2011-06-28 18:27:22 UTC (rev 4760)
@@ -25,6 +25,7 @@
   * Fix patches/hppa/submitted-nptl-carlos.diff to correctly pass 
     --as-needed and --no-as-needed to the linker.
   * Update breaks on pre-multiarch packages.  Closes: #631907.
+  * libc.preinst: detect broken LD_LIBRARY_PATH.  Closes: #630608.
 
   [ Petr Salinger ]
   * kfreebsd/local-sysdeps.diff: update to revision 3467 (from glibc-bsd).

Modified: glibc-package/trunk/debian/debhelper.in/libc.preinst
===================================================================
--- glibc-package/trunk/debian/debhelper.in/libc.preinst	2011-06-28 17:58:06 UTC (rev 4759)
+++ glibc-package/trunk/debian/debhelper.in/libc.preinst	2011-06-28 18:27:22 UTC (rev 4760)
@@ -197,6 +197,31 @@
 
 if [ "$type" != abort-upgrade ]
 then
+  # See if LD_LIBRARY_PATH contains the traditional /lib, but not the
+  # multiarch path
+  dirs=$(echo $LD_LIBRARY_PATH | sed 's/:/ /g')
+  for dir in $dirs ; do
+    dir=$(readlink -e $dir || true)
+    case "$dir" in
+    /lib)
+      seen_traditional=1
+      ;;
+    SLIBDIR)
+      seen_multiarch=1
+      ;;
+    esac
+  done
+
+  if test -n "$seen_traditional" && test -z "$seen_multiarch" ; then
+    echo
+    echo "LD_LIBRARY_PATH contains the traditional /lib directory,"
+    echo "but not the multiarch directory SLIBDIR."
+    echo "It is not safe to upgrade the C library in this situation;"
+    echo "please remove the /lib/directory from LD_LIBRARY_PATH and" 
+    echo "try again."
+    exit 1
+  fi
+
   ldbytes=`head -c 20 RTLD_SO | od -c`
   dirs="/lib32 /lib64 /usr/local/lib /usr/local/lib32 /usr/local/lib64"
   if ! test -L /usr; then
@@ -211,7 +236,7 @@
   fi
 
   if test -n "$LD_LIBRARY_PATH"; then
-    dirs=$(echo $LD_LIBRARY_PATH | sed 's/:/ /')
+    dirs=$(echo $LD_LIBRARY_PATH | sed 's/:/ /g')
     if check_dirs $dirs; then
       echo
       echo "Another copy of the C library was found via LD_LIBRARY_PATH."
@@ -250,7 +275,7 @@
           echo "Warning: removing leftover from libc5 to libc6 transition: '$i'"
           rm -f "$i"    
           continue
-	  ;;
+          ;;
       esac
       # Stop the upgrade if there is a risk of crash after the upgrade
       echo


Reply to: