From: Michael Tremer Date: Wed, 8 Mar 2023 11:13:04 +0000 (+0000) Subject: archive: Make sure the destination directory exists when copying X-Git-Tag: 0.9.29~356 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b9576ed35f0845b60c8fbc1f1c9246e7622f9ae;p=pakfire.git archive: Make sure the destination directory exists when copying Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/archive.c b/src/libpakfire/archive.c index dfa95cc49..db9d3ace4 100644 --- a/src/libpakfire/archive.c +++ b/src/libpakfire/archive.c @@ -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)