From edd1b63a43076ea9b5f84dc18343708dc580858c Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 25 Mar 2010 12:05:56 +0000 Subject: [PATCH] fix 2970800 be able to run setup-local-client.sh twice without credential being invalid, added cleanup of old credentials git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5579 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/scripts/setup-local-client.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/setup-local-client.sh b/xCAT-server/share/xcat/scripts/setup-local-client.sh index cf6afda21..098a698d5 100755 --- a/xCAT-server/share/xcat/scripts/setup-local-client.sh +++ b/xCAT-server/share/xcat/scripts/setup-local-client.sh @@ -18,7 +18,7 @@ fi if [ -z "$1" ]; then set `whoami` fi -# if diretory is not supplied then just use home +# if directory is not supplied then just use home if [ -z "$2" ]; then CNA="$*" # getent doesn't exist on AIX @@ -43,6 +43,13 @@ if [ -e $USERHOME/.xcat ]; then fi rm -rf $USERHOME/.xcat fi +# remove user from index +echo $CNA +index=`grep $CNA /etc/xcat/ca/index | cut -f4 2>&1` +echo $index +for id in $index; do + openssl ca -config /etc/xcat/ca/openssl.cnf -revoke /etc/xcat/ca/certs/$id.pem +done mkdir -p $USERHOME/.xcat cd $USERHOME/.xcat openssl genrsa -out client-key.pem 2048 @@ -70,4 +77,3 @@ find $USERHOME/.xcat -type d -exec chmod 700 {} \; chmod 644 $USERHOME/.xcat/ca.pem chmod 755 $USERHOME/.xcat cd - -