Blame SOURCES/0002-library-return-error-if-no-matching-key-was-found.patch

48b328
From 4987a21f4839ab7ea50e932c72df05075efb89b3 Mon Sep 17 00:00:00 2001
48b328
From: Sumit Bose <sbose@redhat.com>
48b328
Date: Thu, 21 Mar 2019 15:05:33 +0100
48b328
Subject: [PATCH 2/2] library: return error if no matching key was found
48b328
48b328
To avoid a misleading debug message indicating success a proper erro
48b328
code should be returned the no matching key was found when trying to
48b328
copy an keytab entry for a new principal.
48b328
48b328
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1644311
48b328
---
48b328
 library/adkrb5.c | 5 ++---
48b328
 1 file changed, 2 insertions(+), 3 deletions(-)
48b328
48b328
diff --git a/library/adkrb5.c b/library/adkrb5.c
48b328
index 033c181..7f77373 100644
48b328
--- a/library/adkrb5.c
48b328
+++ b/library/adkrb5.c
48b328
@@ -298,11 +298,10 @@ _adcli_krb5_keytab_copy_entries (krb5_context k5,
48b328
 
48b328
 		code = _adcli_krb5_get_keyblock (k5, keytab, &entry.key,
48b328
 		                                 match_enctype_and_kvno, &closure);
48b328
-		if (code != 0) {
48b328
-			return code;
48b328
+		if (code != 0 || closure.matched == 0) {
48b328
+			return code != 0 ? code : ENOKEY;
48b328
 		}
48b328
 
48b328
-
48b328
 		entry.principal = principal;
48b328
 		entry.vno = kvno;
48b328
 
48b328
-- 
48b328
2.20.1
48b328