diff options
author | Daniel Mack <daniel@zonque.org> | 2015-07-06 19:27:20 -0400 |
---|---|---|
committer | Daniel Mack <daniel@zonque.org> | 2015-07-06 19:27:20 -0400 |
commit | ad118bda159d3f9c27c5a15ace54cf808a6e8788 (patch) | |
tree | 43eeba4758137b413f7f80f29dd41ded3004d051 /src/nspawn | |
parent | 4c1fc3e404d648c70bd2f50ac50aeac6ece8872e (diff) | |
download | systemd-ad118bda159d3f9c27c5a15ace54cf808a6e8788.tar.gz systemd-ad118bda159d3f9c27c5a15ace54cf808a6e8788.tar.bz2 systemd-ad118bda159d3f9c27c5a15ace54cf808a6e8788.zip |
tree-wide: fix write_string_file() user that should not create files
The latest consolidation cleanup of write_string_file() revealed some users
of that helper which should have used write_string_file_no_create() in the
past but didn't. Basically, all existing users that write to files in /sys
and /proc should not expect to write to a file which is not yet existant.
Diffstat (limited to 'src/nspawn')
-rw-r--r-- | src/nspawn/nspawn.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index c7f4d02855..d749eb49b6 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2508,7 +2508,7 @@ static int reset_audit_loginuid(void) { if (streq(p, "4294967295")) return 0; - r = write_string_file("/proc/self/loginuid", "4294967295", WRITE_STRING_FILE_CREATE); + r = write_string_file("/proc/self/loginuid", "4294967295", 0); if (r < 0) { log_error_errno(r, "Failed to reset audit login UID. This probably means that your kernel is too\n" @@ -4448,13 +4448,13 @@ static int setup_uid_map(pid_t pid) { xsprintf(uid_map, "/proc/" PID_FMT "/uid_map", pid); xsprintf(line, UID_FMT " " UID_FMT " " UID_FMT "\n", 0, arg_uid_shift, arg_uid_range); - r = write_string_file(uid_map, line, WRITE_STRING_FILE_CREATE); + r = write_string_file(uid_map, line, 0); if (r < 0) return log_error_errno(r, "Failed to write UID map: %m"); /* We always assign the same UID and GID ranges */ xsprintf(uid_map, "/proc/" PID_FMT "/gid_map", pid); - r = write_string_file(uid_map, line, WRITE_STRING_FILE_CREATE); + r = write_string_file(uid_map, line, 0); if (r < 0) return log_error_errno(r, "Failed to write GID map: %m"); |