]> git.wh0rd.org - dump.git/blobdiff - restore/dirs.c
Fix the EA set failures when restoring immutable files
[dump.git] / restore / dirs.c
index b049f49007801c6caa8c70d755b38ecce9dbc860..509d35fd7822e1d65c891cc249f6830b1ee5f438 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: dirs.c,v 1.32 2005/05/02 15:10:46 stelian Exp $";
+       "$Id: dirs.c,v 1.34 2007/02/22 20:16:23 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -710,6 +710,10 @@ setdirmodes(int flags)
                        cp = myname(ep);
                        (void) chown(cp, node.uid, node.gid);
                        (void) chmod(cp, node.mode);
+                       utimes(cp, node.timep);
+                       if (node.xattr)
+                               xattr_extract(cp, xattr);
+                       ep->e_flags &= ~NEW;
                        if (node.flags)
 #ifdef __linux__
                                (void) lsetflags(cp, node.flags);
@@ -719,10 +723,6 @@ setdirmodes(int flags)
                                (void) chflags(cp, node.flags);
 #endif
 #endif
-                       utimes(cp, node.timep);
-                       if (node.xattr)
-                               xattr_extract(cp, xattr);
-                       ep->e_flags &= ~NEW;
                }
        }
        if (ferror(mf))
@@ -769,10 +769,10 @@ comparedirmodes(void)
                if (ep == NULL) {
                        panic("cannot find directory inode %d\n", node.ino);
                } else {
-                       cp = myname(ep);
                        struct STAT sb;
                        unsigned long newflags;
 
+                       cp = myname(ep);
                        if (LSTAT(cp, &sb) < 0) {
                                warn("unable to stat %s", cp);
                                do_compare_error;