tree-wide: set WRITE_STRING_FILE_DISABLE_BUFFER flag when we write files under /proc or /sys

This commit is contained in:
Yu Watanabe
2018-11-06 21:24:03 +09:00
parent 76cdddfb9d
commit 57512c893e
14 changed files with 39 additions and 37 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ int mac_smack_apply_pid(pid_t pid, const char *label) {
return 0;
p = procfs_file_alloca(pid, "attr/current");
r = write_string_file(p, label, 0);
r = write_string_file(p, label, WRITE_STRING_FILE_DISABLE_BUFFER);
if (r < 0)
return r;
+1 -1
View File
@@ -606,7 +606,7 @@ void disable_coredumps(void) {
if (detect_container() > 0)
return;
r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0);
r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", WRITE_STRING_FILE_DISABLE_BUFFER);
if (r < 0)
log_debug_errno(r, "Failed to turn off coredumps, ignoring: %m");
}