From e46fffe26bbcd9ba7dbca477e689e26bdc22854f Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Thu, 26 Mar 2020 17:30:41 +0100 Subject: [PATCH] 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 --- builder/kojid | 2 +- util/kojira | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/builder/kojid b/builder/kojid index 847d93bf..6872b08a 100755 --- a/builder/kojid +++ b/builder/kojid @@ -6527,7 +6527,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 4b99f122..26d3cbda 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)