tools: rename S_ORG to C_ORG in virt-pki-validate

Rename a variable to make it clear that it holds the client organization
rather than the server organization.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2018-12-11 14:58:43 +00:00
parent ecf8619430
commit 34eca98522

View File

@ -201,12 +201,12 @@ then
echo Client certificate $LIBVIRT/clientcert.pem should be world readable echo Client certificate $LIBVIRT/clientcert.pem should be world readable
echo "as root do: chown root:root $LIBVIRT/clientcert.pem ; chmod 644 $LIBVIRT/clientcert.pem" echo "as root do: chown root:root $LIBVIRT/clientcert.pem ; chmod 644 $LIBVIRT/clientcert.pem"
else else
S_ORG=`"$CERTOOL" -i --infile "$LIBVIRT/clientcert.pem" | grep Subject: | sed 's+.*O=\([^,]*\).*+\1+'` C_ORG=`"$CERTOOL" -i --infile "$LIBVIRT/clientcert.pem" | grep Subject: | sed 's+.*O=\([^,]*\).*+\1+'`
if [ "$ORG" != "$S_ORG" ] if [ "$ORG" != "$C_ORG" ]
then then
echo The CA certificate and the client certificate do not match echo The CA certificate and the client certificate do not match
echo CA organization: $ORG echo CA organization: $ORG
echo Client organization: $S_ORG echo Client organization: $C_ORG
fi fi
CLIENT=`"$CERTOOL" -i --infile "$LIBVIRT/clientcert.pem" | grep Subject: | sed 's+.*CN=\(.[^,]*\).*+\1+'` CLIENT=`"$CERTOOL" -i --infile "$LIBVIRT/clientcert.pem" | grep Subject: | sed 's+.*CN=\(.[^,]*\).*+\1+'`
echo Found client certificate $LIBVIRT/clientcert.pem for $CLIENT echo Found client certificate $LIBVIRT/clientcert.pem for $CLIENT