]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
archive: Make sure the destination directory exists when copying
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 8 Mar 2023 11:13:04 +0000 (11:13 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 8 Mar 2023 11:13:04 +0000 (11:13 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/archive.c

index dfa95cc494e91f1ff60ad34a4de55b282c817f3b..db9d3ace42ea8265242e43aebf8708f1103a1b92 100644 (file)
@@ -819,6 +819,9 @@ int pakfire_archive_copy(struct pakfire_archive* archive, const char* path) {
        // Ensure we copy from the very beginning
        rewind(archive->f);
 
+       // Ensure the parent directory exists
+       pakfire_mkparentdir(path, 0755);
+
        // Open destination file
        FILE* f = fopen(path, "w");
        if (!f)