Fix fcc_remove_cred() on platforms with non-standard rename()

This commit is contained in:
Asanka Herath
2010-08-24 00:00:16 -04:00
committed by Asanka C. Herath
parent b74fa12602
commit bd795255aa

View File

@@ -814,6 +814,14 @@ fcc_remove_cred(krb5_context context,
}
ret = rename(&newname[5], FILENAME(id));
#ifdef RENAME_DOES_NOT_UNLINK
if (ret && (errno == EEXIST || errno == EACCES)) {
ret = unlink(FILENAME(id));
if (ret == 0) {
ret = rename(&newname[5], FILENAME(id));
}
}
#endif
if (ret)
ret = errno;
free(newname);