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
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++] = '\\';
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;