summaryrefslogtreecommitdiffstats
path: root/source/l/glibc/doinst.sh-glibc
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2018-06-08 20:37:06 +0000
committer Eric Hameleers <alien@slackware.com>2018-06-09 01:06:22 +0200
commit8f0b1c57c99036007acd8a798ee81d938df67b98 (patch)
treea197ae6ab97d526c7216cfd3a4dfd921bb0b2696 /source/l/glibc/doinst.sh-glibc
parent6e00c56127b4fa2328e596ac18647fb7f27b674d (diff)
downloadcurrent-20180608203706.tar.gz
current-20180608203706.tar.xz
Fri Jun 8 20:37:06 UTC 201820180608203706
a/glibc-solibs-2.27-x86_64-3.txz: Rebuilt. a/pkgtools-15.0-noarch-16.txz: Rebuilt. upgradepkg: clean up --help output and add options upgradepkg: accept -help option (not just --help) upgradepkg: don't omit error messages in --terse mode upgradepkg: only print missing new package in old%new mode upgradepkg.8: move information about config file handling from BUGS to the DESCRIPTION section Thanks to Xsane. ap/vim-8.1.0039-x86_64-1.txz: Upgraded. l/glibc-2.27-x86_64-3.txz: Rebuilt. When installing the package, remove old versions of the glibc shared libraries. In addition to eliminating residue on the system from old package versions, this change will make it possible in the future to revert to older glibc packages using upgradepkg. l/glibc-i18n-2.27-x86_64-3.txz: Rebuilt. l/glibc-profile-2.27-x86_64-3.txz: Rebuilt. n/gnupg2-2.2.8-x86_64-1.txz: Upgraded. Sanitize the diagnostic output of the original file name in verbose mode. By using a made up file name in the message it was possible to fake status messages. Using this technique it was for example possible to fake the verification status of a signed mail. For more information, see: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-12020 (* Security fix *) xap/vim-gvim-8.1.0039-x86_64-1.txz: Upgraded.
Diffstat (limited to 'source/l/glibc/doinst.sh-glibc')
-rw-r--r--source/l/glibc/doinst.sh-glibc67
1 files changed, 46 insertions, 21 deletions
diff --git a/source/l/glibc/doinst.sh-glibc b/source/l/glibc/doinst.sh-glibc
index fc947587e..e99297394 100644
--- a/source/l/glibc/doinst.sh-glibc
+++ b/source/l/glibc/doinst.sh-glibc
@@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (C) 2002, 2005 Slackware Linux, Inc.
-# Copyright 2005, 2006, 2007, 2011, 2012 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2005, 2006, 2007, 2011, 2012, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -35,30 +35,55 @@ if [ -d lib/tls ]; then
mv lib/tls lib/obsolete
fi
if [ -x sbin/ldconfig ]; then
- sbin/ldconfig -r .
+ sbin/ldconfig -r . 2> /dev/null
fi
# Install NPTL glibc libraries:
if [ -x /sbin/ldconfig -a -d lib/incoming ]; then # swap on the fly
- # First create copies of the incoming libraries:
- ( cd lib/incoming
- for file in * ; do
- if [ ! -r ../${file}.incoming ]; then
- cp -a $file ../${file}.incoming
- fi
- done
- )
- # Then switch to them all at once:
- /sbin/ldconfig -l lib/*.incoming 2> /dev/null
- # Finally, rename them and clean up:
- ( cd lib
- for file in *.incoming ; do
- rm -f `basename $file .incoming`
- cp -a $file `basename $file .incoming`
- /sbin/ldconfig -l `basename $file .incoming`
- rm -f $file
- done
- )
+ # Try to protect with flock against another installpkg/removepkg running
+ # ldconfig while we're doing the on-the-fly install:
+ mkdir -p run/lock/pkgtools
+ ( flock 9 || exit 11
+ # First create copies of the incoming libraries:
+ ( cd lib/incoming
+ for file in * ; do
+ if [ ! -r ../${file}.incoming ]; then
+ cp -a $file ../${file}.incoming
+ fi
+ done
+ )
+ # Then switch to them all at once:
+ /sbin/ldconfig -l lib/*.incoming 2> /dev/null
+ # Remove old versions of the glibc libraries. If you really don't want to
+ # do this for some reason, create a file /etc/glibc-nowipe.
+ if [ ! -r etc/glibc-nowipe ]; then
+ ( cd lib
+ for INCOMING in incoming/*-* ; do
+ LIBPREFIX=$(basename $INCOMING | cut -f 1 -d -)
+ for LIBRARY in ${LIBPREFIX}-* ; do
+ # Don't remove the library if it ends in .incoming:
+ if [ "$(echo $LIBRARY | rev | cut -f 1 -d .)" = "gnimocni" ]; then
+ continue
+ fi
+ # Don't remove symlinks:
+ if [ -L $LIBRARY ]; then
+ continue
+ fi
+ rm -f $LIBRARY
+ done
+ done
+ )
+ fi
+ # Finally, rename them and clean up:
+ ( cd lib
+ for file in *.incoming ; do
+ rm -f `basename $file .incoming`
+ cp -a $file `basename $file .incoming`
+ /sbin/ldconfig -l `basename $file .incoming` 2> /dev/null
+ rm -f $file
+ done
+ )
+ ) 9> run/lock/pkgtools/ldconfig.lock
else # no ldconfig? Good, it's safe to just jam it on home (and make links below):
( cd lib/incoming
for file in * ; do