summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2016-08-30 12:38:46 +0200
committerAndrew Bartlett <abartlet@samba.org>2016-08-31 20:59:17 +0200
commit9d4f1b4d3119f0c655eff3619e675423ad8c21d8 (patch)
tree37cedecfc30d04c4ae11b704188744695839f3f6 /source3/libads
parent3cd4bc6446d2cd234f814091ce936d716360a78a (diff)
downloadsamba-9d4f1b4d3119f0c655eff3619e675423ad8c21d8.tar.gz
s3-libads: Support for MIT Kerberos ntstatus from init_creds
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/kerberos.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index 99028f8959b..1203153a3bb 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -203,12 +203,14 @@ static bool smb_krb5_get_ntstatus_from_init_creds(krb5_context ctx,
krb5_get_init_creds_opt *opt,
NTSTATUS *nt_status)
{
-#ifdef HAVE_E_DATA_POINTER_IN_KRB5_ERROR
- /* HEIMDAL */
-
krb5_init_creds_context icc;
krb5_error_code code;
+#ifdef HAVE_E_DATA_POINTER_IN_KRB5_ERROR
+ /* HEIMDAL */
krb5_error error;
+#else
+ krb5_error *error = NULL;
+#endif
bool ok;
code = krb5_init_creds_init(ctx,
@@ -234,14 +236,17 @@ static bool smb_krb5_get_ntstatus_from_init_creds(krb5_context ctx,
}
krb5_init_creds_free(ctx, icc);
+#ifdef HAVE_E_DATA_POINTER_IN_KRB5_ERROR
ok = smb_krb5_get_ntstatus_from_krb5_error(&error, nt_status);
krb5_free_error_contents(ctx, &error);
-
- return ok;
#else
- return false;
+ ok = smb_krb5_get_ntstatus_from_krb5_error(error, nt_status);
+
+ krb5_free_error(ctx, error);
#endif
+
+ return ok;
}
/*