From: Michael Tremer Date: Thu, 22 Apr 2021 11:31:00 +0000 (+0000) Subject: pakfire: bind: Ensure that the source directory exists X-Git-Tag: 0.9.28~1285^2~275 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6450bc97450a970022da163651f82f4f56dfedb;p=pakfire.git pakfire: bind: Ensure that the source directory exists Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index fa1396155..2d7e50f0e 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -807,6 +807,11 @@ PAKFIRE_EXPORT int pakfire_bind(Pakfire pakfire, const char* src, const char* ds DEBUG(pakfire, "Mounting %s to %s\n", src, mountpoint); + // Does the source exist? + r = pakfire_mkdir(src, 0); + if (r && errno != EEXIST) + return r; + // Make sure the directory exists r = pakfire_mkdir(mountpoint, 0); if (r && errno != EEXIST)