From 7fe9bf98bcad448cfea08097deac88033375504c Mon Sep 17 00:00:00 2001 From: John Kohl Date: Thu, 26 Apr 1990 17:24:47 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@600 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/keytab/file/ktf_add.c | 39 ++++++++++++++++++++++++ src/lib/krb5/keytab/file/ktf_endget.c | 31 +++++++++++++++++++ src/lib/krb5/keytab/file/ktf_next.c | 42 +++++++++++++++++++++++++ src/lib/krb5/keytab/file/ktf_remove.c | 32 +++++++++++++++++++ src/lib/krb5/keytab/file/ktf_ssget.c | 44 +++++++++++++++++++++++++++ 5 files changed, 188 insertions(+) create mode 100644 src/lib/krb5/keytab/file/ktf_add.c create mode 100644 src/lib/krb5/keytab/file/ktf_endget.c create mode 100644 src/lib/krb5/keytab/file/ktf_next.c create mode 100644 src/lib/krb5/keytab/file/ktf_remove.c create mode 100644 src/lib/krb5/keytab/file/ktf_ssget.c diff --git a/src/lib/krb5/keytab/file/ktf_add.c b/src/lib/krb5/keytab/file/ktf_add.c new file mode 100644 index 000000000..45651b9f6 --- /dev/null +++ b/src/lib/krb5/keytab/file/ktf_add.c @@ -0,0 +1,39 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * krb5_ktfile_add() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_ktf_add_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include +#include +#include +#include + +#include "ktfile.h" + +krb5_error_code +krb5_ktfile_add(id, entry) +krb5_keytab id; +krb5_keytab_entry *entry; +{ + krb5_error_code retval; + + if (retval = krb5_ktfileint_openw(id)) + return retval; + if (fseek(KTFILEP(id), 0, 2) == -1) + return KRB5_KT_END; + retval = krb5_ktfileint_write_entry(id, entry); + krb5_ktfileint_close(id); + return retval; +} diff --git a/src/lib/krb5/keytab/file/ktf_endget.c b/src/lib/krb5/keytab/file/ktf_endget.c new file mode 100644 index 000000000..274fb95de --- /dev/null +++ b/src/lib/krb5/keytab/file/ktf_endget.c @@ -0,0 +1,31 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * krb5_ktfile_end_get() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_ktf_endget_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include +#include +#include + +#include "ktfile.h" + +krb5_error_code +krb5_ktfile_end_get(id, cursor) +krb5_keytab id; +krb5_kt_cursor cursor; +{ + xfree(cursor); + return krb5_ktfileint_close(id); +} diff --git a/src/lib/krb5/keytab/file/ktf_next.c b/src/lib/krb5/keytab/file/ktf_next.c new file mode 100644 index 000000000..71f30e08d --- /dev/null +++ b/src/lib/krb5/keytab/file/ktf_next.c @@ -0,0 +1,42 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * krb5_ktfile_get_next() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_ktf_next_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include +#include +#include +#include + +#include "ktfile.h" + +krb5_error_code +krb5_ktfile_get_next(id, entry, cursor) +krb5_keytab id; +krb5_keytab_entry *entry; +krb5_kt_cursor cursor; +{ + long fileoff = *(long *)cursor; + krb5_keytab_entry *cur_entry; + krb5_error_code kerror; + + if (fseek(KTFILEP(id), fileoff, 0) == -1) + return KRB5_KT_END; + if (kerror = krb5_ktfileint_read_entry(id, &cur_entry)) + return kerror; + *entry = *cur_entry; + xfree(cur_entry); + return 0; +} diff --git a/src/lib/krb5/keytab/file/ktf_remove.c b/src/lib/krb5/keytab/file/ktf_remove.c new file mode 100644 index 000000000..7fb85ab5b --- /dev/null +++ b/src/lib/krb5/keytab/file/ktf_remove.c @@ -0,0 +1,32 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * krb5_ktfile_add() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_ktf_add_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include +#include +#include +#include +#include + +#include "ktfile.h" + +krb5_error_code +krb5_ktfile_remove(id, entry) +krb5_keytab id; +krb5_keytab_entry *entry; +{ + return EOPNOTSUPP; +} diff --git a/src/lib/krb5/keytab/file/ktf_ssget.c b/src/lib/krb5/keytab/file/ktf_ssget.c new file mode 100644 index 000000000..ae05c8f11 --- /dev/null +++ b/src/lib/krb5/keytab/file/ktf_ssget.c @@ -0,0 +1,44 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * krb5_ktfile_start_seq_get() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_ktf_ssget_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include +#include +#include +#include + +#include "ktfile.h" + +krb5_error_code +krb5_ktfile_start_seq_get(id, cursorp) +krb5_keytab id; +krb5_kt_cursor *cursorp; +{ + krb5_error_code retval; + long *fileoff; + + if (retval = krb5_ktfileint_openr(id)) + return retval; + + if (!(fileoff = (long *)malloc(sizeof(*fileoff)))) { + krb5_ktfileint_close(id); + return ENOMEM; + } + *fileoff = ftell(KTFILEP(id)); + cursorp = (krb5_kt_cursor *)fileoff; + + return 0; +} -- 2.26.2