⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 4758_startup.ksh

📁 IBM的Linux上的PKCS#11实现
💻 KSH
📖 第 1 页 / 共 2 页
字号:
#             lawsuit), then any patent licenses granted by that#             Contributor to such Recipient under this Agreement shall#             terminate as of the date such litigation is filed. In#             addition, If Recipient institutes patent litigation#             against any entity (including a cross-claim or#             counterclaim in a lawsuit) alleging that the Program#             itself (excluding combinations of the Program with other#             software or hardware) infringes such Recipient's#             patent(s), then such Recipient's rights granted under#             Section 2(b) shall terminate as of the date such#             litigation is filed.##             All Recipient's rights under this Agreement shall#             terminate if it fails to comply with any of the material#             terms or conditions of this Agreement and does not cure#             such failure in a reasonable period of time after becoming#             aware of such noncompliance. If all Recipient's rights#             under this Agreement terminate, Recipient agrees to cease#             use and distribution of the Program as soon as reasonably#             practicable. However, Recipient's obligations under this#             Agreement and any licenses granted by Recipient relating#             to the Program shall continue and survive. ##             Everyone is permitted to copy and distribute copies of#             this Agreement, but in order to avoid inconsistency the#             Agreement is copyrighted and may only be modified in the#             following manner. The Agreement Steward reserves the right#             to publish new versions (including revisions) of this#             Agreement from time to time. No one other than the#             Agreement Steward has the right to modify this Agreement.##             IBM is the initial Agreement Steward. IBM may assign the#             responsibility to serve as the Agreement Steward to a#             suitable separate entity. Each new version of the#             Agreement will be given a distinguishing version number.#             The Program (including Contributions) may always be#             distributed subject to the version of the Agreement under#             which it was received. In addition, after a new version of#             the Agreement is published, Contributor may elect to#             distribute the Program (including its Contributions) under#             the new version. Except as expressly stated in Sections#             2(a) and 2(b) above, Recipient receives no rights or#             licenses to the intellectual property of any Contributor#             under this Agreement, whether expressly, by implication,#             estoppel or otherwise. All rights in the Program not#             expressly granted under this Agreement are reserved.###             This Agreement is governed by the laws of the State of New#             York and the intellectual property laws of the United#             States of America. No party to this Agreement will bring a#             legal action under this Agreement more than one year after#             the cause of action arose. Each party waives its rights to#             a jury trial in any resulting litigation. ####*/##/* (C) COPYRIGHT International Business Machines Corp. 2001          */# Get the operating System....  Everything else falls into thatOS = `uname -s`# Get a list of crypto adapters and set error code to 0if [ $OS -eq "AIX" ]thenCARDS=`ODMDIR=/etc/objrepos /usr/sbin/lsdev -Cc adapter | /usr/bin/grep crypt | /usr/bin/cut -d " " -f1`ERRORS=0STATCOMMAND=/usr/lib/pkcs11/methods/4758_statusSTDLLDIR=/usr/lib/pkcs11/stdllMETHDIR=/usr/lib/pkcs11/methodsCONFDIR=/etc/pkcs11fiif [ $OS -eq "Linux" ]thenCARDS=`ls /dev/crypt* | sed s?\/dev\/??g`ERRORS=0STATCOMMAND=/usr/lib/pkcs11/methods/4758_statusSTDLLDIR=/usr/lib/pkcs11/stdllMETHDIR=/usr/lib/pkcs11/methodsCONFDIR=/etc/pkcs11CONFFILE=pk_config_datarm $CONFDIR/$CONFFILEfi# For each card run the status command and if successful# create the odm stanza for the fileif [ $OS -eq "AIX" ]thenif [ -x $STATCOMMAND ]thenfor i in $CARDSdo   $METHDIR/4758_status -c $i   RC=$?   if [ $RC -lt 100 ]   then      ERRORS=1      MINOR=`echo $i | cut -f 2 -d "t"`      ODMDIR=$CONFDIR/ /usr/bin/odmdelete -o ck_slot -q "Correlator = $MINOR"> /dev/null 2>&1   elif [ $RC = 101 ]     then       $METHDIR/leeds_slot $i deep   elif [ $RC = 102 ]     then       /usr/sbin/lsgroup pkcs11 > /dev/null 2>&1       if [ $? -ne 0 ]         then	   /usr/bin/mkgroup pkcs11       fi       $METHDIR/leeds_slot $i shallow   else      exit -2   fidonefielse echo "Don't do deep for linux yet"for i in $CARDSdo    $METHDIR/4758_status -c $i    RC=$?    if [ $RC = 101 ]    then	$METHDIR/leeds_slot $i deep    elif [ $RC = 102 ]    then	# SAB XXX Need to get the groups created elsewhere	# actually we should build the correlator list here	# and pass the list in all at once	if [ $CORRLIST ]	then	    CORRLIST="${i}"	else	    CORRLIST="${CORRLIST},${i}"	fi	$METHDIR/leeds_slot $i shallow    fidonefi  # AIX only for nowif [ $OS -eq "Linux" ]then    $METHDIR/leeds_slot  $CORRLIST shallowfi# SAB Now add the Soft token if it exists#  For this we will always delete the SW tok from ODM and then# add it if the file exists....# SAB We need to delete the SW tok from the config file here XXXif [ $OS -eq "AIX" ]then	   ODMDIR=$CONFDIR /usr/bin/odmdelete -o ck_slot -q "SlotDll = $STDLLDIR/PKCS11_SW.so" >/dev/null 2>&1elif [ $OS -eq "Linux" ]then	# actually we don't need to do this since we regen the whole	# file	# remove the entry XXX FIXMEfi	if [[ -f $STDLLDIR/PKCS11_SW.so ]]then    $METHDIR/leeds_slot 0  softfiif [[ -f $STDLLDIR/PKCS11_ICA.so ]]then    $METHDIR/leeds_slot 0  icafiif [ $OS -eq "AIX" ]then# go through the slot database and remove entries for which there is no adapterDEEP_SLOTS=`ODMDIR=$CONFDIR/ /usr/bin/odmget -q "SlotDll = $STDLLDIR/PKCS11_4758.so" ck_slot | grep Correlator | cut -f 3 -d " " | cut -f 2 -d "\""`for J in $DEEP_SLOTSdo   test -e "/dev/crypt$J"   if [ $? -ne 0 ]   then      ODMDIR=$CONFDIR/ /usr/bin/odmdelete -o ck_slot -q "Correlator = $J"> /dev/null 2>&1   fidoneSHALLOW_COR=`ODMDIR=$CONFDIR/ /usr/bin/odmget -q "SlotDll = $STDLLDIR/PKCS11_LW.so" ck_slot | grep Correlator | cut -f 3 -d " " | cut -f 2 -d "\""`SHALLOW_SLOTS=`echo $SHALLOW_COR | tr "," " "`for K in $SHALLOW_SLOTSdo   test -e "/dev/crypt$K"   if [ $? -ne 0 ]   then      SHALLOW_NUM=`echo $SHALLOW_SLOTS | wc -w | awk '{ print $1 }'`      # see if we are deleting the only one      if [ $SHALLOW_NUM = 1 ]      then      # if so delete the stanza, otherwise use the odmchange command        ODMDIR=$CONFDIR/ /usr/bin/odmdelete -o ck_slot -q "Correlator = $K"> /dev/null 2>&1      else      # there are more than one adapters only delete the corrlator for k        # first delete the number and the preceding comma if present	SHALLOW_COR=`echo $SHALLOW_COR | sed -e "s/,*$K//"`	# the above command will cover all but the case where the deleted	# element was first in the list.  If it was we now have a comma	# at the beginning, if a comma start the line--delete it.	SHALLOW_COR=`echo $SHALLOW_COR | sed -e "s/^,//"`	# replace the current Correlator with the new one, since there is	# only one LW entry this search will work fine.	echo ck_slot: Correlator = \"$SHALLOW_COR\" | ODMDIR=$CONFDIR /usr/bin/odmchange -o ck_slot -q "SlotDll = $STDLLDIR/PKCS11_LW.so"      fi   fidonefi  # AIX only# If any errors were encountered return -1 otherwise# return 0if [ $ERRORS -ne 0 ]then  exit -1fiexit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -