summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1994-06-10 22:32:09 +0000
committerTheodore Tso <tytso@mit.edu>1994-06-10 22:32:09 +0000
commitc6d421668433407a75ad8602e6a312686179bcec (patch)
tree2d19a60d19db8b2555c5e95e5ea59026376cc34c
parentf276351ec34f4c41dcfe0fa2eb6e792103f3a061 (diff)
downloadkrb5-c6d421668433407a75ad8602e6a312686179bcec.tar.gz
krb5-c6d421668433407a75ad8602e6a312686179bcec.tar.xz
krb5-c6d421668433407a75ad8602e6a312686179bcec.zip
Fix bugs I introduced into srv_rcache. The rcache name wasn't being
formed correctly (not adding rc_ at the beginning) and we weren't trying krb5_rc_recover() before trying krb5_rc_initialize(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3736 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/lib/krb5/krb/srv_rcache.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/lib/krb5/krb/srv_rcache.c b/src/lib/krb5/krb/srv_rcache.c
index c04e6249b..7edd1f62c 100644
--- a/src/lib/krb5/krb/srv_rcache.c
+++ b/src/lib/krb5/krb/srv_rcache.c
@@ -64,8 +64,9 @@ krb5_rcache *rcptr;
retval = ENOMEM;
goto cleanup;
}
+ strcpy(cachename, "rc_");
p = 3;
- for (i = 0; i <= piece->length; i++) {
+ for (i = 0; i < piece->length; i++) {
if (piece->data[i] == '\\') {
cachename[p++] = '\\';
cachename[p++] = '\\';
@@ -83,11 +84,17 @@ krb5_rcache *rcptr;
if (retval = krb5_rc_resolve(rcache, cachename))
goto cleanup;
-
- if (retval = krb5_rc_initialize(rcache, krb5_clockskew)) {
- krb5_rc_close(rcache);
- rcache = 0;
- goto cleanup;
+
+ /*
+ * First try to recover the replay cache; if that doesn't work,
+ * initialize it.
+ */
+ if (krb5_rc_recover(rcache)) {
+ if (retval = krb5_rc_initialize(rcache, krb5_clockskew)) {
+ krb5_rc_close(rcache);
+ rcache = 0;
+ goto cleanup;
+ }
}
*rcptr = rcache;