#!/bin/sh # # Copyright 1992,2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "@(#)preremove 1.7 03/06/10 SMI" # # remove the domestic libcrypt.a symlink and, if the # international version of the symlink is installed, restore it. sparc_preremove () { # remove the domestic link # if [ -h $BASEDIR/usr/lib/sparcv9/libcrypt.so ]; then rm -f $BASEDIR/usr/lib/sparcv9/libcrypt.so fi if [ -h $BASEDIR/usr/lib/sparcv9/libcrypt.so.1 ]; then rm -f $BASEDIR/usr/lib/sparcv9/libcrypt.so.1 fi # reinstall the international link if [ -h $BASEDIR/usr/lib/sparcv9/libcrypt_i.so ]; then ln -s libcrypt_i.so $BASEDIR/usr/lib/sparcv9/libcrypt.so || exit 2 fi if [ -f $BASEDIR/usr/lib/sparcv9/libcrypt_i.so.1 ]; then ln -s libcrypt_i.so.1 $BASEDIR/usr/lib/sparcv9/libcrypt.so.1 || exit 2 fi } # remove the link if it exists if [ -h $BASEDIR/usr/lib/libcrypt.a ]; then rm -f $BASEDIR/usr/lib/libcrypt.a fi if [ -h $BASEDIR/usr/lib/libcrypt.so ]; then rm -f $BASEDIR/usr/lib/libcrypt.so fi if [ -h $BASEDIR/usr/lib/libcrypt.so.1 ]; then rm -f $BASEDIR/usr/lib/libcrypt.so.1 fi # put the international links back if [ -f $BASEDIR/usr/lib/libcrypt_i.a ]; then ln -s libcrypt_i.a $BASEDIR/usr/lib/libcrypt.a || exit 2 fi if [ -s $BASEDIR/usr/lib/libcrypt_i.so ]; then ln -s libcrypt_i.so $BASEDIR/usr/lib/libcrypt.so || exit 2 fi if [ -f $BASEDIR/usr/lib/libcrypt_i.so.1 ]; then ln -s libcrypt_i.so.1 $BASEDIR/usr/lib/libcrypt.so.1 || exit 2 fi if [ "$ARCH" = "sparc" ]; then sparc_preremove; fi; # Undo the changes for SUNWcry pkcs11_softtoken # # This preremove script reactivates pkcs11_softtoken with the policy. # Because we want to do the policy cloning and only have one of the softtoken's # enabled we can't used the r.pkcs11conf class action script. # We can't run cryptoadm(1m) here because it might not be available. pkcs11conf=$BASEDIR/etc/crypto/pkcs11.conf if [ ! -r $pkcs11conf ]; then echo "/etc/crypto/pkcs11.conf not found, this may be an attempt to \c" echo "remove this package from an incorrect release of Solaris" exit 2 fi sed 's/pkcs11_softtoken_extra\.so/pkcs11_softtoken.so/' \ $pkcs11conf > ${pkcs11conf}.tmp mv -f ${pkcs11conf}.tmp $pkcs11conf exit 0