with the shorter wake-up interval of one minute just as if a
subsequent renewal failed. Patch from Rasmus Borup Hansen.
+ Clean up the temporary ticket cache on k5start failure if -o, -g, or
+ -m were given. Based on a patch by Rasmus Borup Hansen.
+
kstart 4.1 (2012-01-07)
Fix a regression introduced in kstart 4.0 that caused k5start -H and
if (code != 0) {
warn_krb5(ctx, code, "error resolving keytab %s",
private->keytab);
- return code;
+ goto done;
}
code = krb5_get_init_creds_keytab(ctx, &creds, config->client,
keytab, 0, private->service,
*p = '\0';
else {
warn("password too long");
- return KRB5_LIBOS_CANTREADPWD;
+ code = KRB5_LIBOS_CANTREADPWD;
+ goto done;
}
code = krb5_get_init_creds_password(ctx, &creds, config->client,
buffer, NULL, NULL, 0,
code = set_permissions(cache, private);
if (code != 0)
goto done;
- if (rename(cache, config->cache) < 0)
+ if (rename(cache, config->cache) < 0) {
code = errno;
+ goto done;
+ }
}
done:
+ /* If we failed and were generating a separate cache, unlink it. */
+ if (private->set_perms)
+ unlink(cache);
+
/* Make sure that we don't free princ; we use it later. */
if (creds.client == config->client)
creds.client = NULL;