*** empty log message ***
authorJohn Kohl <jtkohl@mit.edu>
Thu, 26 Apr 1990 17:24:47 +0000 (17:24 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Thu, 26 Apr 1990 17:24:47 +0000 (17:24 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@600 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/keytab/file/ktf_add.c [new file with mode: 0644]
src/lib/krb5/keytab/file/ktf_endget.c [new file with mode: 0644]
src/lib/krb5/keytab/file/ktf_next.c [new file with mode: 0644]
src/lib/krb5/keytab/file/ktf_remove.c [new file with mode: 0644]
src/lib/krb5/keytab/file/ktf_ssget.c [new file with mode: 0644]

diff --git a/src/lib/krb5/keytab/file/ktf_add.c b/src/lib/krb5/keytab/file/ktf_add.c
new file mode 100644 (file)
index 0000000..45651b9
--- /dev/null
@@ -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 (file)
index 0000000..274fb95
--- /dev/null
@@ -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 (file)
index 0000000..71f30e0
--- /dev/null
@@ -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 (file)
index 0000000..7fb85ab
--- /dev/null
@@ -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 (file)
index 0000000..ae05c8f
--- /dev/null
@@ -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;
+}