From aedbd6bf8e4029c2089652d0f0a80777bc856f89 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 31 Mar 2012 01:27:02 -0400 Subject: s4-auth-krb: Simplify salt_princ handling. This allows us to make parse_principal static in kerbeors_util again and avoid a silly game where we alloc containers and set destrcutors only to release the whole thing at the end of the function. Signed-off-by: Andreas Schneider --- source4/auth/kerberos/kerberos_util.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source4/auth/kerberos/kerberos_util.c') diff --git a/source4/auth/kerberos/kerberos_util.c b/source4/auth/kerberos/kerberos_util.c index f38bc17212..0d2d19c78d 100644 --- a/source4/auth/kerberos/kerberos_util.c +++ b/source4/auth/kerberos/kerberos_util.c @@ -29,7 +29,13 @@ #include "auth/kerberos/kerberos_credentials.h" #include "auth/kerberos/kerberos_util.h" -krb5_error_code free_principal(struct principal_container *pc) +struct principal_container { + struct smb_krb5_context *smb_krb5_context; + krb5_principal principal; + const char *string_form; /* Optional */ +}; + +static krb5_error_code free_principal(struct principal_container *pc) { /* current heimdal - 0.6.3, which we need anyway, fixes segfaults here */ krb5_free_principal(pc->smb_krb5_context->krb5_context, pc->principal); @@ -38,7 +44,7 @@ krb5_error_code free_principal(struct principal_container *pc) } -krb5_error_code parse_principal(TALLOC_CTX *parent_ctx, +static krb5_error_code parse_principal(TALLOC_CTX *parent_ctx, const char *princ_string, struct smb_krb5_context *smb_krb5_context, krb5_principal *princ, -- cgit