From 937bfeba0767efe9ba5604856ba04f6dd15d852e Mon Sep 17 00:00:00 2001 From: John Gilmore Date: Fri, 3 Feb 1995 10:17:02 +0000 Subject: Rename files for DOS 8.3 uniqueness: * ktf_get_en.c => ktf_g_ent.c * ktf_get_na.c => ktf_g_name.c * Makefile.in: changed to match. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4887 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/keytab/file/ChangeLog | 7 +++ src/lib/krb5/keytab/file/Makefile.in | 8 ++-- src/lib/krb5/keytab/file/ktf_g_ent.c | 89 +++++++++++++++++++++++++++++++++++ src/lib/krb5/keytab/file/ktf_g_name.c | 48 +++++++++++++++++++ src/lib/krb5/keytab/file/ktf_get_en.c | 89 ----------------------------------- src/lib/krb5/keytab/file/ktf_get_na.c | 48 ------------------- 6 files changed, 148 insertions(+), 141 deletions(-) create mode 100644 src/lib/krb5/keytab/file/ktf_g_ent.c create mode 100644 src/lib/krb5/keytab/file/ktf_g_name.c delete mode 100644 src/lib/krb5/keytab/file/ktf_get_en.c delete mode 100644 src/lib/krb5/keytab/file/ktf_get_na.c (limited to 'src/lib') diff --git a/src/lib/krb5/keytab/file/ChangeLog b/src/lib/krb5/keytab/file/ChangeLog index f14ededd9..83b804c67 100644 --- a/src/lib/krb5/keytab/file/ChangeLog +++ b/src/lib/krb5/keytab/file/ChangeLog @@ -1,3 +1,10 @@ +Fri Feb 3 01:53:44 1995 John Gilmore + + Rename files for DOS 8.3 uniqueness: + * ktf_get_en.c => ktf_g_ent.c + * ktf_get_na.c => ktf_g_name.c + * Makefile.in: changed to match. + Fri Jan 27 12:54:54 1995 Chris Provenzano (proven@mit.edu) * ktf_get_en.c, ktfile.h (krb5_ktfile_get_entry()) Added diff --git a/src/lib/krb5/keytab/file/Makefile.in b/src/lib/krb5/keytab/file/Makefile.in index 6cd37130a..5e88a72ff 100644 --- a/src/lib/krb5/keytab/file/Makefile.in +++ b/src/lib/krb5/keytab/file/Makefile.in @@ -10,12 +10,12 @@ SRCS= \ $(srcdir)/ktf_resolv.c \ $(srcdir)/ktf_wops.c \ $(srcdir)/ktf_close.c \ - $(srcdir)/ktf_get_en.c \ + $(srcdir)/ktf_g_ent.c \ $(srcdir)/ktf_ops.c \ $(srcdir)/ktf_ssget.c \ $(srcdir)/ktf_wreslv.c \ $(srcdir)/ktf_defops.c \ - $(srcdir)/ktf_get_na.c \ + $(srcdir)/ktf_g_name.c \ $(srcdir)/ktf_remove.c \ $(srcdir)/ktf_util.c @@ -23,8 +23,8 @@ OBJS = \ ktf_add.o \ ktf_close.o \ ktf_endget.o \ - ktf_get_en.o \ - ktf_get_na.o \ + ktf_g_ent.o \ + ktf_g_name.o \ ktf_next.o \ ktf_resolv.o \ ktf_remove.o \ diff --git a/src/lib/krb5/keytab/file/ktf_g_ent.c b/src/lib/krb5/keytab/file/ktf_g_ent.c new file mode 100644 index 000000000..e5dbea41e --- /dev/null +++ b/src/lib/krb5/keytab/file/ktf_g_ent.c @@ -0,0 +1,89 @@ +/* + * lib/krb5/keytab/file/ktf_get_en.c + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * + * This is the get_entry routine for the file based keytab implementation. + * It opens the keytab file, and either retrieves the entry or returns + * an error. + */ + + +#include +#include + +#include "ktfile.h" + +krb5_error_code +krb5_ktfile_get_entry(context, id, principal, kvno, keytype, entry) + krb5_context context; + krb5_keytab id; + krb5_principal principal; + krb5_kvno kvno; + krb5_keytype keytype; + krb5_keytab_entry * entry; +{ + krb5_keytab_entry cur_entry, new_entry; + krb5_error_code kerror = 0; + + /* Open the keyfile for reading */ + if (kerror = krb5_ktfileint_openr(context, id)) + return(kerror); + + /* + * For efficiency and simplicity, we'll use a while true that + * is exited with a break statement. + */ + cur_entry.principal = 0; + cur_entry.vno = 0; + cur_entry.key.contents = 0; + while (TRUE) { + if (kerror = krb5_ktfileint_read_entry(context, id, &new_entry)) + break; + + if (krb5_principal_compare(context, principal, new_entry.principal)) { + if (kvno == IGNORE_VNO) { + if (cur_entry.vno < new_entry.vno) { + krb5_kt_free_entry(context, &cur_entry); + cur_entry = new_entry; + } + } else { + cur_entry = new_entry; + break; + } + } else { + krb5_kt_free_entry(context, &new_entry); + } + } + if (kerror == KRB5_KT_END) + kerror = cur_entry.principal ? 0 : KRB5_KT_NOTFOUND; + if (kerror) { + (void) krb5_ktfileint_close(context, id); + krb5_kt_free_entry(context, &cur_entry); + return kerror; + } + if ((kerror = krb5_ktfileint_close(context, id)) != 0) { + krb5_kt_free_entry(context, &cur_entry); + return kerror; + } + *entry = cur_entry; + return 0; +} diff --git a/src/lib/krb5/keytab/file/ktf_g_name.c b/src/lib/krb5/keytab/file/ktf_g_name.c new file mode 100644 index 000000000..62cd10e7f --- /dev/null +++ b/src/lib/krb5/keytab/file/ktf_g_name.c @@ -0,0 +1,48 @@ +/* + * lib/krb5/keytab/file/ktf_get_na.c + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * Export of this software from the United States of America may + * require a specific license from the United States Government. + * It is the responsibility of any person or organization contemplating + * export to obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of M.I.T. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. M.I.T. makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * + * Get the name of the file containing a file-based keytab. + */ + + +#include +#include + +#include "ktfile.h" + +krb5_error_code +krb5_ktfile_get_name(context, id, name, len) + krb5_context context; + krb5_keytab id; + char *name; + int len; + /* + * This routine returns the name of the name of the file associated with + * this file-based keytab. name is zeroed and the filename is truncated + * to fit in name if necessary. + */ +{ + memset(name, 0, len); + strncpy(name, KTFILENAME(id), len); + return(0); +} diff --git a/src/lib/krb5/keytab/file/ktf_get_en.c b/src/lib/krb5/keytab/file/ktf_get_en.c deleted file mode 100644 index e5dbea41e..000000000 --- a/src/lib/krb5/keytab/file/ktf_get_en.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * lib/krb5/keytab/file/ktf_get_en.c - * - * Copyright 1990 by the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * Export of this software from the United States of America may - * require a specific license from the United States Government. - * It is the responsibility of any person or organization contemplating - * export to obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - * - * - * This is the get_entry routine for the file based keytab implementation. - * It opens the keytab file, and either retrieves the entry or returns - * an error. - */ - - -#include -#include - -#include "ktfile.h" - -krb5_error_code -krb5_ktfile_get_entry(context, id, principal, kvno, keytype, entry) - krb5_context context; - krb5_keytab id; - krb5_principal principal; - krb5_kvno kvno; - krb5_keytype keytype; - krb5_keytab_entry * entry; -{ - krb5_keytab_entry cur_entry, new_entry; - krb5_error_code kerror = 0; - - /* Open the keyfile for reading */ - if (kerror = krb5_ktfileint_openr(context, id)) - return(kerror); - - /* - * For efficiency and simplicity, we'll use a while true that - * is exited with a break statement. - */ - cur_entry.principal = 0; - cur_entry.vno = 0; - cur_entry.key.contents = 0; - while (TRUE) { - if (kerror = krb5_ktfileint_read_entry(context, id, &new_entry)) - break; - - if (krb5_principal_compare(context, principal, new_entry.principal)) { - if (kvno == IGNORE_VNO) { - if (cur_entry.vno < new_entry.vno) { - krb5_kt_free_entry(context, &cur_entry); - cur_entry = new_entry; - } - } else { - cur_entry = new_entry; - break; - } - } else { - krb5_kt_free_entry(context, &new_entry); - } - } - if (kerror == KRB5_KT_END) - kerror = cur_entry.principal ? 0 : KRB5_KT_NOTFOUND; - if (kerror) { - (void) krb5_ktfileint_close(context, id); - krb5_kt_free_entry(context, &cur_entry); - return kerror; - } - if ((kerror = krb5_ktfileint_close(context, id)) != 0) { - krb5_kt_free_entry(context, &cur_entry); - return kerror; - } - *entry = cur_entry; - return 0; -} diff --git a/src/lib/krb5/keytab/file/ktf_get_na.c b/src/lib/krb5/keytab/file/ktf_get_na.c deleted file mode 100644 index 62cd10e7f..000000000 --- a/src/lib/krb5/keytab/file/ktf_get_na.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * lib/krb5/keytab/file/ktf_get_na.c - * - * Copyright 1990 by the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * Export of this software from the United States of America may - * require a specific license from the United States Government. - * It is the responsibility of any person or organization contemplating - * export to obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - * - * - * Get the name of the file containing a file-based keytab. - */ - - -#include -#include - -#include "ktfile.h" - -krb5_error_code -krb5_ktfile_get_name(context, id, name, len) - krb5_context context; - krb5_keytab id; - char *name; - int len; - /* - * This routine returns the name of the name of the file associated with - * this file-based keytab. name is zeroed and the filename is truncated - * to fit in name if necessary. - */ -{ - memset(name, 0, len); - strncpy(name, KTFILENAME(id), len); - return(0); -} -- cgit