[Patch] Adding Certificate Check to cvs-import.sh

Andreas Thienemann andreas at bawue.net
Wed May 16 16:37:59 UTC 2007


Hi,

attached is a patch to cvs-import.sh which adds a check whether the ssl 
certificate is still valid.

This should be helpful preventing strange "cannot check module on 
upload.cgi" messages.


regards,
 andreas
-------------- next part --------------
--- cvs-import.sh.orig	2007-05-16 12:48:55.000000000 +0200
+++ cvs-import.sh	2007-05-16 18:36:13.000000000 +0200
@@ -22,6 +22,20 @@
     echo "       from https://admin.fedora.redhat.com/accounts/" >&2
     exit 1
 fi
+
+# Check that the ssl certificate is not already expired or expiring in the
+# next 10 minutes
+OPENSSL=$(which openssl 2>/dev/null)
+if [ -x ${OPENSSL} ]; then
+    ${OPENSSL} x509 -checkend 6000 -noout -in ${HOME}/.fedora.cert
+    if [ $? -ne 0 ]; then
+        echo "ERROR: Your Fedora client-side certificate expired." >&2
+        echo "       You need to download a new client-side certificate" >&2
+        echo "       from https://admin.fedora.redhat.com/accounts/" >&2
+        exit 1
+    fi
+fi
+
 # use the CVSROOT from the checkout
 CVSROOT=$(cat ${MYDIR}/CVS/Root)
 


More information about the Fedora-maintainers mailing list