LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Something has deleted cca 100 libs (https://www.linuxquestions.org/questions/slackware-14/something-has-deleted-cca-100-libs-941993/)

CMartin 04-26-2012 10:17 PM

Something has deleted cca 100 libs
 
I had to reinstall the system, and still did not fully recovered. Did anyone experience a problem with openssl compiled from slackware source, 13.37 ?

Compiled the openssl from slackware source, taken from this repository on Apr,25th:
ftp://ftp.slackware.com/pub/slackwar...rce/n/openssl/

Immediately after installing it I could no longer start bunch of programs, all complaining about totally unrelated missing libs. I lost boost libs, zlib, gtk, xaw3d, libxaw, utempter, libX11 and all its related libs, aaa_elflibs, libs from openssl, and many, many other...
I could boot the system after that, it would barely run, but hardly anything besides basic gnu programs, elvis, ftp, and slackpkg worked.

At first I thought it's my mistake. Probably as root I typed something unintentionally, and although the history did not show anything suspicious, I was still prone to blame myself.
I have almost recovered the system. Could run all basic programs and log into X again. Than I compiled and installed the openssl from slackware source one more time, not expecting the same disaster (I blamed myself for not careful typing). But I was wrong.

The disaster happened the second time. Immediately upon installation most of my libs were deleted again, for no apparent reason.
Why did I try to install the openssl from slackware source ? I needed idea algorithm, but that's not important. In openssl.SlackBuild there are config options:

./config \
--prefix=/usr \
--openssldir=/etc/ssl \
no-idea \
no-rc5 \
no-sse2 \
shared

I removed all those no-* and left only --prefix=/usr \ and --openssldir=/etc/ssl. Even than, removing config options shared, no-sse2, no-rc5 and no-idea, is not a reason to delete bunch of other libs. To my eye, the openssl.SlackBuild does not contain anything suspicious, at least not on the first sight. Something seems to be horribly wrong.

ventsyv 04-27-2012 05:03 PM

Quote:

Originally Posted by CMartin (Post 4664080)
I had to reinstall the system, and still did not fully recovered. Did anyone experience a problem with openssl compiled from slackware source, 13.37 ?

Compiled the openssl from slackware source, taken from this repository on Apr,25th:
ftp://ftp.slackware.com/pub/slackwar...rce/n/openssl/

Immediately after installing it I could no longer start bunch of programs, all complaining about totally unrelated missing libs. I lost boost libs, zlib, gtk, xaw3d, libxaw, utempter, libX11 and all its related libs, aaa_elflibs, libs from openssl, and many, many other...
I could boot the system after that, it would barely run, but hardly anything besides basic gnu programs, elvis, ftp, and slackpkg worked.

At first I thought it's my mistake. Probably as root I typed something unintentionally, and although the history did not show anything suspicious, I was still prone to blame myself.
I have almost recovered the system. Could run all basic programs and log into X again. Than I compiled and installed the openssl from slackware source one more time, not expecting the same disaster (I blamed myself for not careful typing). But I was wrong.

The disaster happened the second time. Immediately upon installation most of my libs were deleted again, for no apparent reason.
Why did I try to install the openssl from slackware source ? I needed idea algorithm, but that's not important. In openssl.SlackBuild there are config options:

./config \
--prefix=/usr \
--openssldir=/etc/ssl \
no-idea \
no-rc5 \
no-sse2 \
shared

I removed all those no-* and left only --prefix=/usr \ and --openssldir=/etc/ssl. Even than, removing config options shared, no-sse2, no-rc5 and no-idea, is not a reason to delete bunch of other libs. To my eye, the openssl.SlackBuild does not contain anything suspicious, at least not on the first sight. Something seems to be horribly wrong.

Sounds like your environment variables got screwed up. I very much doubt compiling deleted your files. Did you look at your enviornment variables ?

CMartin 04-27-2012 05:49 PM

Quote:

Originally Posted by ventsyv (Post 4664912)
Sounds like your environment variables got screwed up. I very much doubt compiling deleted your files. Did you look at your enviornment variables ?


Env variables are all right, in my .bashrc. While system wide - I didn't touch anything, it is Slackware as it comes out of the box. But we install packages as root of course. Many things I have installed from slackware source, and just slightly modified config options to match my preferences, but this is the first time that something bad happened. And it happened twice! with the same slackware source package.

Compiling the slackware source package did not do anything bad. Upon compilation things worked. Only after installpkg openssl and openssl-solibs the system was screwed.
Today I installed openssl in /usr/local, a generic installation ./config --prefix=/usr/local, make and make install, and that was it, no problems. Therefore, I suspect a bug in one of slackware package files.

smoooth103 04-27-2012 10:06 PM

I'd check other applications that you installed before openssl and see if they have modified your environmental variables.

CMartin 04-27-2012 11:13 PM

Quote:

Originally Posted by smoooth103 (Post 4665046)
I'd check other applications that you installed before openssl and see if they have modified your environmental variables.


/etc/profile is still the same one as of the first day of installation, nothing changed in it. Root's directory does not contain any bashrc or profile. I have built the offending package in /tmp as root, and installed as root.

Everything works well when I install precompiled openssl packages from Slackware. Everything works well with manually compiled openssl in /usr/local. And everything worked well when used SlackBuild scripts.

Why only this build package will remove gamin, among all other things ? Reinstalling packages for missing libs and other missing programs has helped. My $HOME bashrc is still the same as it was months ago. Checked. Although I don't see how those may affect anything since the compilation and the installation was by root, and out of my $HOME. But anyway nothing changed in my .bashrc.

So please, can you be a bit more precise, what exactly environmental variables you mean, and where ? And can you explain how those certain environmental variables can cause such a masive deletition. Thank you.

astrogeek 04-27-2012 11:53 PM

I tend to agree that the environment has been changed rather than massive file deletions - but will admit we could be wrong.

Just for a sanity check, could you post the manifest of the package that you built - the one that deletes files when it is installed. Maybe that would provide a good clue.

Also, we really have very little info on your system other than the version. Could you tell us a little about your partitioning and filesystem structure. Is is split across multiple partitions? Is a partition possibly full? What filesystem are you using? Is it possible the filesystem is corrupted?

smoooth103 04-28-2012 12:35 AM

There IS a lot going on in that slackbuild, especially with the library files. I'm not a shell script or .Slackbuild expert but my guess is there might be either a qwirky error in there or an issue/conflict with some environmental variables.

Someone might want to double check that slackbuild.

CMartin 04-28-2012 12:51 AM

Quote:

Originally Posted by astrogeek (Post 4665080)

Just for a sanity check, could you post the manifest of the package that you built - the one that deletes files when it is installed. Maybe that would provide a good clue.

What manifest ? Here is all what's written about the package I used: ftp://ftp.slackware.com/pub/slackwar...rce/n/openssl/
Quote:

Could you tell us a little about your partitioning and filesystem structure. Is is split across multiple partitions?
/ (ext3), /boot (ext2), /home (ext3), all primary, on one disk.
Quote:

Is a partition possibly full? Is it possible the filesystem is corrupted?
Plenty of space here, and nothing is corrupted. Also, please what environment variables may cause such a problem, and where they possibly are ? Before I have built and installed this darned openssl everything worked well.

astrogeek 04-28-2012 01:05 AM

Quote:

Originally Posted by CMartin (Post 4665098)
What manifest ?

What I meant was the list of what files it contains, like this:

tar -tvzf openssl-package-file.tgz

astrogeek 04-28-2012 01:15 AM

I just had a look at the Slackbuild script.

As with any shell script run as root, there are plenty of things that might go wrong if the file was buggared.

Could you post here the ACTUAL slackbuild that you are using to build with - NOT a fresh copy or one that is "the same" - the actual one that you used.

CMartin 04-28-2012 01:35 AM

Quote:

Originally Posted by astrogeek (Post 4665104)
What I meant was the list of what files it contains, like this:

tar -tvzf openssl-package-file.tgz


I didn't do it. Instead I removed both packages, openssl and openssl-solibs. And I am not touching it any more.

CMartin 04-28-2012 01:38 AM

Quote:

Originally Posted by astrogeek (Post 4665107)
I just had a look at the Slackbuild script.

As with any shell script run as root, there are plenty of things that might go wrong if the file was buggared.

Could you post here the ACTUAL slackbuild that you are using to build with - NOT a fresh copy or one that is "the same" - the actual one that you used.


Here it is, and also in a pastebin: http://pastebin.com/edySyYN3

Code:

#!/bin/sh

# Copyright 2000 BSDi, Inc. Concord, CA, USA
# Copyright 2001, 2002 Slackware Linux, Inc.  Concord, CA, USA
# Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


# Set initial variables:
CWD=$(pwd)
TMP=${TMP:-/tmp}

VERSION=${VERSION:-$(echo openssl-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-3}

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) export ARCH=i486 ;;
    arm*) export ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
      *) export ARCH=$( uname -m ) ;;
  esac
