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.
This commit is contained in:
Lennart Poettering
2025-06-02 10:12:33 +02:00
parent 8504721e0e
commit a27e58892e

View 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);