fileio: add new flag WRITE_STRING_FILE_MODE_0444

With this write_string_file() will create the file with 0444 access mode
(i.e. read-only).
This commit is contained in:
Lennart Poettering
2024-01-05 17:30:41 +01:00
parent 3289aba5a0
commit 2148c669d2
2 changed files with 17 additions and 3 deletions
+2 -1
View File
@@ -26,7 +26,8 @@ typedef enum {
WRITE_STRING_FILE_NOFOLLOW = 1 << 8,
WRITE_STRING_FILE_MKDIR_0755 = 1 << 9,
WRITE_STRING_FILE_MODE_0600 = 1 << 10,
WRITE_STRING_FILE_SUPPRESS_REDUNDANT_VIRTUAL = 1 << 11,
WRITE_STRING_FILE_MODE_0444 = 1 << 11,
WRITE_STRING_FILE_SUPPRESS_REDUNDANT_VIRTUAL = 1 << 12,
/* And before you wonder, why write_string_file_atomic_label_ts() is a separate function instead of just one
more flag here: it's about linking: we don't want to pull -lselinux into all users of write_string_file()