From: Eric Bollengier Date: Wed, 21 Nov 2018 10:24:22 +0000 (+0100) Subject: Fix #4386 About incorrect permission on directories after a restore with replace... X-Git-Tag: Release-9.4.0~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b70d2572fa0124f85e9225d2833408f17a75cde;p=thirdparty%2Fbacula.git Fix #4386 About incorrect permission on directories after a restore with replace=ifnewer --- diff --git a/bacula/src/findlib/create_file.c b/bacula/src/findlib/create_file.c index 9488dbc5a..1e3b8f717 100644 --- a/bacula/src/findlib/create_file.c +++ b/bacula/src/findlib/create_file.c @@ -116,6 +116,11 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) exists = true; switch (replace) { case REPLACE_IFNEWER: + /* Set attributes if we created this directory */ + if (attr->type == FT_DIREND && path_list_lookup(jcr, attr->ofname)) { + break; + } + if (attr->statp.st_mtime <= mstatp.st_mtime) { Qmsg(jcr, M_SKIPPED, 0, _("File skipped. Not newer: %s\n"), attr->ofname); return CF_SKIP;