libmount: Ensure utab.lock mode 644
If utab.lock is created by a process with a restricted umask, utab.lock is created with restricted permissions. It breaks userspace monitor. Ensure that the mode is always 644. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
This commit is contained in:
parent
1ab3f16b43
commit
ecfeae90a2
|
@ -220,6 +220,11 @@ static int lock_simplelock(struct libmnt_lock *ml)
|
|||
rc = -errno;
|
||||
goto err;
|
||||
}
|
||||
rc = fchmod(ml->lockfile_fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
|
||||
if (rc < 0) {
|
||||
rc = -errno;
|
||||
goto err;
|
||||
}
|
||||
|
||||
while (flock(ml->lockfile_fd, LOCK_EX) < 0) {
|
||||
int errsv;
|
||||
|
|
Loading…
Reference in New Issue