From 4754bf4daf3ca5e9809a8a9d538d8ae38c9ef344 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Mon, 12 Jul 2021 12:32:12 +0200
Subject: [PATCH 200/266] CVE-2020-25719 mit-samba: Make ks_get_principal()
 
Conflict: NA 
Reference: https://git.samba.org/samba.git/?p=samba.git;a=patch;h=4754bf4daf3ca5e9809a8a9d538d8ae38c9ef344

 internally public

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14561

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
---
 source4/kdc/mit-kdb/kdb_samba.h            | 5 +++++
 source4/kdc/mit-kdb/kdb_samba_principals.c | 8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/source4/kdc/mit-kdb/kdb_samba.h b/source4/kdc/mit-kdb/kdb_samba.h
index ad4f6e27573..132dcfed363 100644
--- a/source4/kdc/mit-kdb/kdb_samba.h
+++ b/source4/kdc/mit-kdb/kdb_samba.h
@@ -41,6 +41,11 @@
 
 struct mit_samba_context *ks_get_context(krb5_context kcontext);
 
+krb5_error_code ks_get_principal(krb5_context context,
+				 krb5_const_principal principal,
+				 unsigned int kflags,
+				 krb5_db_entry **kentry);
+
 bool ks_data_eq_string(krb5_data d, const char *s);
 
 krb5_data ks_make_data(void *data, unsigned int len);
diff --git a/source4/kdc/mit-kdb/kdb_samba_principals.c b/source4/kdc/mit-kdb/kdb_samba_principals.c
index 8b67436dc47..79219e5a274 100644
--- a/source4/kdc/mit-kdb/kdb_samba_principals.c
+++ b/source4/kdc/mit-kdb/kdb_samba_principals.c
@@ -33,10 +33,10 @@
 #define ADMIN_LIFETIME 60*60*3 /* 3 hours */
 #define CHANGEPW_LIFETIME 60*5 /* 5 minutes */
 
-static krb5_error_code ks_get_principal(krb5_context context,
-				        krb5_const_principal principal,
-				        unsigned int kflags,
-				        krb5_db_entry **kentry)
+krb5_error_code ks_get_principal(krb5_context context,
+				 krb5_const_principal principal,
+				 unsigned int kflags,
+				 krb5_db_entry **kentry)
 {
 	struct mit_samba_context *mit_ctx;
 	krb5_error_code code;
-- 
2.23.0

