From bc16888bfb7a3897576709fd109794dfe10c6143 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Tue, 8 May 1990 10:13:54 +0000 Subject: *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@770 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/keytab/file/ktf_wreslv.c | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/lib/krb5/keytab/file/ktf_wreslv.c (limited to 'src/lib') diff --git a/src/lib/krb5/keytab/file/ktf_wreslv.c b/src/lib/krb5/keytab/file/ktf_wreslv.c new file mode 100644 index 000000000..ed9b0bc50 --- /dev/null +++ b/src/lib/krb5/keytab/file/ktf_wreslv.c @@ -0,0 +1,55 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1990 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * This is an implementation specific resolver. It returns a keytab id + * initialized with file keytab routines. + */ + +#if !defined(lint) && !defined(SABER) +static char krb5_ktfile_wresolve_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include +#include +#include +#include + +#include "ktfile.h" + +krb5_error_code +krb5_ktfile_wresolve(name, id) + char *name; + krb5_keytab *id; +{ + krb5_ktfile_data *data; + + if ((*id = (krb5_keytab) malloc(sizeof(**id))) == NULL) + return(ENOMEM); + + (*id)->ops = &krb5_ktf_writable_ops; + if ((data = (krb5_ktfile_data *)malloc(sizeof(krb5_ktfile_data))) == NULL) { + xfree(*id); + return(ENOMEM); + } + + if ((data->name = (char *)calloc(strlen(name) + 1, sizeof(char))) == NULL) { + xfree(data); + xfree(*id); + return(ENOMEM); + } + + (void) strcpy(data->name, name); + data->openf = 0; + + (*id)->data = (krb5_pointer)data; + + return(0); /* XXX */ +} + -- cgit