command: Added mandatory permissions for O_CREAT

This commit is contained in:
Erik Kooistra 2020-12-21 22:48:55 +01:00 committed by Ariadne Conill
parent 4c64b5138b
commit e4fa275067

View file

@ -46,7 +46,7 @@ acquire_state_lock(const char *state_path, const char *lifname)
snprintf(lockpath, sizeof lockpath, "%s.%s.lock", state_path, lifname); snprintf(lockpath, sizeof lockpath, "%s.%s.lock", state_path, lifname);
int fd = open(lockpath, O_CREAT | O_WRONLY | O_TRUNC); int fd = open(lockpath, O_CREAT | O_WRONLY | O_TRUNC, 0600);
if (fd < 0) if (fd < 0)
{ {
if (exec_opts.verbose) if (exec_opts.verbose)