From: Stanislav Brabec Date: Tue, 11 Apr 2017 14:12:52 +0000 (+0200) Subject: libmount: Ensure utab.lock mode 644 X-Git-Tag: v2.30-rc1~106 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ecfeae90a294;p=thirdparty%2Futil-linux.git 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 --- diff --git a/libmount/src/lock.c b/libmount/src/lock.c index 06eff1344b..f9d0253fb6 100644 --- a/libmount/src/lock.c +++ b/libmount/src/lock.c @@ -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;