postinstall revision b6c3f7863936abeae522e48a13887dddeb691a45
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass#
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# CDDL HEADER START
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass#
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# The contents of this file are subject to the terms of the
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# Common Development and Distribution License, Version 1.0 only
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# (the "License"). You may not use this file except in compliance
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# with the License.
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass#
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# or http://www.opensolaris.org/os/licensing.
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# See the License for the specific language governing permissions
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# and limitations under the License.
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass#
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# When distributing Covered Code, include this CDDL HEADER in each
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# If applicable, add the following below this CDDL HEADER, with the
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# fields enclosed by brackets "[]" replaced with your own identifying
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# information: Portions Copyright [yyyy] [name of copyright owner]
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass#
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# CDDL HEADER END
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass#
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass#
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# Use is subject to license terms.
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass#
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# ident "%Z%%M% %I% %E% SMI"
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# "Clone" the policy for pkcs11_softtoken to the encryption kit version
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# and "disable" pkcs11_softoken. This is reversed in the preremove script.
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass#
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# Because we want to do the policy cloning and only have one of the softtoken's
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# enabled we can't used the i.pkcs11conf class action script.
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass# We can't run cryptoadm(1m) here because it might not be available yet.
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glasspkcs11conf=$BASEDIR/etc/crypto/pkcs11.conf
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glassif [ ! -r $pkcs11conf ]; then
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass echo "/etc/crypto/pkcs11.conf not found, this may be an attempt to \c"
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass echo "install this package on an incorrect release of Solaris"
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass exit 2
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glassfi
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glasscp $pkcs11conf ${pkcs11conf}.tmp
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glasssed 's/pkcs11_softtoken\.so/pkcs11_softtoken_extra.so/' \
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass $pkcs11conf > ${pkcs11conf}.tmp
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glassmv -f ${pkcs11conf}.tmp $pkcs11conf
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glassexit 0
3f2ac16886fbbccf85547608b11143a8795d8db4Dav Glass