Fixes bug introduced in
b65e8977566be831c0308390b70fc2151f40e4e7.
open() was creating a file which could not be open again because of
insufficient permissions. This somehow worked because lockfile_release()
unlinks the file, but it broke terribly if lockfile_release() was not
called because of crash or something like that.
Fixes: merge request knot/knot-resolver!1042
Bugfixes
--------
- avoid an assert() error in stash_rrset() (!1072)
+- fix emergency cache locking bug introduced in 5.1.3 (!1078)
Knot Resolver 5.1.3 (2020-09-08)
static int lockfile_get(const char *path)
{
assert(path);
- const int fd = open(path, O_CREAT|O_RDWR, S_IRUSR);
+ const int fd = open(path, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
if (fd < 0)
return kr_error(errno);