hurdextras-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tarfs BUGS ChangeLog store-gzip.c tar.c tarfs.c...


From: Ludovic Courtes
Subject: tarfs BUGS ChangeLog store-gzip.c tar.c tarfs.c...
Date: Wed, 08 Mar 2006 08:06:46 +0000

CVSROOT:        /sources/hurdextras
Module name:    tarfs
Branch:         
Changes by:     Ludovic Courtes <address@hidden>        06/03/08 08:06:46

Modified files:
        .              : BUGS ChangeLog store-gzip.c tar.c tarfs.c 
                         zipstores.c 

Log message:
        Applied patch from Ben Asselstine; passes `ustar-all-quickest.tar' now.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/hurdextras/tarfs/BUGS.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/hurdextras/tarfs/ChangeLog.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/hurdextras/tarfs/store-gzip.c.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/hurdextras/tarfs/tar.c.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/hurdextras/tarfs/tarfs.c.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/hurdextras/tarfs/zipstores.c.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: tarfs/BUGS
diff -u tarfs/BUGS:1.1.1.1 tarfs/BUGS:1.2
--- tarfs/BUGS:1.1.1.1  Fri Jan 31 18:37:28 2003
+++ tarfs/BUGS  Wed Mar  8 08:06:46 2006
@@ -4,7 +4,6 @@
 
 1. General
 
-* Doesn't pass the "ustar-all-quickest.tar" test file with long links.
 * io_map () not implemented (gcc uses it unfortunately).
 * netfs.c (netfs_get_dirents): too much memory may be allocated (mmap'd).
 
Index: tarfs/ChangeLog
diff -u tarfs/ChangeLog:1.1.1.1 tarfs/ChangeLog:1.2
--- tarfs/ChangeLog:1.1.1.1     Fri Jan 31 18:41:09 2003
+++ tarfs/ChangeLog     Wed Mar  8 08:06:46 2006
@@ -1,3 +1,16 @@
+2006-03-07  Ben Asselstine  <address@hidden>
+
+       * store-gzip.c (read_next): remove static from nested
+         function declaration.
+       * tarfs.c (sync_archive): Likewise.
+       (read_archive): Likewise.
+       * zipstores.c (do_write): Likewise.
+       * tar.c (read_header): Correctly handle archive names and
+       archive link names when they are exactly NAMSIZ characters long.
+       * tarfs.c (add_header): Likewise.
+       * TODO: Removed `ustar-all-quickest.tar' which passes now.
+
+
 2002-12-04
 
        * tarlist.c (tar_put_item): Fixed a bug in placing "foo/bar".
Index: tarfs/store-gzip.c
diff -u tarfs/store-gzip.c:1.1.1.1 tarfs/store-gzip.c:1.2
--- tarfs/store-gzip.c:1.1.1.1  Fri Jan 31 18:40:20 2003
+++ tarfs/store-gzip.c  Wed Mar  8 08:06:46 2006
@@ -178,7 +178,7 @@
   size_t amount, index = 0;
 
   /* Load next block and continue */
