]> git.wh0rd.org - dump.git/commitdiff
Fix restore -C to handle correctly directories containing a file with the same name...
authorStelian Pop <stelian@popies.net>
Fri, 14 Jan 2005 13:04:07 +0000 (13:04 +0000)
committerStelian Pop <stelian@popies.net>
Fri, 14 Jan 2005 13:04:07 +0000 (13:04 +0000)
CHANGES
restore/symtab.c

diff --git a/CHANGES b/CHANGES
index f56eb80cda6b53228074577cf2c7092dc5792102..cdeb39609fc8023626e3fd241b3588c39803901f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,4 @@
-$Id: CHANGES,v 1.266 2005/01/14 13:01:32 stelian Exp $
+$Id: CHANGES,v 1.267 2005/01/14 13:04:07 stelian Exp $
 
 Changes between versions 0.4b38 and 0.4b39 (released ???????????????)
 =====================================================================
 
 Changes between versions 0.4b38 and 0.4b39 (released ???????????????)
 =====================================================================
@@ -17,6 +17,13 @@ Changes between versions 0.4b38 and 0.4b39 (released ???????????????)
 3.     Silenced the failure to call fgetflags() when comparing an
        entry which has no ext2 attributes (as in lsattr()).
 
 3.     Silenced the failure to call fgetflags() when comparing an
        entry which has no ext2 attributes (as in lsattr()).
 
+4.     Fix a brown paper bug in restore -C which broke restore and
+       caused modifications on the filesystem being compared
+       (directories containing a file with the same name as the
+       directory get renamed to RSTTMP...). Thanks to Kenneth Porter
+       <shiva@sewingwitch.com> for finding the bug and helping me
+       reproduce it.
+
 Changes between versions 0.4b37 and 0.4b38 (released January 7, 2005)
 =====================================================================
 
 Changes between versions 0.4b37 and 0.4b38 (released January 7, 2005)
 =====================================================================
 
index 8cd384c51dd36a7f2ba622f75f0214bdf93fd268..4a2e1abe969d5053c91864a16f93a635ede683cf 100644 (file)
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: symtab.c,v 1.23 2004/12/14 14:07:58 stelian Exp $";
+       "$Id: symtab.c,v 1.24 2005/01/14 13:04:07 stelian Exp $";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -189,9 +189,16 @@ lookupname(char *name)
        char *np, *cp;
        char buf[MAXPATHLEN];
 
        char *np, *cp;
        char buf[MAXPATHLEN];
 
+       ep = lookupino(ROOTINO);
+
        cp = name;
        cp = name;
+       if (*cp == '.')
+               ++cp;
+       if (*cp == '/')
+               ++cp;
+       if (*cp == '\0')
+               return ep;
 
 
-       ep = lookupino(ROOTINO);
        while (ep != NULL) {
                for (np = buf; *cp != '/' && *cp != '\0' &&
                                np < &buf[sizeof(buf)]; )
        while (ep != NULL) {
                for (np = buf; *cp != '/' && *cp != '\0' &&
                                np < &buf[sizeof(buf)]; )
@@ -202,8 +209,7 @@ lookupname(char *name)
 
                oldep = ep;
 
 
                oldep = ep;
 
-               if (strcmp(ep->e_name, buf) != 0 &&
-                   ep->e_entries != NULL) {
+               if (ep->e_entries != NULL) {
 
                        ep = ep->e_entries[dir_hash(buf)];
                        for ( ; ep != NULL; ep = ep->e_sibling)
 
                        ep = ep->e_entries[dir_hash(buf)];
                        for ( ; ep != NULL; ep = ep->e_sibling)