From a27e58892ec8de00f90714ebe8a846b77e85cbb7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 2 Jun 2025 10:12:33 +0200 Subject: [PATCH] repart: set a useful access mode file for generated fstab files We create these as temporary files with 0600 access mode. Let's adjust this before we install the files. --- src/repart/repart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/repart/repart.c b/src/repart/repart.c index b8dff34b814..4d0609bbe8d 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -7701,6 +7701,10 @@ static int context_fstab(Context *context) { assert_not_reached(); } + r = fchmod_umask(fileno(f), 0666); + if (r < 0) + return log_error_errno(r, "Failed to adjust access mode of generated fstab file: %m"); + r = flink_tmpfile(f, t, path, IN_SET(arg_append_fstab, APPEND_AUTO, APPEND_REPLACE) ? LINK_TMPFILE_REPLACE : 0); if (r < 0) return log_error_errno(r, "Failed to link temporary file to %s: %m", path); -- 2.47.3