]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: set a useful access mode file for generated fstab files 37689/head
authorLennart Poettering <lennart@poettering.net>
Mon, 2 Jun 2025 08:12:33 +0000 (10:12 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 2 Jun 2025 08:12:33 +0000 (10:12 +0200)
We create these as temporary files with 0600 access mode. Let's adjust
this before we install the files.

src/repart/repart.c

index b8dff34b814d93a67e66058a97e4b1bed6abb98f..4d0609bbe8d5bae4893ab370a2640385aed26e43 100644 (file)
@@ -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);