User more restrictive attributes for device file lock.

This commit is contained in:
Milan Broz
2023-03-09 16:55:46 +01:00
parent ccf48bb28e
commit d209bb27b4

View File

@@ -134,7 +134,7 @@ static int open_resource(struct crypt_device *cd, const char *res)
return -EINVAL;
log_dbg(cd, "Opening lock resource file %s/%s", DEFAULT_LUKS2_LOCK_PATH, res);
r = openat(lockdir_fd, res, O_CREAT | O_NOFOLLOW | O_RDWR | O_CLOEXEC, 0777);
r = openat(lockdir_fd, res, O_CREAT|O_NOFOLLOW|O_RDWR|O_CLOEXEC, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
err = errno;
close(lockdir_fd);