aboutsummaryrefslogtreecommitdiffstats
path: root/libmount/src
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2024-01-03 14:40:07 +0100
committerKarel Zak <kzak@redhat.com>2024-01-03 14:40:07 +0100
commitc14bee4d44ac8c61d56028f2f032e35c32533c38 (patch)
tree85464e5b5592ecffdc67ac44294ee7d675ba865c /libmount/src
parent544824929a740ed5f8108c752872c7f082f301cf (diff)
downloadutil-linux-c14bee4d44ac8c61d56028f2f032e35c32533c38.tar.gz
libmount: reduce utab.lock permissions
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src')
-rw-r--r--libmount/src/lock.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libmount/src/lock.c b/libmount/src/lock.c
index 708e6a5754..cbc74a6034 100644
--- a/libmount/src/lock.c
+++ b/libmount/src/lock.c
@@ -146,7 +146,7 @@ static int lock_simplelock(struct libmnt_lock *ml)
const char *lfile;
int rc;
struct stat sb;
- const mode_t lock_mask = S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH;
+ const mode_t lock_mask = S_IRUSR|S_IWUSR;
assert(ml);
@@ -161,8 +161,7 @@ static int lock_simplelock(struct libmnt_lock *ml)
sigprocmask(SIG_BLOCK, &sigs, &ml->oldsigmask);
}
- ml->lockfile_fd = open(lfile, O_RDONLY|O_CREAT|O_CLOEXEC,
- S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH);
+ ml->lockfile_fd = open(lfile, O_RDONLY|O_CREAT|O_CLOEXEC, lock_mask);
if (ml->lockfile_fd < 0) {
rc = -errno;
goto err;