diff options
author | John Kohl <jtkohl@mit.edu> | 1991-03-05 17:39:24 +0000 |
---|---|---|
committer | John Kohl <jtkohl@mit.edu> | 1991-03-05 17:39:24 +0000 |
commit | 67826e1afc51731a8b83d4d3f2ad4f3c2ef7c77c (patch) | |
tree | c81e593cb67b8cfa43efb1d5b36caa514e68a3be /src | |
parent | b853b4c82252cd8ef1767e5c1b79440181956716 (diff) | |
download | krb5-67826e1afc51731a8b83d4d3f2ad4f3c2ef7c77c.tar.gz krb5-67826e1afc51731a8b83d4d3f2ad4f3c2ef7c77c.tar.xz krb5-67826e1afc51731a8b83d4d3f2ad4f3c2ef7c77c.zip |
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1859 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/krb5/krb/srv_rcache.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/lib/krb5/krb/srv_rcache.c b/src/lib/krb5/krb/srv_rcache.c new file mode 100644 index 0000000000..0faa07f3b4 --- /dev/null +++ b/src/lib/krb5/krb/srv_rcache.c @@ -0,0 +1,56 @@ +/* + * $Source$ + * $Author$ + * + * Copyright 1991 by the Massachusetts Institute of Technology. + * All Rights Reserved. + * + * For copying and distribution information, please see the file + * <krb5/copyright.h>. + * + * Allocate & prepare a default replay cache for a server. + */ + +#if !defined(lint) && !defined(SABER) +static char rcsid_srv_rcache_c[] = +"$Id$"; +#endif /* !lint & !SABER */ + +#include <krb5/krb5.h> +#include <krb5/ext-proto.h> + +krb5_error_code +krb5_get_server_rcache(piece, rcptr) +const char *piece; +krb5_rcache *rcptr; +{ + krb5_rcache rcache; + char *cachename; + extern krb5_deltat krb5_clockskew; + krb5_error_code retval; + int len = strlen(piece); + + if (rcache = (krb5_rcache) malloc(sizeof(*rcache))) { + if (!(retval = krb5_rc_resolve_type(&rcache, "dfl"))) { + + if (cachename = malloc(len+1+3)) { + strcpy(cachename, "rc_"); + strcat(cachename, piece); + cachename[len+3] = '\0'; + + if (!(retval = krb5_rc_resolve(rcache, cachename))) { + if (!((retval = krb5_rc_recover(rcache)) && + (retval = krb5_rc_initialize(rcache, + krb5_clockskew)))) { + *rcptr = rcache; + return 0; + } + } + } else + retval = ENOMEM; + } + xfree(rcache); + } else + retval = ENOMEM; + return retval; +} |