krb5: Only lock keytabs to write to them (fix #1319)

This commit is contained in:
Nicolas Williams
2026-02-08 01:30:28 -06:00
parent 8ec31e4926
commit 609e36de13
+6 -4
View File
@@ -381,10 +381,12 @@ fkt_start_seq_get_int(krb5_context context,
return ret;
}
rk_cloexec(c->fd);
ret = _krb5_xlock(context, c->fd, exclusive, d->filename);
if (ret) {
close(c->fd);
return ret;
if (exclusive) {
ret = _krb5_xlock(context, c->fd, exclusive, d->filename);
if (ret) {
close(c->fd);
return ret;
}
}
if ((flags & O_ACCMODE) == O_RDWR && (flags & O_APPEND))
stdio_mode = "ab+";