blob: 44c3ff05327a69c1000eeb75e13ebde7c49c924f [file] [log] [blame]
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001From 7cb6579572b50ef44bc0a321a4c73cce55b0c2f2 Mon Sep 17 00:00:00 2001
Brad Bishop19323692019-04-05 15:28:33 -04002From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 1 Mar 2019 15:22:15 +0800
William A. Kennington IIIac69b482021-06-02 12:28:27 -07004Subject: [PATCH] do not disable buffer in writing files
Brad Bishop19323692019-04-05 15:28:33 -04005
6Do not disable buffer in writing files, otherwise we get
7failure at boot for musl like below.
8
9 [!!!!!!] Failed to allocate manager object.
10
11And there will be other failures, critical or not critical.
12This is specific to musl.
13
14Upstream-Status: Inappropriate [musl]
15
16Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Brad Bishopc342db32019-05-15 21:57:59 -040017[Rebased for v242]
18Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Brad Bishopa34c0302019-09-23 22:34:48 -040019[rebased for systemd 243]
20Signed-off-by: Scott Murray <scott.murray@konsulko.com>
William A. Kennington IIIac69b482021-06-02 12:28:27 -070021
Brad Bishop19323692019-04-05 15:28:33 -040022---
Andrew Geissler82c905d2020-04-13 13:39:40 -050023 src/basic/cgroup-util.c | 10 +++++-----
Brad Bishop19323692019-04-05 15:28:33 -040024 src/basic/procfs-util.c | 4 ++--
25 src/basic/smack-util.c | 2 +-
William A. Kennington IIIac69b482021-06-02 12:28:27 -070026 src/basic/sysctl-util.c | 2 +-
Brad Bishop19323692019-04-05 15:28:33 -040027 src/basic/util.c | 2 +-
28 src/binfmt/binfmt.c | 6 +++---
29 src/core/main.c | 4 ++--
30 src/core/smack-setup.c | 8 ++++----
31 src/hibernate-resume/hibernate-resume.c | 2 +-
32 src/libsystemd/sd-device/sd-device.c | 2 +-
33 src/login/logind-dbus.c | 2 +-
Brad Bishop19323692019-04-05 15:28:33 -040034 src/nspawn/nspawn-cgroup.c | 2 +-
35 src/nspawn/nspawn.c | 6 +++---
Andrew Geissler82c905d2020-04-13 13:39:40 -050036 src/shared/cgroup-setup.c | 4 ++--
Andrew Geissler82c905d2020-04-13 13:39:40 -050037 src/sleep/sleep.c | 8 ++++----
Brad Bishop19323692019-04-05 15:28:33 -040038 src/vconsole/vconsole-setup.c | 2 +-
William A. Kennington IIIac69b482021-06-02 12:28:27 -070039 16 files changed, 33 insertions(+), 33 deletions(-)
Brad Bishop19323692019-04-05 15:28:33 -040040
Andrew Geisslerd1e89492021-02-12 15:35:20 -060041--- a/src/basic/cgroup-util.c
42+++ b/src/basic/cgroup-util.c
Patrick Williams213cb262021-08-07 19:21:33 -050043@@ -766,7 +766,7 @@ int cg_install_release_agent(const char
Brad Bishop19323692019-04-05 15:28:33 -040044
45 sc = strstrip(contents);
46 if (isempty(sc)) {
47- r = write_string_file(fs, agent, WRITE_STRING_FILE_DISABLE_BUFFER);
48+ r = write_string_file(fs, agent, 0);
49 if (r < 0)
50 return r;
51 } else if (!path_equal(sc, agent))
Patrick Williams213cb262021-08-07 19:21:33 -050052@@ -784,7 +784,7 @@ int cg_install_release_agent(const char
Brad Bishop19323692019-04-05 15:28:33 -040053
54 sc = strstrip(contents);
55 if (streq(sc, "0")) {
56- r = write_string_file(fs, "1", WRITE_STRING_FILE_DISABLE_BUFFER);
57+ r = write_string_file(fs, "1", 0);
58 if (r < 0)
59 return r;
60
Patrick Williams213cb262021-08-07 19:21:33 -050061@@ -811,7 +811,7 @@ int cg_uninstall_release_agent(const cha
Brad Bishop19323692019-04-05 15:28:33 -040062 if (r < 0)
63 return r;
64
65- r = write_string_file(fs, "0", WRITE_STRING_FILE_DISABLE_BUFFER);
66+ r = write_string_file(fs, "0", 0);
67 if (r < 0)
68 return r;
69
Patrick Williams213cb262021-08-07 19:21:33 -050070@@ -821,7 +821,7 @@ int cg_uninstall_release_agent(const cha
Brad Bishop19323692019-04-05 15:28:33 -040071 if (r < 0)
72 return r;
73
74- r = write_string_file(fs, "", WRITE_STRING_FILE_DISABLE_BUFFER);
75+ r = write_string_file(fs, "", 0);
76 if (r < 0)
77 return r;
78
Patrick Williams213cb262021-08-07 19:21:33 -050079@@ -1651,7 +1651,7 @@ int cg_set_attribute(const char *control
Brad Bishop19323692019-04-05 15:28:33 -040080 if (r < 0)
81 return r;
82
83- return write_string_file(p, value, WRITE_STRING_FILE_DISABLE_BUFFER);
84+ return write_string_file(p, value, 0);
85 }
86
87 int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) {
Andrew Geisslerd1e89492021-02-12 15:35:20 -060088--- a/src/basic/procfs-util.c
89+++ b/src/basic/procfs-util.c
Patrick Williams213cb262021-08-07 19:21:33 -050090@@ -86,13 +86,13 @@ int procfs_tasks_set_limit(uint64_t limi
Brad Bishop19323692019-04-05 15:28:33 -040091 * decrease it, as threads-max is the much more relevant sysctl. */
92 if (limit > pid_max-1) {
93 sprintf(buffer, "%" PRIu64, limit+1); /* Add one, since PID 0 is not a valid PID */
94- r = write_string_file("/proc/sys/kernel/pid_max", buffer, WRITE_STRING_FILE_DISABLE_BUFFER);
95+ r = write_string_file("/proc/sys/kernel/pid_max", buffer, 0);
96 if (r < 0)
97 return r;
98 }
99
100 sprintf(buffer, "%" PRIu64, limit);
101- r = write_string_file("/proc/sys/kernel/threads-max", buffer, WRITE_STRING_FILE_DISABLE_BUFFER);
102+ r = write_string_file("/proc/sys/kernel/threads-max", buffer, 0);
103 if (r < 0) {
104 uint64_t threads_max;
105
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700106--- a/src/basic/sysctl-util.c
107+++ b/src/basic/sysctl-util.c
Patrick Williams213cb262021-08-07 19:21:33 -0500108@@ -93,7 +93,7 @@ int sysctl_write_ip_property(int af, con
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700109
110 log_debug("Setting '%s' to '%s'", p, value);
111
112- return write_string_file(p, value, WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
113+ return write_string_file(p, value, WRITE_STRING_FILE_VERIFY_ON_FAILURE | 0);
114 }
115
116 int sysctl_read(const char *property, char **ret) {
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600117--- a/src/basic/util.c
118+++ b/src/basic/util.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700119@@ -234,7 +234,7 @@ void disable_coredumps(void) {
Brad Bishop19323692019-04-05 15:28:33 -0400120 if (detect_container() > 0)
121 return;
122
123- r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", WRITE_STRING_FILE_DISABLE_BUFFER);
124+ r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0);
125 if (r < 0)
126 log_debug_errno(r, "Failed to turn off coredumps, ignoring: %m");
127 }
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600128--- a/src/binfmt/binfmt.c
129+++ b/src/binfmt/binfmt.c
Patrick Williams213cb262021-08-07 19:21:33 -0500130@@ -48,7 +48,7 @@ static int delete_rule(const char *rule)
Brad Bishop19323692019-04-05 15:28:33 -0400131 if (!fn)
132 return log_oom();
133
134- return write_string_file(fn, "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
135+ return write_string_file(fn, "-1", 0);
136 }
137
138 static int apply_rule(const char *rule) {
Patrick Williams213cb262021-08-07 19:21:33 -0500139@@ -56,7 +56,7 @@ static int apply_rule(const char *rule)
Brad Bishop19323692019-04-05 15:28:33 -0400140
141 (void) delete_rule(rule);
142
143- r = write_string_file("/proc/sys/fs/binfmt_misc/register", rule, WRITE_STRING_FILE_DISABLE_BUFFER);
144+ r = write_string_file("/proc/sys/fs/binfmt_misc/register", rule, 0);
145 if (r < 0)
146 return log_error_errno(r, "Failed to add binary format: %m");
147
Patrick Williams213cb262021-08-07 19:21:33 -0500148@@ -223,7 +223,7 @@ static int run(int argc, char *argv[]) {
Brad Bishop19323692019-04-05 15:28:33 -0400149 }
150
151 /* Flush out all rules */
Brad Bishopa34c0302019-09-23 22:34:48 -0400152- (void) write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
153+ (void) write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", 0);
Brad Bishop19323692019-04-05 15:28:33 -0400154
155 STRV_FOREACH(f, files) {
156 k = apply_file(*f, true);
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600157--- a/src/core/main.c
158+++ b/src/core/main.c
Patrick Williams213cb262021-08-07 19:21:33 -0500159@@ -1402,7 +1402,7 @@ static int bump_unix_max_dgram_qlen(void
Brad Bishop19323692019-04-05 15:28:33 -0400160 if (v >= DEFAULT_UNIX_MAX_DGRAM_QLEN)
161 return 0;
162
163- r = write_string_filef("/proc/sys/net/unix/max_dgram_qlen", WRITE_STRING_FILE_DISABLE_BUFFER, "%lu", DEFAULT_UNIX_MAX_DGRAM_QLEN);
164+ r = write_string_filef("/proc/sys/net/unix/max_dgram_qlen", 0, "%lu", DEFAULT_UNIX_MAX_DGRAM_QLEN);
165 if (r < 0)
166 return log_full_errno(IN_SET(r, -EROFS, -EPERM, -EACCES) ? LOG_DEBUG : LOG_WARNING, r,
167 "Failed to bump AF_UNIX datagram queue length, ignoring: %m");
Patrick Williams213cb262021-08-07 19:21:33 -0500168@@ -1679,7 +1679,7 @@ static void initialize_core_pattern(bool
Brad Bishop19323692019-04-05 15:28:33 -0400169 if (getpid_cached() != 1)
170 return;
171
172- r = write_string_file("/proc/sys/kernel/core_pattern", arg_early_core_pattern, WRITE_STRING_FILE_DISABLE_BUFFER);
173+ r = write_string_file("/proc/sys/kernel/core_pattern", arg_early_core_pattern, 0);
174 if (r < 0)
175 log_warning_errno(r, "Failed to write '%s' to /proc/sys/kernel/core_pattern, ignoring: %m", arg_early_core_pattern);
176 }
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600177--- a/src/core/smack-setup.c
178+++ b/src/core/smack-setup.c
Patrick Williams213cb262021-08-07 19:21:33 -0500179@@ -323,17 +323,17 @@ int mac_smack_setup(bool *loaded_policy)
Brad Bishop19323692019-04-05 15:28:33 -0400180 }
181
182 #ifdef SMACK_RUN_LABEL
183- r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
184+ r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, 0);
185 if (r < 0)
186 log_warning_errno(r, "Failed to set SMACK label \"" SMACK_RUN_LABEL "\" on self: %m");
187- r = write_string_file("/sys/fs/smackfs/ambient", SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
188+ r = write_string_file("/sys/fs/smackfs/ambient", SMACK_RUN_LABEL, 0);
189 if (r < 0)
190 log_warning_errno(r, "Failed to set SMACK ambient label \"" SMACK_RUN_LABEL "\": %m");
191 r = write_string_file("/sys/fs/smackfs/netlabel",
192- "0.0.0.0/0 " SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
193+ "0.0.0.0/0 " SMACK_RUN_LABEL, 0);
194 if (r < 0)
195 log_warning_errno(r, "Failed to set SMACK netlabel rule \"0.0.0.0/0 " SMACK_RUN_LABEL "\": %m");
196- r = write_string_file("/sys/fs/smackfs/netlabel", "127.0.0.1 -CIPSO", WRITE_STRING_FILE_DISABLE_BUFFER);
197+ r = write_string_file("/sys/fs/smackfs/netlabel", "127.0.0.1 -CIPSO", 0);
198 if (r < 0)
199 log_warning_errno(r, "Failed to set SMACK netlabel rule \"127.0.0.1 -CIPSO\": %m");
200 #endif
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600201--- a/src/hibernate-resume/hibernate-resume.c
202+++ b/src/hibernate-resume/hibernate-resume.c
Brad Bishop19323692019-04-05 15:28:33 -0400203@@ -45,7 +45,7 @@ int main(int argc, char *argv[]) {
204 return EXIT_FAILURE;
205 }
206
207- r = write_string_file("/sys/power/resume", major_minor, WRITE_STRING_FILE_DISABLE_BUFFER);
208+ r = write_string_file("/sys/power/resume", major_minor, 0);
209 if (r < 0) {
210 log_error_errno(r, "Failed to write '%s' to /sys/power/resume: %m", major_minor);
211 return EXIT_FAILURE;
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600212--- a/src/libsystemd/sd-device/sd-device.c
213+++ b/src/libsystemd/sd-device/sd-device.c
Patrick Williams213cb262021-08-07 19:21:33 -0500214@@ -2096,7 +2096,7 @@ _public_ int sd_device_set_sysattr_value
Brad Bishop19323692019-04-05 15:28:33 -0400215 if (!value)
216 return -ENOMEM;
217
218- r = write_string_file(path, value, WRITE_STRING_FILE_DISABLE_BUFFER | WRITE_STRING_FILE_NOFOLLOW);
219+ r = write_string_file(path, value, 0 | WRITE_STRING_FILE_NOFOLLOW);
220 if (r < 0) {
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700221 /* On failure, clear cache entry, as we do not know how it fails. */
222 device_remove_cached_sysattr_value(device, sysattr);
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600223--- a/src/nspawn/nspawn-cgroup.c
224+++ b/src/nspawn/nspawn-cgroup.c
Patrick Williams213cb262021-08-07 19:21:33 -0500225@@ -124,7 +124,7 @@ int sync_cgroup(pid_t pid, CGroupUnified
Brad Bishopa34c0302019-09-23 22:34:48 -0400226 fn = strjoina(tree, cgroup, "/cgroup.procs");
Brad Bishop19323692019-04-05 15:28:33 -0400227
228 sprintf(pid_string, PID_FMT, pid);
Brad Bishopa34c0302019-09-23 22:34:48 -0400229- r = write_string_file(fn, pid_string, WRITE_STRING_FILE_DISABLE_BUFFER|WRITE_STRING_FILE_MKDIR_0755);
230+ r = write_string_file(fn, pid_string, WRITE_STRING_FILE_MKDIR_0755);
Brad Bishop19323692019-04-05 15:28:33 -0400231 if (r < 0) {
232 log_error_errno(r, "Failed to move process: %m");
233 goto finish;
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600234--- a/src/nspawn/nspawn.c
235+++ b/src/nspawn/nspawn.c
Patrick Williams213cb262021-08-07 19:21:33 -0500236@@ -2751,7 +2751,7 @@ static int reset_audit_loginuid(void) {
Brad Bishop19323692019-04-05 15:28:33 -0400237 if (streq(p, "4294967295"))
238 return 0;
239
240- r = write_string_file("/proc/self/loginuid", "4294967295", WRITE_STRING_FILE_DISABLE_BUFFER);
241+ r = write_string_file("/proc/self/loginuid", "4294967295", 0);
242 if (r < 0) {
243 log_error_errno(r,
244 "Failed to reset audit login UID. This probably means that your kernel is too\n"
Patrick Williams213cb262021-08-07 19:21:33 -0500245@@ -4148,7 +4148,7 @@ static int setup_uid_map(
246 return log_oom();
Brad Bishop19323692019-04-05 15:28:33 -0400247
248 xsprintf(uid_map, "/proc/" PID_FMT "/uid_map", pid);
Patrick Williams213cb262021-08-07 19:21:33 -0500249- r = write_string_file(uid_map, s, WRITE_STRING_FILE_DISABLE_BUFFER);
250+ r = write_string_file(uid_map, s, 0);
Brad Bishop19323692019-04-05 15:28:33 -0400251 if (r < 0)
252 return log_error_errno(r, "Failed to write UID map: %m");
253
Patrick Williams213cb262021-08-07 19:21:33 -0500254@@ -4158,7 +4158,7 @@ static int setup_uid_map(
255 return log_oom();
256
Brad Bishop19323692019-04-05 15:28:33 -0400257 xsprintf(uid_map, "/proc/" PID_FMT "/gid_map", pid);
Patrick Williams213cb262021-08-07 19:21:33 -0500258- r = write_string_file(uid_map, s, WRITE_STRING_FILE_DISABLE_BUFFER);
259+ r = write_string_file(uid_map, s, 0);
Brad Bishop19323692019-04-05 15:28:33 -0400260 if (r < 0)
261 return log_error_errno(r, "Failed to write GID map: %m");
262
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600263--- a/src/shared/cgroup-setup.c
264+++ b/src/shared/cgroup-setup.c
Patrick Williams213cb262021-08-07 19:21:33 -0500265@@ -267,7 +267,7 @@ int cg_attach(const char *controller, co
Andrew Geissler82c905d2020-04-13 13:39:40 -0500266
267 xsprintf(c, PID_FMT "\n", pid);
268
269- r = write_string_file(fs, c, WRITE_STRING_FILE_DISABLE_BUFFER);
270+ r = write_string_file(fs, c, 0);
271 if (r < 0)
272 return r;
273
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600274@@ -799,7 +799,7 @@ int cg_enable_everywhere(
Andrew Geissler82c905d2020-04-13 13:39:40 -0500275 return log_debug_errno(errno, "Failed to open cgroup.subtree_control file of %s: %m", p);
276 }
277
278- r = write_string_stream(f, s, WRITE_STRING_FILE_DISABLE_BUFFER);
279+ r = write_string_stream(f, s, 0);
280 if (r < 0) {
281 log_debug_errno(r, "Failed to %s controller %s for %s (%s): %m",
282 FLAGS_SET(mask, bit) ? "enable" : "disable", n, p, fs);
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600283--- a/src/sleep/sleep.c
284+++ b/src/sleep/sleep.c
Patrick Williams213cb262021-08-07 19:21:33 -0500285@@ -46,7 +46,7 @@ static int write_hibernate_location_info
Andrew Geissler82c905d2020-04-13 13:39:40 -0500286 assert(hibernate_location->swap);
Brad Bishop19323692019-04-05 15:28:33 -0400287
Andrew Geissler82c905d2020-04-13 13:39:40 -0500288 xsprintf(resume_str, "%u:%u", major(hibernate_location->devno), minor(hibernate_location->devno));
289- r = write_string_file("/sys/power/resume", resume_str, WRITE_STRING_FILE_DISABLE_BUFFER);
290+ r = write_string_file("/sys/power/resume", resume_str, 0);
291 if (r < 0)
292 return log_debug_errno(r, "Failed to write partition device to /sys/power/resume for '%s': '%s': %m",
293 hibernate_location->swap->device, resume_str);
Patrick Williams213cb262021-08-07 19:21:33 -0500294@@ -73,7 +73,7 @@ static int write_hibernate_location_info
Andrew Geissler82c905d2020-04-13 13:39:40 -0500295 }
Brad Bishop19323692019-04-05 15:28:33 -0400296
Andrew Geissler82c905d2020-04-13 13:39:40 -0500297 xsprintf(offset_str, "%" PRIu64, hibernate_location->offset);
Brad Bishop19323692019-04-05 15:28:33 -0400298- r = write_string_file("/sys/power/resume_offset", offset_str, WRITE_STRING_FILE_DISABLE_BUFFER);
299+ r = write_string_file("/sys/power/resume_offset", offset_str, 0);
300 if (r < 0)
Andrew Geissler82c905d2020-04-13 13:39:40 -0500301 return log_debug_errno(r, "Failed to write swap file offset to /sys/power/resume_offset for '%s': '%s': %m",
302 hibernate_location->swap->device, offset_str);
Patrick Williams213cb262021-08-07 19:21:33 -0500303@@ -90,7 +90,7 @@ static int write_mode(char **modes) {
Brad Bishop19323692019-04-05 15:28:33 -0400304 STRV_FOREACH(mode, modes) {
305 int k;
306
307- k = write_string_file("/sys/power/disk", *mode, WRITE_STRING_FILE_DISABLE_BUFFER);
308+ k = write_string_file("/sys/power/disk", *mode, 0);
309 if (k >= 0)
310 return 0;
311
Patrick Williams213cb262021-08-07 19:21:33 -0500312@@ -112,7 +112,7 @@ static int write_state(FILE **f, char **
Brad Bishop19323692019-04-05 15:28:33 -0400313 STRV_FOREACH(state, states) {
314 int k;
315
316- k = write_string_stream(*f, *state, WRITE_STRING_FILE_DISABLE_BUFFER);
317+ k = write_string_stream(*f, *state, 0);
318 if (k >= 0)
319 return 0;
320 log_debug_errno(k, "Failed to write '%s' to /sys/power/state: %m", *state);
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600321--- a/src/vconsole/vconsole-setup.c
322+++ b/src/vconsole/vconsole-setup.c
Patrick Williams213cb262021-08-07 19:21:33 -0500323@@ -116,7 +116,7 @@ static int toggle_utf8_vc(const char *na
Brad Bishop19323692019-04-05 15:28:33 -0400324 static int toggle_utf8_sysfs(bool utf8) {
325 int r;
326
327- r = write_string_file("/sys/module/vt/parameters/default_utf8", one_zero(utf8), WRITE_STRING_FILE_DISABLE_BUFFER);
328+ r = write_string_file("/sys/module/vt/parameters/default_utf8", one_zero(utf8), 0);
329 if (r < 0)
330 return log_warning_errno(r, "Failed to %s sysfs UTF-8 flag: %m", enable_disable(utf8));
331
Patrick Williams213cb262021-08-07 19:21:33 -0500332--- a/src/shared/mount-util.c
333+++ b/src/shared/mount-util.c
334@@ -1019,13 +1019,13 @@ static int make_userns(uid_t uid_shift,
335 xsprintf(line, UID_FMT " " UID_FMT " " UID_FMT "\n", 0, uid_shift, uid_range);
336
337 xsprintf(uid_map, "/proc/" PID_FMT "/uid_map", pid);
338- r = write_string_file(uid_map, line, WRITE_STRING_FILE_DISABLE_BUFFER);
339+ r = write_string_file(uid_map, line, 0);
340 if (r < 0)
341 return log_error_errno(r, "Failed to write UID map: %m");
342
343 /* We always assign the same UID and GID ranges */
344 xsprintf(uid_map, "/proc/" PID_FMT "/gid_map", pid);
345- r = write_string_file(uid_map, line, WRITE_STRING_FILE_DISABLE_BUFFER);
346+ r = write_string_file(uid_map, line, 0);
347 if (r < 0)
348 return log_error_errno(r, "Failed to write GID map: %m");
349
350--- a/src/shared/smack-util.c
351+++ b/src/shared/smack-util.c
352@@ -114,7 +114,7 @@ int mac_smack_apply_pid(pid_t pid, const
353 return 0;
354
355 p = procfs_file_alloca(pid, "attr/current");
356- r = write_string_file(p, label, WRITE_STRING_FILE_DISABLE_BUFFER);
357+ r = write_string_file(p, label, 0);
358 if (r < 0)
359 return r;
360