]> git.wh0rd.org - dump.git/commitdiff
Fix the EA set failures when restoring immutable files
authorStelian Pop <stelian@popies.net>
Thu, 22 Feb 2007 20:16:23 +0000 (20:16 +0000)
committerStelian Pop <stelian@popies.net>
Thu, 22 Feb 2007 20:16:23 +0000 (20:16 +0000)
CHANGES
restore/dirs.c
restore/tape.c

diff --git a/CHANGES b/CHANGES
index 584f030c34a1f8d44ee176d859543b2fac97c21f..00b92f5866f84c7f04e4719d6a8a18d468755c93 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.285 2007/02/22 20:12:50 stelian Exp $
+$Id: CHANGES,v 1.286 2007/02/22 20:16:23 stelian Exp $
 
 Changes between versions 0.4b41 and 0.4b42 (released xxxxxxxxxxxxxxx)
 =====================================================================
 
 Changes between versions 0.4b41 and 0.4b42 (released xxxxxxxxxxxxxxx)
 =====================================================================
@@ -17,6 +17,9 @@ Changes between versions 0.4b41 and 0.4b42 (released xxxxxxxxxxxxxxx)
        (see http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=189845
        for details)
 
        (see http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=189845
        for details)
 
+4.     Fix EA set failures when restoring immutable files. Thanks
+       to Andrew Kroeger for the patch.
+
 Changes between versions 0.4b40 and 0.4b41 (released January 2, 2006)
 =====================================================================
 
 Changes between versions 0.4b40 and 0.4b41 (released January 2, 2006)
 =====================================================================
 
index 88dfc69c46befe9e5ace90d812ded1c6a69a6b50..509d35fd7822e1d65c891cc249f6830b1ee5f438 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: dirs.c,v 1.33 2005/05/28 18:34:47 stelian Exp $";
+       "$Id: dirs.c,v 1.34 2007/02/22 20:16:23 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #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);
                        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);
                        if (node.flags)
 #ifdef __linux__
                                (void) lsetflags(cp, node.flags);
@@ -719,10 +723,6 @@ setdirmodes(int flags)
                                (void) chflags(cp, node.flags);
 #endif
 #endif
                                (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))
                }
        }
        if (ferror(mf))
index 7378b208aad0b38bab9c38909627d6736c001564..3d673b62b740c9c1057e70a2ef6c3d0cd9dec469 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: tape.c,v 1.91 2007/02/22 20:12:50 stelian Exp $";
+       "$Id: tape.c,v 1.92 2007/02/22 20:16:23 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #endif /* not lint */
 
 #include <config.h>
@@ -908,6 +908,8 @@ extractfile(struct entry *ep, int doremove)
                }
                (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid);
                (void) chmod(name, mode);
                }
                (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid);
                (void) chmod(name, mode);
+               extractattr(name);
+               utimes(name, timep);
                if (flags)
 #ifdef  __linux__
                        (void) lsetflags(name, flags);
                if (flags)
 #ifdef  __linux__
                        (void) lsetflags(name, flags);
@@ -922,8 +924,6 @@ extractfile(struct entry *ep, int doremove)
 #endif
 #endif
                skipfile();
 #endif
 #endif
                skipfile();
-               extractattr(name);
-               utimes(name, timep);
                return (GOOD);
 
        case IFCHR:
                return (GOOD);
 
        case IFCHR:
@@ -944,6 +944,8 @@ extractfile(struct entry *ep, int doremove)
                }
                (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid);
                (void) chmod(name, mode);
                }
                (void) chown(name, curfile.dip->di_uid, curfile.dip->di_gid);
                (void) chmod(name, mode);
+               extractattr(name);
+               utimes(name, timep);
                if (flags)
 #ifdef __linux__
                        {
                if (flags)
 #ifdef __linux__
                        {
@@ -964,8 +966,6 @@ extractfile(struct entry *ep, int doremove)
 #endif
 #endif
                skipfile();
 #endif
 #endif
                skipfile();
-               extractattr(name);
-               utimes(name, timep);
                return (GOOD);
 
        case IFREG:
                return (GOOD);
 
        case IFREG:
@@ -994,6 +994,8 @@ extractfile(struct entry *ep, int doremove)
                        skipfile();
                (void) chown(name, luid, lgid);
                (void) chmod(name, mode);
                        skipfile();
                (void) chown(name, luid, lgid);
                (void) chmod(name, mode);
+               extractattr(name);
+               utimes(name, timep);
                if (flags)
 #ifdef __linux__
                        (void) lsetflags(name, flags);
                if (flags)
 #ifdef __linux__
                        (void) lsetflags(name, flags);
@@ -1007,8 +1009,6 @@ extractfile(struct entry *ep, int doremove)
                        (void) chflags(name, flags);
 #endif
 #endif
                        (void) chflags(name, flags);
 #endif
 #endif
-               extractattr(name);
-               utimes(name, timep);
                return (GOOD);
        }
        }
                return (GOOD);
        }
        }
@@ -1216,8 +1216,8 @@ extractresourceufs(char *name)
                (void) fchown(ofile, uid, gid);
                (void) fchmod(ofile, mode);
                (void) close(ofile);
                (void) fchown(ofile, uid, gid);
                (void) fchmod(ofile, mode);
                (void) close(ofile);
-               (void) lsetflags(oFileRsrc, flags);
                utimes(oFileRsrc, timep);
                utimes(oFileRsrc, timep);
+               (void) lsetflags(oFileRsrc, flags);
                return (GOOD);
        }
        /* NOTREACHED */
                return (GOOD);
        }
        /* NOTREACHED */