|
|
@ -1,6 +1,6 @@
|
|
|
|
#!/bin/bash
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
# Smart Card KDE3.5 Authentication Script (c) 2009 Timothy Pearson
|
|
|
|
# Smart Card KDE3.5 Authentication Script (c) 2010 Timothy Pearson
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
@ -136,6 +136,7 @@ while [[ 1 == 1 ]]; do
|
|
|
|
OUTPUT=$?
|
|
|
|
OUTPUT=$?
|
|
|
|
if [[ $OUTPUT -eq 0 ]]; then
|
|
|
|
if [[ $OUTPUT -eq 0 ]]; then
|
|
|
|
echo "Card inserted!"
|
|
|
|
echo "Card inserted!"
|
|
|
|
|
|
|
|
echo "TAuthenticating SmartCard..." > /tmp/ksocket-global/kdesktoplockcontrol &
|
|
|
|
|
|
|
|
|
|
|
|
# Get card ATR
|
|
|
|
# Get card ATR
|
|
|
|
echo "RESET" > $SECURE_DIRECTORY/query
|
|
|
|
echo "RESET" > $SECURE_DIRECTORY/query
|
|
|
@ -251,6 +252,7 @@ while [[ 1 == 1 ]]; do
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "This card does not recognize this system!"
|
|
|
|
echo "This card does not recognize this system!"
|
|
|
|
|
|
|
|
echo "EInvalid SmartCard Inserted" > /tmp/ksocket-global/kdesktoplockcontrol &
|
|
|
|
sleep 1
|
|
|
|
sleep 1
|
|
|
|
smartcard_username=""
|
|
|
|
smartcard_username=""
|
|
|
|
rm -f $SECURE_DIRECTORY/password
|
|
|
|
rm -f $SECURE_DIRECTORY/password
|
|
|
@ -375,6 +377,8 @@ while [[ 1 == 1 ]]; do
|
|
|
|
if [[ $lverify == $cverify ]]; then
|
|
|
|
if [[ $lverify == $cverify ]]; then
|
|
|
|
su $smartcard_username -c "export DISPLAY=$udisplay; /opt/kde3/bin/dcop kdesktop KScreensaverIface quit"
|
|
|
|
su $smartcard_username -c "export DISPLAY=$udisplay; /opt/kde3/bin/dcop kdesktop KScreensaverIface quit"
|
|
|
|
/opt/kde3/bin/kdmctl activate $udisplay
|
|
|
|
/opt/kde3/bin/kdmctl activate $udisplay
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
echo "EUnauthorized SmartCard Inserted" > /tmp/ksocket-global/kdesktoplockcontrol &
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "Username not specified"
|
|
|
|
echo "Username not specified"
|
|
|
@ -456,6 +460,7 @@ while [[ 1 == 1 ]]; do
|
|
|
|
|
|
|
|
|
|
|
|
#if [[ loginok -eq 1 ]]; then
|
|
|
|
#if [[ loginok -eq 1 ]]; then
|
|
|
|
# Wait for SmartCard removal
|
|
|
|
# Wait for SmartCard removal
|
|
|
|
|
|
|
|
echo "C" > /tmp/ksocket-global/kdesktoplockcontrol &
|
|
|
|
TIMER=60
|
|
|
|
TIMER=60
|
|
|
|
OUTPUT=0
|
|
|
|
OUTPUT=0
|
|
|
|
|
|
|
|
|
|
|
@ -604,5 +609,6 @@ while [[ 1 == 1 ]]; do
|
|
|
|
|
|
|
|
|
|
|
|
smartcard_username=""
|
|
|
|
smartcard_username=""
|
|
|
|
rm -rf /etc/smartmon/minutesremaining
|
|
|
|
rm -rf /etc/smartmon/minutesremaining
|
|
|
|
|
|
|
|
echo "C" > /tmp/ksocket-global/kdesktoplockcontrol &
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|