summaryrefslogtreecommitdiff
path: root/usr/src/cmd/cmd-crypto/scripts/r.kmfconf
diff options
context:
space:
mode:
authorhylee <none@none>2007-12-06 15:56:13 -0800
committerhylee <none@none>2007-12-06 15:56:13 -0800
commit431deaa01ac039d796fdfaf86b909a75e7d9ac48 (patch)
tree0d4bb232b811d43a31fcb0d6149d0624c643e3f4 /usr/src/cmd/cmd-crypto/scripts/r.kmfconf
parentc73e9863820a560b7fbb4fb258aa450a88315a39 (diff)
downloadillumos-joyent-431deaa01ac039d796fdfaf86b909a75e7d9ac48.tar.gz
PSARC 2007/604 KMF Pluggability Enhancements
6621224 KMF Dynamic Plugin Support 6621231 pktool list keystore=file dir=/tmp/test prints out incorrect output
Diffstat (limited to 'usr/src/cmd/cmd-crypto/scripts/r.kmfconf')
-rw-r--r--usr/src/cmd/cmd-crypto/scripts/r.kmfconf81
1 files changed, 81 insertions, 0 deletions
diff --git a/usr/src/cmd/cmd-crypto/scripts/r.kmfconf b/usr/src/cmd/cmd-crypto/scripts/r.kmfconf
new file mode 100644
index 0000000000..8c35957f76
--- /dev/null
+++ b/usr/src/cmd/cmd-crypto/scripts/r.kmfconf
@@ -0,0 +1,81 @@
+#
+# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# ident "%Z%%M% %I% %E% SMI"
+#
+# Removal class action script for "kmfconf" class files.
+#
+# This script removes entries belonging to the package from the
+# /etc/crypto/kmf.conf file.
+#
+
+pkg_start="# Start $PKGINST"
+pkg_end="# End $PKGINST"
+tmpfile=/tmp/$$kmfconf
+error=no
+
+while read dest
+do
+ # For multiple input files; exit if error occurred in preious
+ # input file.
+ if [ "$error" = yes ]
+ then
+ echo "$0: failed to update $lastdest for $PKGINST."
+ exit 2
+ fi
+ lastdest=$dest
+
+ # Strip all entries belonging to this package
+ start=0
+ end=0
+ egrep -s "$pkg_start" $dest && start=1
+ egrep -s "$pkg_end" $dest && end=1
+
+ if [ $start -ne $end ] ; then
+ echo "$0: missing Start or End delimiters for $PKGINST in \
+ $dest."
+ echo "$0: $dest may be corrupted and was not updated."
+ error=yes
+ continue
+ fi
+
+ if [ $start -eq 1 ]
+ then
+ sed -e "/$pkg_start/,/$pkg_end/d" $dest > $tmpfile || error=yes
+ if [ "$error" = no ]
+ then
+ mv $tmpfile $dest || error=yes
+ fi
+ rm -f $tmpfile
+ else
+ echo "$0: WARNING - no entries found in $dest for $PKGINST."
+ exit 0
+ fi
+done
+
+if [ "$error" = yes ]
+then
+ echo "$0: ERROR - failed to update $lastdest for $PKGINST."
+ exit 2
+fi
+exit 0