From 8d99c2c73c908048301e54e4abe6d92e0c65a322 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 15 Dec 1996 23:07:18 +0000 Subject: [PATCH] more stupid code git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1114 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/keytab.c | 83 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 27 deletions(-) diff --git a/lib/krb5/keytab.c b/lib/krb5/keytab.c index f8e00232e..0d1b762b7 100644 --- a/lib/krb5/keytab.c +++ b/lib/krb5/keytab.c @@ -91,34 +91,63 @@ krb5_error_code krb5_kt_close(krb5_context context, krb5_keytab id) { + free (id->filename); + free (id); + return 0; +} + +krb5_error_code +krb5_kt_get_entry(krb5_context context, + krb5_keytab id, + krb5_principal principal, + krb5_kvno kvno, + krb5_keytype keytype, + krb5_keytab_entry *entry) +{ + krb5_error_code r; + krb5_kt_cursor cursor; + krb5_keytab_entry entry; + + r = krb5_kt_start_seq_get (context, id, &cursor); + while (krb5_kt_next_entry(context, id, &entry, &cursor) == 0) { + + } + return krb5_kt_end_seq_get (context, id, &cursor); +} + +krb5_error_code +krb5_kt_free_entry(krb5_context context, + krb5_keytab_entry *entry) +{ + free (entry); + return 0; +} + +krb5_error_code +krb5_kt_start_seq_get(krb5_context context, + krb5_keytab id, + krb5_kt_cursor *cursor) +{ + cursor->fd = open (id->filename, O_RDONLY); + if (cursor->fd < 0) + return -1; + return 0; +} + +krb5_error_code +krb5_kt_next_entry(krb5_context context, + krb5_keytab id, + krb5_keytab_entry *entry, + krb5_kt_cursor *cursor) +{ } krb5_error_code -krb5_kt_get_entry(krb5_context, - krb5_keytab, - krb5_principal, - krb5_kvno, - krb5_keytype, - krb5_keytab_entry *); - -krb5_error_code -krb5_kt_free_entry(krb5_context, - krb5_keytab_entry *); - -krb5_error_code -krb5_kt_start_seq_get(krb5_context, - krb5_keytab id, - krb5_kt_cursor *); - -krb5_error_code -krb5_kt_next_entry(krb5_context, - krb5_keytab, - krb5_keytab_entry *, - krb5_kt_cursor *); - -krb5_error_code -krb5_kt_end_seq_get(krb5_context, - krb5_keytab, - krb5_kt_cursor *); - +krb5_kt_end_seq_get(krb5_context context, + krb5_keytab id, + krb5_kt_cursor *cursor) +{ + close (cursor->fd); + return 0; +}