fd8ca2
From a32bef9d1193e2bc253b7af8f4d0adb6476937f5 Mon Sep 17 00:00:00 2001
fd8ca2
From: Samuel Cabrero <scabrero@suse.de>
fd8ca2
Date: Tue, 22 Feb 2022 12:59:44 +0100
fd8ca2
Subject: [PATCH 1/6] s3:libads: Fix memory leak in kerberos_return_pac() error
fd8ca2
 path
fd8ca2
fd8ca2
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
fd8ca2
Reviewed-by: Stefan Metzmacher <metze@samba.org>
fd8ca2
Reviewed-by: Andreas Schneider <asn@samba.org>
fd8ca2
(cherry picked from commit 3dbcd20de98cd28683a9c248368e5082b6388111)
fd8ca2
---
fd8ca2
 source3/libads/authdata.c | 11 ++++++++---
fd8ca2
 1 file changed, 8 insertions(+), 3 deletions(-)
fd8ca2
fd8ca2
diff --git a/source3/libads/authdata.c b/source3/libads/authdata.c
fd8ca2
index dd21d895fc2..c048510d480 100644
fd8ca2
--- a/source3/libads/authdata.c
fd8ca2
+++ b/source3/libads/authdata.c
fd8ca2
@@ -61,7 +61,10 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
fd8ca2
 {
fd8ca2
 	krb5_error_code ret;
fd8ca2
 	NTSTATUS status = NT_STATUS_INVALID_PARAMETER;
fd8ca2
-	DATA_BLOB tkt, tkt_wrapped, ap_rep, sesskey1;
fd8ca2
+	DATA_BLOB tkt = data_blob_null;
fd8ca2
+	DATA_BLOB tkt_wrapped = data_blob_null;
fd8ca2
+	DATA_BLOB ap_rep = data_blob_null;
fd8ca2
+	DATA_BLOB sesskey1 = data_blob_null;
fd8ca2
 	const char *auth_princ = NULL;
fd8ca2
 	const char *cc = "MEMORY:kerberos_return_pac";
fd8ca2
 	struct auth_session_info *session_info;
fd8ca2
@@ -81,7 +84,8 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
fd8ca2
 	ZERO_STRUCT(sesskey1);
fd8ca2
 
fd8ca2
 	if (!name || !pass) {
fd8ca2
-		return NT_STATUS_INVALID_PARAMETER;
fd8ca2
+		status = NT_STATUS_INVALID_PARAMETER;
fd8ca2
+		goto out;
fd8ca2
 	}
fd8ca2
 
fd8ca2
 	if (cache_name) {
fd8ca2
@@ -131,7 +135,8 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
fd8ca2
 
fd8ca2
 	if (expire_time && renew_till_time &&
fd8ca2
 	    (*expire_time == 0) && (*renew_till_time == 0)) {
fd8ca2
-		return NT_STATUS_INVALID_LOGON_TYPE;
fd8ca2
+		status = NT_STATUS_INVALID_LOGON_TYPE;
fd8ca2
+		goto out;
fd8ca2
 	}
fd8ca2
 
fd8ca2
 	ret = ads_krb5_cli_get_ticket(mem_ctx,
fd8ca2
-- 
fd8ca2
2.35.1
fd8ca2
fd8ca2
fd8ca2
From d5a800beb60ee0b9310fa073c2e06a7dcbe65d5e Mon Sep 17 00:00:00 2001
fd8ca2
From: Samuel Cabrero <scabrero@suse.de>
fd8ca2
Date: Tue, 22 Feb 2022 13:00:05 +0100
fd8ca2
Subject: [PATCH 2/6] lib:krb5_wrap: Improve debug message and use newer debug
fd8ca2
 macro
fd8ca2
fd8ca2
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
fd8ca2
Reviewed-by: Stefan Metzmacher <metze@samba.org>
fd8ca2
Reviewed-by: Andreas Schneider <asn@samba.org>
fd8ca2
(cherry picked from commit ed14513be055cc56eb39785323df2c538a813865)
fd8ca2
---
fd8ca2
 lib/krb5_wrap/krb5_samba.c | 2 +-
fd8ca2
 1 file changed, 1 insertion(+), 1 deletion(-)
fd8ca2
fd8ca2
diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c
fd8ca2
index fff5b4e2a22..42d4b950f80 100644
fd8ca2
--- a/lib/krb5_wrap/krb5_samba.c
fd8ca2
+++ b/lib/krb5_wrap/krb5_samba.c
fd8ca2
@@ -1079,7 +1079,7 @@ krb5_error_code smb_krb5_renew_ticket(const char *ccache_string,
fd8ca2
 		goto done;
fd8ca2
 	}
fd8ca2
 
fd8ca2
-	DEBUG(10,("smb_krb5_renew_ticket: using %s as ccache\n", ccache_string));
fd8ca2
+	DBG_DEBUG("Using %s as ccache for '%s'\n", ccache_string, client_string);
fd8ca2
 
fd8ca2
 	/* FIXME: we should not fall back to defaults */
fd8ca2
 	ret = krb5_cc_resolve(context, discard_const_p(char, ccache_string), &ccache);
fd8ca2
-- 
fd8ca2
2.35.1
fd8ca2
fd8ca2
fd8ca2
From 79d08465f66df67b69fdafed8eec48290acf24b9 Mon Sep 17 00:00:00 2001
fd8ca2
From: Samuel Cabrero <scabrero@suse.de>
fd8ca2
Date: Tue, 22 Feb 2022 14:28:28 +0100
fd8ca2
Subject: [PATCH 3/6] lib:krb5_wrap: Fix wrong debug message and use newer
fd8ca2
 debug macro
fd8ca2
fd8ca2
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
fd8ca2
Reviewed-by: Stefan Metzmacher <metze@samba.org>
fd8ca2
Reviewed-by: Andreas Schneider <asn@samba.org>
fd8ca2
(cherry picked from commit 1b5b4107a5081f15ba215f3025056d509fcfcf2a)
fd8ca2
---
fd8ca2
 lib/krb5_wrap/krb5_samba.c | 5 ++++-
fd8ca2
 1 file changed, 4 insertions(+), 1 deletion(-)
fd8ca2
fd8ca2
diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c
fd8ca2
index 42d4b950f80..76c2dcd2126 100644
fd8ca2
--- a/lib/krb5_wrap/krb5_samba.c
fd8ca2
+++ b/lib/krb5_wrap/krb5_samba.c
fd8ca2
@@ -1101,7 +1101,10 @@ krb5_error_code smb_krb5_renew_ticket(const char *ccache_string,
fd8ca2
 
fd8ca2
 	ret = krb5_get_renewed_creds(context, &creds, client, ccache, discard_const_p(char, service_string));
fd8ca2
 	if (ret) {
fd8ca2
-		DEBUG(10,("smb_krb5_renew_ticket: krb5_get_kdc_cred failed: %s\n", error_message(ret)));
fd8ca2
+		DBG_DEBUG("krb5_get_renewed_creds using ccache '%s' "
fd8ca2
+			  "for client '%s' and service '%s' failed: %s\n",
fd8ca2
+			  ccache_string, client_string, service_string,
fd8ca2
+			  error_message(ret));
fd8ca2
 		goto done;
fd8ca2
 	}
fd8ca2
 
fd8ca2
-- 
fd8ca2
2.35.1
fd8ca2
fd8ca2
fd8ca2
From 00418e5b78fa4361c0386c13374154d310426f77 Mon Sep 17 00:00:00 2001
fd8ca2
From: Samuel Cabrero <scabrero@suse.de>
fd8ca2
Date: Tue, 22 Feb 2022 13:08:56 +0100
fd8ca2
Subject: [PATCH 4/6] s3:libads: Return canonical principal and realm from
fd8ca2
 kerberos_return_pac()
fd8ca2
fd8ca2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14979
fd8ca2
fd8ca2
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
fd8ca2
Reviewed-by: Stefan Metzmacher <metze@samba.org>
fd8ca2
Reviewed-by: Andreas Schneider <asn@samba.org>
fd8ca2
(cherry picked from commit 00b1f44a7e8f66976757535bcbc6bea97fb1c29f)
fd8ca2
---
fd8ca2
 source3/libads/authdata.c       | 22 +++++++++++++++++++++-
fd8ca2
 source3/libads/kerberos_proto.h |  2 ++
fd8ca2
 source3/utils/net_ads.c         |  2 ++
fd8ca2
 source3/winbindd/winbindd_pam.c |  2 ++
fd8ca2
 4 files changed, 27 insertions(+), 1 deletion(-)
fd8ca2
fd8ca2
diff --git a/source3/libads/authdata.c b/source3/libads/authdata.c
fd8ca2
index c048510d480..bf9a2335445 100644
fd8ca2
--- a/source3/libads/authdata.c
fd8ca2
+++ b/source3/libads/authdata.c
fd8ca2
@@ -57,6 +57,8 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
fd8ca2
 			     time_t renewable_time,
fd8ca2
 			     const char *impersonate_princ_s,
fd8ca2
 			     const char *local_service,
fd8ca2
+			     char **_canon_principal,
fd8ca2
+			     char **_canon_realm,
fd8ca2
 			     struct PAC_DATA_CTR **_pac_data_ctr)
fd8ca2
 {
fd8ca2
 	krb5_error_code ret;
fd8ca2
@@ -75,6 +77,8 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
fd8ca2
 	struct auth4_context *auth_context;
fd8ca2
 	struct loadparm_context *lp_ctx;
fd8ca2
 	struct PAC_DATA_CTR *pac_data_ctr = NULL;
fd8ca2
+	char *canon_principal = NULL;
fd8ca2
+	char *canon_realm = NULL;
fd8ca2
 
fd8ca2
 	TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
fd8ca2
 	NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
fd8ca2
@@ -88,6 +92,14 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
fd8ca2
 		goto out;
fd8ca2
 	}
fd8ca2
 
fd8ca2
+	if (_canon_principal != NULL) {
fd8ca2
+		*_canon_principal = NULL;
fd8ca2
+	}
fd8ca2
+
fd8ca2
+	if (_canon_realm != NULL) {
fd8ca2
+		*_canon_realm = NULL;
fd8ca2
+	}
fd8ca2
+
fd8ca2
 	if (cache_name) {
fd8ca2
 		cc = cache_name;
fd8ca2
 	}
fd8ca2
@@ -109,7 +121,9 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
fd8ca2
 					  request_pac,
fd8ca2
 					  add_netbios_addr,
fd8ca2
 					  renewable_time,
fd8ca2
-					  NULL, NULL, NULL,
fd8ca2
+					  tmp_ctx,
fd8ca2
+					  &canon_principal,
fd8ca2
+					  &canon_realm,
fd8ca2
 					  &status);
fd8ca2
 	if (ret) {
fd8ca2
 		DEBUG(1,("kinit failed for '%s' with: %s (%d)\n",
fd8ca2
@@ -243,6 +257,12 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
fd8ca2
 	}
fd8ca2
 
fd8ca2
 	*_pac_data_ctr = talloc_move(mem_ctx, &pac_data_ctr);
fd8ca2
+	if (_canon_principal != NULL) {
fd8ca2
+		*_canon_principal = talloc_move(mem_ctx, &canon_principal);
fd8ca2
+	}
fd8ca2
+	if (_canon_realm != NULL) {
fd8ca2
+		*_canon_realm = talloc_move(mem_ctx, &canon_realm);
fd8ca2
+	}
fd8ca2
 
fd8ca2
 out:
fd8ca2
 	talloc_free(tmp_ctx);
fd8ca2
diff --git a/source3/libads/kerberos_proto.h b/source3/libads/kerberos_proto.h
fd8ca2
index 3d7b5bc074b..807381248c8 100644
fd8ca2
--- a/source3/libads/kerberos_proto.h
fd8ca2
+++ b/source3/libads/kerberos_proto.h
fd8ca2
@@ -78,6 +78,8 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
fd8ca2
 			     time_t renewable_time,
fd8ca2
 			     const char *impersonate_princ_s,
fd8ca2
 			     const char *local_service,
fd8ca2
+			     char **_canon_principal,
fd8ca2
+			     char **_canon_realm,
fd8ca2
 			     struct PAC_DATA_CTR **pac_data_ctr);
fd8ca2
 
fd8ca2
 /* The following definitions come from libads/krb5_setpw.c  */
fd8ca2
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
fd8ca2
index 8f993f9ba4c..c41fb0afe9c 100644
fd8ca2
--- a/source3/utils/net_ads.c
fd8ca2
+++ b/source3/utils/net_ads.c
fd8ca2
@@ -3273,6 +3273,8 @@ static int net_ads_kerberos_pac_common(struct net_context *c, int argc, const ch
fd8ca2
 				     2592000, /* one month */
fd8ca2
 				     impersonate_princ_s,
fd8ca2
 				     local_service,
fd8ca2
+				     NULL,
fd8ca2
+				     NULL,
fd8ca2
 				     pac_data_ctr);
fd8ca2
 	if (!NT_STATUS_IS_OK(status)) {
fd8ca2
 		d_printf(_("failed to query kerberos PAC: %s\n"),
fd8ca2
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
fd8ca2
index 7606bfb4ecd..025a5cbc111 100644
fd8ca2
--- a/source3/winbindd/winbindd_pam.c
fd8ca2
+++ b/source3/winbindd/winbindd_pam.c
fd8ca2
@@ -789,6 +789,8 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
fd8ca2
 				     WINBINDD_PAM_AUTH_KRB5_RENEW_TIME,
fd8ca2
 				     NULL,
fd8ca2
 				     local_service,
fd8ca2
+				     NULL,
fd8ca2
+				     NULL,
fd8ca2
 				     &pac_data_ctr);
fd8ca2
 	if (user_ccache_file != NULL) {
fd8ca2
 		gain_root_privilege();
fd8ca2
-- 
fd8ca2
2.35.1
fd8ca2
fd8ca2
fd8ca2
From d754753ab8edf6dde241d91442fe6afba8993de5 Mon Sep 17 00:00:00 2001
fd8ca2
From: Samuel Cabrero <scabrero@suse.de>
fd8ca2
Date: Tue, 22 Feb 2022 13:19:02 +0100
fd8ca2
Subject: [PATCH 5/6] s3:winbind: Store canonical principal and realm in ccache
fd8ca2
 entry
fd8ca2
fd8ca2
They will be used later to refresh the tickets.
fd8ca2
fd8ca2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14979
fd8ca2
fd8ca2
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
fd8ca2
Reviewed-by: Stefan Metzmacher <metze@samba.org>
fd8ca2
Reviewed-by: Andreas Schneider <asn@samba.org>
fd8ca2
(cherry picked from commit 0f4f330773d272b4d28ff3ba5a41bdd4ba569c8b)
fd8ca2
---
fd8ca2
 source3/winbindd/winbindd.h            |  2 ++
fd8ca2
 source3/winbindd/winbindd_cred_cache.c | 16 +++++++++++++++-
fd8ca2
 source3/winbindd/winbindd_pam.c        | 14 ++++++++++----
fd8ca2
 source3/winbindd/winbindd_proto.h      |  4 +++-
fd8ca2
 4 files changed, 30 insertions(+), 6 deletions(-)
fd8ca2
fd8ca2
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
fd8ca2
index a6b2238cec1..dac4a1fa927 100644
fd8ca2
--- a/source3/winbindd/winbindd.h
fd8ca2
+++ b/source3/winbindd/winbindd.h
fd8ca2
@@ -344,6 +344,8 @@ struct WINBINDD_CCACHE_ENTRY {
fd8ca2
 	const char *service;
fd8ca2
 	const char *username;
fd8ca2
 	const char *realm;
fd8ca2
+	const char *canon_principal;
fd8ca2
+	const char *canon_realm;
fd8ca2
 	struct WINBINDD_MEMORY_CREDS *cred_ptr;
fd8ca2
 	int ref_count;
fd8ca2
 	uid_t uid;
fd8ca2
diff --git a/source3/winbindd/winbindd_cred_cache.c b/source3/winbindd/winbindd_cred_cache.c
fd8ca2
index c3077e21989..88847b1ab97 100644
fd8ca2
--- a/source3/winbindd/winbindd_cred_cache.c
fd8ca2
+++ b/source3/winbindd/winbindd_cred_cache.c
fd8ca2
@@ -501,7 +501,9 @@ NTSTATUS add_ccache_to_list(const char *princ_name,
fd8ca2
 			    time_t create_time,
fd8ca2
 			    time_t ticket_end,
fd8ca2
 			    time_t renew_until,
fd8ca2
-			    bool postponed_request)
fd8ca2
+			    bool postponed_request,
fd8ca2
+			    const char *canon_principal,
fd8ca2
+			    const char *canon_realm)
fd8ca2
 {
fd8ca2
 	struct WINBINDD_CCACHE_ENTRY *entry = NULL;
fd8ca2
 	struct timeval t;
fd8ca2
@@ -617,6 +619,18 @@ NTSTATUS add_ccache_to_list(const char *princ_name,
fd8ca2
 			goto no_mem;
fd8ca2
 		}
fd8ca2
 	}
fd8ca2
+	if (canon_principal != NULL) {
fd8ca2
+		entry->canon_principal = talloc_strdup(entry, canon_principal);
fd8ca2
+		if (entry->canon_principal == NULL) {
fd8ca2
+			goto no_mem;
fd8ca2
+		}
fd8ca2
+	}
fd8ca2
+	if (canon_realm != NULL) {
fd8ca2
+		entry->canon_realm = talloc_strdup(entry, canon_realm);
fd8ca2
+		if (entry->canon_realm == NULL) {
fd8ca2
+			goto no_mem;
fd8ca2
+		}
fd8ca2
+	}
fd8ca2
 
fd8ca2
 	entry->ccname = talloc_strdup(entry, ccname);
fd8ca2
 	if (!entry->ccname) {
fd8ca2
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
fd8ca2
index 025a5cbc111..a24cef78440 100644
fd8ca2
--- a/source3/winbindd/winbindd_pam.c
fd8ca2
+++ b/source3/winbindd/winbindd_pam.c
fd8ca2
@@ -687,6 +687,8 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
fd8ca2
 	const char *local_service;
fd8ca2
 	uint32_t i;
fd8ca2
 	struct netr_SamInfo6 *info6_copy = NULL;
fd8ca2
+	char *canon_principal = NULL;
fd8ca2
+	char *canon_realm = NULL;
fd8ca2
 	bool ok;
fd8ca2
 
fd8ca2
 	*info6 = NULL;
fd8ca2
@@ -789,8 +791,8 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
fd8ca2
 				     WINBINDD_PAM_AUTH_KRB5_RENEW_TIME,
fd8ca2
 				     NULL,
fd8ca2
 				     local_service,
fd8ca2
-				     NULL,
fd8ca2
-				     NULL,
fd8ca2
+				     &canon_principal,
fd8ca2
+				     &canon_realm,
fd8ca2
 				     &pac_data_ctr);
fd8ca2
 	if (user_ccache_file != NULL) {
fd8ca2
 		gain_root_privilege();
fd8ca2
@@ -856,7 +858,9 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
fd8ca2
 					    time(NULL),
fd8ca2
 					    ticket_lifetime,
fd8ca2
 					    renewal_until,
fd8ca2
-					    false);
fd8ca2
+					    false,
fd8ca2
+					    canon_principal,
fd8ca2
+					    canon_realm);
fd8ca2
 
fd8ca2
 		if (!NT_STATUS_IS_OK(result)) {
fd8ca2
 			DEBUG(10,("winbindd_raw_kerberos_login: failed to add ccache to list: %s\n",
fd8ca2
@@ -1233,7 +1237,9 @@ static NTSTATUS winbindd_dual_pam_auth_cached(struct winbindd_domain *domain,
fd8ca2
 							    time(NULL),
fd8ca2
 							    time(NULL) + lp_winbind_cache_time(),
fd8ca2
 							    time(NULL) + WINBINDD_PAM_AUTH_KRB5_RENEW_TIME,
fd8ca2
-							    true);
fd8ca2
+							    true,
fd8ca2
+							    principal_s,
fd8ca2
+							    realm);
fd8ca2
 
fd8ca2
 				if (!NT_STATUS_IS_OK(result)) {
fd8ca2
 					DEBUG(10,("winbindd_dual_pam_auth_cached: failed "
fd8ca2
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
fd8ca2
index c0d653a6d77..16c23f3de40 100644
fd8ca2
--- a/source3/winbindd/winbindd_proto.h
fd8ca2
+++ b/source3/winbindd/winbindd_proto.h
fd8ca2
@@ -236,7 +236,9 @@ NTSTATUS add_ccache_to_list(const char *princ_name,
fd8ca2
 			    time_t create_time,
fd8ca2
 			    time_t ticket_end,
fd8ca2
 			    time_t renew_until,
fd8ca2
-			    bool postponed_request);
fd8ca2
+			    bool postponed_request,
fd8ca2
+			    const char *canon_principal,
fd8ca2
+			    const char *canon_realm);
fd8ca2
 NTSTATUS remove_ccache(const char *username);
fd8ca2
 struct WINBINDD_MEMORY_CREDS *find_memory_creds_by_name(const char *username);
fd8ca2
 NTSTATUS winbindd_add_memory_creds(const char *username,
fd8ca2
-- 
fd8ca2
2.35.1
fd8ca2
fd8ca2
fd8ca2
From 82452eb54758de50700776fb92b7e7af892fdaea Mon Sep 17 00:00:00 2001
fd8ca2
From: Samuel Cabrero <scabrero@suse.de>
fd8ca2
Date: Tue, 22 Feb 2022 14:28:44 +0100
fd8ca2
Subject: [PATCH 6/6] s3:winbind: Use the canonical principal name to renew the
fd8ca2
 credentials
fd8ca2
fd8ca2
The principal name stored in the winbindd ccache entry might be an
fd8ca2
enterprise principal name if enterprise principals are enabled. Use
fd8ca2
the canonical name to renew the credentials.
fd8ca2
fd8ca2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14979
fd8ca2
fd8ca2
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
fd8ca2
Reviewed-by: Stefan Metzmacher <metze@samba.org>
fd8ca2
Reviewed-by: Andreas Schneider <asn@samba.org>
fd8ca2
(cherry picked from commit 8246ccc23d064147412bb3475e6431a9fffc0d27)
fd8ca2
---
fd8ca2
 source3/winbindd/winbindd_cred_cache.c | 2 +-
fd8ca2
 1 file changed, 1 insertion(+), 1 deletion(-)
fd8ca2
fd8ca2
diff --git a/source3/winbindd/winbindd_cred_cache.c b/source3/winbindd/winbindd_cred_cache.c
fd8ca2
index 88847b1ab97..6c65db6a73f 100644
fd8ca2
--- a/source3/winbindd/winbindd_cred_cache.c
fd8ca2
+++ b/source3/winbindd/winbindd_cred_cache.c
fd8ca2
@@ -209,7 +209,7 @@ rekinit:
fd8ca2
 	set_effective_uid(entry->uid);
fd8ca2
 
fd8ca2
 	ret = smb_krb5_renew_ticket(entry->ccname,
fd8ca2
-				    entry->principal_name,
fd8ca2
+				    entry->canon_principal,
fd8ca2
 				    entry->service,
fd8ca2
 				    &new_start);
fd8ca2
 #if defined(DEBUG_KRB5_TKT_RENEWAL)
fd8ca2
-- 
fd8ca2
2.35.1
fd8ca2