Don't rely on Posix like links in kdc
This commit is contained in:

committed by
Love Hornquist Astrand

parent
d47c01083b
commit
8768960156
10
kdc/kstash.c
10
kdc/kstash.c
@@ -144,13 +144,19 @@ main(int argc, char **argv)
|
||||
if(ret)
|
||||
unlink(new);
|
||||
else {
|
||||
#ifndef NO_POSIX_LINKS
|
||||
unlink(old);
|
||||
if(link(keyfile, old) < 0 && errno != ENOENT) {
|
||||
ret = errno;
|
||||
unlink(new);
|
||||
} else if(rename(new, keyfile) < 0) {
|
||||
ret = errno;
|
||||
} else {
|
||||
#endif
|
||||
if(rename(new, keyfile) < 0) {
|
||||
ret = errno;
|
||||
}
|
||||
#ifndef NO_POSIX_LINKS
|
||||
}
|
||||
#endif
|
||||
}
|
||||
out:
|
||||
free(old);
|
||||
|
Reference in New Issue
Block a user