Fix condition in pkcsGetTokenSlot

This commit is contained in:
Karel Srot 2024-10-21 17:10:53 +02:00
commit 6d5950e860

View file

@ -117,7 +117,7 @@ pkcsGetTokenSlot() {
local CONF=/etc/opencryptoki/opencryptoki.conf
local SLOT
[ -z "$TYPE" ] && echo "Error: pkcsGetTokenSlot: no token type specified" && return 1
if grep -q "^stdll = libpkcs11_$TYPE.so" $CONF; then
if grep -q "stdll = libpkcs11_$TYPE.so" $CONF; then
SLOT=$( egrep "(^slot|stdll = libpkcs11_$TYPE.so)" $CONF | grep -B 1 "libpkcs11" | sed -n -e '1,1 s/slot //' -e '1,1 p' )
echo $SLOT
else