fi

PKG1=$TMP/package-openssl
PKG2=$TMP/package-ossllibs
NAME1=openssl-$VERSION-$ARCH-$BUILD
NAME2=openssl-solibs-$VERSION-$ARCH-$BUILD

NUMJOBS=${NUMJOBS:--j6}

# So that ls has the right field counts for parsing...
export LC_ALL=C

cd $TMP
rm -rf $PKG1 $PKG2 openssl-$VERSION
tar xvf $CWD/openssl-$VERSION.tar.?z* || exit 1
cd openssl-$VERSION

# Use .so.0, not .so.0.9.8:
zcat $CWD/openssl.soname.diff.gz | patch -p1 --backup --verbose --suffix=.orig || exit 1
if [ "$ARCH" = "i486" ]; then
  # Build with -march=i486 -mtune=i686:
  zcat $CWD/openssl.optsx86.diff.gz | patch -p1 --backup --verbose --suffix=.orig || exit 1
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  LIBDIRSUFFIX="64"
fi

# OpenSSL has a (nasty?) habit of bumping the internal version number with
# every release.  This wouldn't be so bad, but some applications are so
# paranoid that they won't run against a different OpenSSL version than
# what they were compiled against, whether or not the ABI has changed.
#
# So, we will use the OPENSSL_VERSION_NUMBER from openssl-0.9.8o unless ABI
# breakage forces it to change.  Yes, we're finally using this old trick.  :)
sed -i "s/#define OPENSSL_VERSION_NUMBER.*/\/* Use 0x009080efL (0.9.8o) below to avoid pointlessly breaking the ABI *\/\n#define OPENSSL_VERSION_NUMBER 0x009080efL/g" crypto/opensslv.h || exit 1

chown -R root:root .
mkdir -p $PKG1/usr/doc/openssl-$VERSION
cp -a CHANGES CHANGES.SSLeay FAQ INSTALL INSTALL.MacOS INSTALL.VMS INSTALL.W32 \
  LICENSE NEWS README README.ENGINE doc $PKG1/usr/doc/openssl-$VERSION
find $PKG1/usr/doc/openssl-$VERSION -type d -exec chmod 755 {} \;
find $PKG1/usr/doc/openssl-$VERSION -type f -exec chmod 644 {} \;

# If there's a CHANGES file, installing at least part of the recent history
# is useful, but don't let it get totally out of control:
if [ -r CHANGES ]; then
  DOCSDIR=$(echo $PKG1/usr/doc/*-$VERSION)
  cat CHANGES | head -n 2000 > $DOCSDIR/CHANGES
  touch -r CHANGES $DOCSDIR/CHANGES
fi

# These are the known patent issues with OpenSSL:
# name  #        expires
# MDC-2: 4,908,861  2007-03-13, included.  :-)
# IDEA:  5,214,703  2010-05-25, not included.
# RC5:  5,724,428  2015-03-03, not included.

./config \
 --prefix=/usr \
 --openssldir=/etc/ssl

make depend || exit 1

make $NUMJOBS || make || exit 1

make install INSTALL_PREFIX=$PKG1 || exit 1

# Use proper libdir:
( cd $PKG1/usr; mv lib lib${LIBDIRSUFFIX} )

# Make the .so.? library symlinks:
( cd $PKG1/usr/lib${LIBDIRSUFFIX} ; ldconfig -l lib*.so.* )

# Move libraries, as they might be needed by programs that bring a network
# mounted /usr online:

mkdir $PKG1/lib${LIBDIRSUFFIX}
( cd $PKG1/usr/lib${LIBDIRSUFFIX}
  for file in lib*.so.?.* ; do
    mv $file ../../lib${LIBDIRSUFFIX}
    ln -sf ../../lib${LIBDIRSUFFIX}/$file .
  done
  cp -a lib*.so.? ../../lib${LIBDIRSUFFIX}
)

# Add a cron script to warn root if a certificate is going to expire soon:
mkdir -p $PKG1/etc/cron.daily
zcat $CWD/certwatch.gz > $PKG1/etc/cron.daily/certwatch.new
chmod 755 $PKG1/etc/cron.daily/certwatch.new

mv $PKG1/etc/ssl/openssl.cnf $PKG1/etc/ssl/openssl.cnf.new

( cd $PKG1
  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)

mv $PKG1/etc/ssl/man $PKG1/usr
( cd $PKG1/usr/man/man1 ; mv passwd.1 ssl_passwd.1 )
( cd $PKG1/usr/man/man3 ; mv rand.3 ssl_rand.3 )
( cd $PKG1/usr/man/man3 ; mv err.3 ssl_err.3 )
# Compress and symlink the man pages:
if [ -d $PKG1/usr/man ]; then
  ( cd $PKG1/usr/man
    for manpagedir in $(find . -type d -name "man*") ; do
      ( cd $manpagedir
        for eachpage in $( find . -type l -maxdepth 1) ; do
          ln -s $( readlink $eachpage ).gz $eachpage.gz
          rm $eachpage
        done
        gzip -9 *.?
      )
    done
  )
fi

cd $PKG1
chmod 755 usr/lib${LIBDIRSUFFIX}/pkgconfig
sed -i -e "s#lib\$#lib${LIBDIRSUFFIX}#" usr/lib${LIBDIRSUFFIX}/pkgconfig/*.pc
mkdir -p install
zcat $CWD/doinst.sh-openssl.gz > install/doinst.sh
cat $CWD/slack-desc.openssl > install/slack-desc
/sbin/makepkg -l y -c n $TMP/${NAME1}.txz

# Make runtime package:
mkdir -p $PKG2/lib${LIBDIRSUFFIX}
( cd lib${LIBDIRSUFFIX} ; cp -a lib*.so.* $PKG2/lib${LIBDIRSUFFIX} )
( cd $PKG2/lib${LIBDIRSUFFIX} ; ldconfig -l * )
mkdir -p $PKG2/etc
( cd $PKG2/etc ; cp -a $PKG1/etc/ssl . )
mkdir -p $PKG2/usr/doc/openssl-$VERSION
( cd $TMP/openssl-$VERSION
  cp -a CHANGES CHANGES.SSLeay FAQ INSTALL INSTALL.MacOS INSTALL.VMS INSTALL.W32 \
  LICENSE NEWS README README.ENGINE $PKG2/usr/doc/openssl-$VERSION
)

# If there's a CHANGES file, installing at least part of the recent history
# is useful, but don't let it get totally out of control:
if [ -r CHANGES ]; then
  DOCSDIR=$(echo $PKG2/usr/doc/*-$VERSION)
  cat CHANGES | head -n 2000 > $DOCSDIR/CHANGES
  touch -r CHANGES $DOCSDIR/CHANGES
fi

find $PKG2/usr/doc/openssl-$VERSION -type d -exec chmod 755 {} \;
find $PKG2/usr/doc/openssl-$VERSION -type f -exec chmod 644 {} \;
cd $PKG2
mkdir -p install
zcat $CWD/doinst.sh-openssl-solibs.gz > install/doinst.sh
cat $CWD/slack-desc.openssl-solibs > install/slack-desc
/sbin/makepkg -l y -c n $TMP/${NAME2}.txz


astrogeek 04-28-2012 02:48 AM

You have also removed the 'shared' option from the config.

This will cause it to be built with ONLY static libs, and the previous shared libs will be removed when you uninstall/re-install.

That will break every other app that was built with openssl support - and probably result in MANY things not working with "missing library" messages.

You need to explicitly add shared and rebuild.

Quote:

Note on shared libraries
------------------------

For some systems, the OpenSSL Configure script knows what is needed to
build shared libraries for libcrypto and libssl. On these systems,
the shared libraries are currently not created by default, but giving
the option "shared" will get them created. This method supports Makefile
targets for shared library creation, like linux-shared. Those targets
can currently be used on their own just as well, but this is expected
to change in future versions of OpenSSL.
So change:

Code:

config \
 --prefix=/usr \
 --openssldir=/etc/ssl

to:

Code:

config \
 --prefix=/usr \
 --openssldir=/etc/ssl \
 shared

And I bet it all works again...

CMartin 12-13-2012 05:37 PM

Quote:

Originally Posted by astrogeek (Post 4665146)
You have also removed the 'shared' option from the config.

This will cause it to be built with ONLY static libs, and the previous shared libs will be removed when you uninstall/re-install.

That will break every other app that was built with openssl support - and probably result in MANY things not working with "missing library" messages.

You need to explicitly add shared and rebuild.



So change:

Code:

config \
 --prefix=/usr \
 --openssldir=/etc/ssl

to:

Code:

config \
 --prefix=/usr \
 --openssldir=/etc/ssl \
 shared

And I bet it all works again...



You were right. Strictly static didn't work. Must have shared. Thanks a bunch pal.


All times are GMT -5. The time now is 09:10 PM.