diff options
author | Jeremy Allison <jra@samba.org> | 2004-06-24 20:37:23 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:52:02 -0500 |
commit | c3f09f2347e5397ff4eea3fedf1d9cf3284f0162 (patch) | |
tree | b61cc27c492571274701f830378787e5c9080e97 | |
parent | 34f985c971fa6b66db80793f00c0b16d16294d02 (diff) | |
download | samba-c3f09f2347e5397ff4eea3fedf1d9cf3284f0162.tar.gz samba-c3f09f2347e5397ff4eea3fedf1d9cf3284f0162.tar.bz2 samba-c3f09f2347e5397ff4eea3fedf1d9cf3284f0162.zip |
r1244: More Heimdal compile fixes.
Jeremy.
(This used to be commit 92a5dc1880a4fe0f3c3b56fc0958dbac77506b4f)
-rw-r--r-- | source3/libads/kerberos_verify.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/libads/kerberos_verify.c b/source3/libads/kerberos_verify.c index 8a18976b3a..d81a0a1629 100644 --- a/source3/libads/kerberos_verify.c +++ b/source3/libads/kerberos_verify.c @@ -39,11 +39,13 @@ static BOOL ads_keytab_verify_ticket(krb5_context context, krb5_auth_context aut BOOL auth_ok = False; krb5_keytab keytab = NULL; - krb5_kt_cursor cursor = NULL; + krb5_kt_cursor cursor; krb5_keytab_entry kt_entry; char *princ_name = NULL; ZERO_STRUCT(kt_entry); + ZERO_STRUCT(cursor); + ret = krb5_kt_default(context, &keytab); if (ret) { DEBUG(1, ("ads_keytab_verify_ticket: krb5_kt_default failed (%s)\n", error_message(ret))); @@ -100,8 +102,12 @@ static BOOL ads_keytab_verify_ticket(krb5_context context, krb5_auth_context aut if (princ_name) { krb5_free_unparsed_name(context, princ_name); } - if (cursor && keytab) { - krb5_kt_end_seq_get(context, keytab, &cursor); + { + krb5_kt_cursor zero_csr; + ZERO_STRUCT(zero_csr); + if ((memcmp(&cursor, &zero_csr, sizeof(krb5_kt_cursor)) != 0) && keytab) { + krb5_kt_end_seq_get(context, keytab, &cursor); + } } if (keytab) { krb5_kt_close(context, keytab); |