]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
debug-generator: create prefix dir of generate unit file 34781/head
authorLennart Poettering <lennart@poettering.net>
Tue, 15 Oct 2024 13:36:06 +0000 (15:36 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 15 Oct 2024 16:21:04 +0000 (18:21 +0200)
Strictly speaking, it's more correct if we create the prefix path before
writing our unit file.

src/debug-generator/debug-generator.c

index 76379806896a576c4e261566ebe17e8565450bc5..98670a6c906a507747ecf7a7f43a1341d7b4470d 100644 (file)
@@ -206,7 +206,7 @@ static int process_unit_credentials(const char *credentials_dir) {
                         if (!p)
                                 return log_oom();
 
-                        r = write_string_file_atomic_label(p, d);
+                        r = write_string_file_at_label(AT_FDCWD, p, d, WRITE_STRING_FILE_CREATE|WRITE_STRING_FILE_ATOMIC|WRITE_STRING_FILE_MKDIR_0755);
                         if (r < 0) {
                                 log_warning_errno(r, "Failed to write unit file '%s' from credential '%s', ignoring: %m",
                                                   unit, de->d_name);