]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix #4386 About incorrect permission on directories after a restore with replace...
authorEric Bollengier <eric@baculasystems.com>
Wed, 21 Nov 2018 10:24:22 +0000 (11:24 +0100)
committerKern Sibbald <kern@sibbald.com>
Wed, 21 Nov 2018 12:21:05 +0000 (13:21 +0100)
bacula/src/findlib/create_file.c

index 9488dbc5a127b8111aca50e269a3c80ac979da33..1e3b8f717394c608c39da389c032b88faba27515 100644 (file)
@@ -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;