File 0021-Do-not-depend-on-default_realm-in-krb5.conf.patch of Package adcli.22052

From 058f1d18d0ce47c3bbfa090a3da03e5bdb111276 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@redhat.com>
Date: Mon, 13 Aug 2018 18:24:58 +0200
Subject: [PATCH 21/25] Do not depend on default_realm in krb5.conf

---
 library/adenroll.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/library/adenroll.c b/library/adenroll.c
index f942ea2..d23870a 100644
--- a/library/adenroll.c
+++ b/library/adenroll.c
@@ -1656,7 +1656,9 @@ remove_principal_from_keytab (adcli_enroll *enroll,
 	krb5_principal principal;
 	match_principal_kvno closure;
 
-	code = krb5_parse_name (k5, principal_name, &principal);
+	code = _adcli_krb5_build_principal (k5, principal_name,
+	                                    adcli_conn_get_domain_realm (enroll->conn),
+	                                    &principal);
 	if (code != 0) {
 		_adcli_err ("Couldn't parse principal: %s: %s",
 		            principal_name, krb5_get_error_message (k5, code));
-- 
2.16.4

openSUSE Build Service is sponsored by