-  static inline
+  inline
   error_t read_next ()
   {
     error_t err;
Index: tarfs/tar.c
diff -u tarfs/tar.c:1.1.1.1 tarfs/tar.c:1.2
--- tarfs/tar.c:1.1.1.1 Fri Jan 31 18:37:41 2003
+++ tarfs/tar.c Wed Mar  8 08:06:46 2006
@@ -204,6 +204,13 @@
   static char *next_lonname = NULL, *next_lonlink = NULL;
   char *current_file_name, *current_link_name;
   struct stat hstat;           /* Stat struct corresponding */
+  char arch_name[NAMSIZ + 1];
+  char arch_linkname[NAMSIZ + 1];
+
+  memcpy (arch_name, header->header.arch_name, NAMSIZ);
+  arch_name [NAMSIZ] = '\0';
+  memcpy (arch_linkname, header->header.arch_linkname, NAMSIZ);
+  arch_linkname [NAMSIZ] = '\0';
 
 
 recurse:
@@ -249,9 +256,10 @@
   /*
    * linkflag on BSDI tar (pax) always '\000'
    */
+
   if (header->header.linkflag == '\000' &&
-      strlen (header->header.arch_name) &&
-      header->header.arch_name[strlen (header->header.arch_name) - 1] == '/')
+      strlen (arch_name) &&
+      arch_name[strlen (arch_name) - 1] == '/')
     header->header.linkflag = LF_DIR;
 
   /*
@@ -262,7 +270,6 @@
   else
     hstat.st_size = from_oct (1 + 12, header->header.size);
 
-  header->header.arch_name[NAMSIZ - 1] = '\0';
   if (header->header.linkflag == LF_LONGNAME
       || header->header.linkflag == LF_LONGLINK)
     {
@@ -289,7 +296,7 @@
 
       current_file_name = (next_lonname
                           ? next_lonname
-                          : strdup (header->header.arch_name));
+                          : strdup (arch_name));
       len = strlen (current_file_name);
       if (current_file_name[len - 1] == '/')
        {
@@ -297,9 +304,10 @@
          isdir = 1;
        }
 
+
       current_link_name = (next_lonlink
                           ? next_lonlink
-                          : strdup (header->header.arch_linkname));
+                          : strdup (arch_linkname));
       len = strlen (current_link_name);
       if (len && current_link_name[len - 1] == '/')
        current_link_name[len - 1] = 0;
Index: tarfs/tarfs.c
diff -u tarfs/tarfs.c:1.1.1.1 tarfs/tarfs.c:1.2
--- tarfs/tarfs.c:1.1.1.1       Fri Jan 31 18:39:27 2003
+++ tarfs/tarfs.c       Wed Mar  8 08:06:46 2006
@@ -331,11 +331,15 @@
   static struct tar_item *last_item = NULL;
   struct node *dir, *new = NULL;
   char *name, *notfound, *retry;
+  char arch_name[NAMSIZ + 1];
   
   assert (hdr != NULL);
 
   dir = netfs_root_node;
-  name = D (hdr->header.arch_name);
+
+  memcpy (arch_name, hdr->header.arch_name, NAMSIZ);
+  arch_name[NAMSIZ] = '\0';
+  name = strdup (arch_name);
   assert (name);
   debug (("name = %s", name));
 
@@ -357,6 +361,7 @@
       NEW_NODE_INFO (new);*/
       free (name);
       name = retry;
+      dir = new;
     }
   }
   while (retry);
@@ -387,7 +392,9 @@
       debug (("Hard linking \"%s\"", name));
 
       /* Get the target's node first. */
-      tgname = strdup (hdr->header.arch_linkname);
+      tgname = malloc (NAMSIZ + 1);
+      memcpy (tgname, hdr->header.arch_linkname, NAMSIZ);
+      tgname [NAMSIZ] = '\0';
       target = netfs_root_node;
       fs_find_node_path (&target, &retry, &notfound, tgname);
 
@@ -483,7 +490,7 @@
   mode_t mode = 0644;
 
   /* Sync the archive.  */
-  static void
+  void
   sync_archive ()
   {
     error_t tarfs_sync_fs (int wait);
@@ -498,7 +505,7 @@
   }
 
   /* Reads and parses a tar archive, possibly in a separate thread.  */
-  static void
+  void
   read_archive ()
   {
     error_t err;
Index: tarfs/zipstores.c
diff -u tarfs/zipstores.c:1.1.1.1 tarfs/zipstores.c:1.2
--- tarfs/zipstores.c:1.1.1.1   Fri Jan 31 18:40:59 2003
+++ tarfs/zipstores.c   Wed Mar  8 08:06:46 2006
@@ -267,7 +267,7 @@
     /* Check whether we need to write a gzip header */
     if (!zip->source->size)
     {
-      static error_t
+      error_t
       do_write (char *buf, size_t amount)
       {
        size_t len;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]