diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/krb5/keytab/file/ktf_add.c | 39 | ||||
| -rw-r--r-- | src/lib/krb5/keytab/file/ktf_endget.c | 31 | ||||
| -rw-r--r-- | src/lib/krb5/keytab/file/ktf_next.c | 42 | ||||
| -rw-r--r-- | src/lib/krb5/keytab/file/ktf_remove.c | 32 | ||||
| -rw-r--r-- | src/lib/krb5/keytab/file/ktf_ssget.c | 44 |
5 files changed, 188 insertions, 0 deletions
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/copyright.h>. + * + * krb5_ktfile_add() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_ktf_add_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include <krb5/copyright.h> +#include <krb5/krb5.h> +#include <krb5/krb5_err.h> +#include <krb5/ext-proto.h> + +#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/copyright.h>. + * + * krb5_ktfile_end_get() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_ktf_endget_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include <krb5/copyright.h> +#include <krb5/krb5.h> +#include <krb5/ext-proto.h> + +#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/copyright.h>. + * + * krb5_ktfile_get_next() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_ktf_next_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include <krb5/copyright.h> +#include <krb5/krb5.h> +#include <krb5/krb5_err.h> +#include <krb5/ext-proto.h> + +#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/copyright.h>. + * + * krb5_ktfile_add() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_ktf_add_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include <krb5/copyright.h> +#include <krb5/krb5.h> +#include <krb5/krb5_err.h> +#include <krb5/ext-proto.h> +#include <errno.h> + +#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/copyright.h>. + * + * krb5_ktfile_start_seq_get() + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_ktf_ssget_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include <krb5/copyright.h> +#include <krb5/krb5.h> +#include <krb5/ext-proto.h> +#include <errno.h> + +#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; +} |
