From a752fa31235b98db7d2a2a27f0ce3406d4faf213 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Mar 26 2020 16:30:41 +0000 Subject: kojira: Allow using Kerberos without krbV "Error: Unknown login error" message is very misleading because no authentication is being performed when krbV is not installed. Quit with error message if no authentication has been performed and also update such error message in kojid to mentioned cert auth. Signed-off-by: Igor Raits --- diff --git a/builder/kojid b/builder/kojid index 82114a2..14cfafe 100755 --- a/builder/kojid +++ b/builder/kojid @@ -6526,7 +6526,7 @@ if __name__ == "__main__": except socket.error as e: quit("Could not connect to Kerberos authentication service: '%s'" % e.args[1]) else: - quit("No username/password supplied and Kerberos missing or not configured") + quit("No username/password/certificate supplied and Kerberos missing or not configured") # make session exclusive try: session.exclusiveSession(force=options.force_lock) diff --git a/util/kojira b/util/kojira index 4b99f12..26d3cbd 100755 --- a/util/kojira +++ b/util/kojira @@ -1031,8 +1031,10 @@ if __name__ == "__main__": elif options.user: # authenticate using user/password session.login() - elif koji.krbV and options.principal and options.keytab: + elif (koji.krbV or koji.requests_kerberos) and options.principal and options.keytab: session.krb_login(options.principal, options.keytab, options.ccache) + else: + quit("No username/password/certificate supplied and Kerberos missing or not configured") # get an exclusive session try: session.exclusiveSession(force=options.force_lock)