The following is a patch for a fix to the source files, but I haven't
fixed the debian/rules file, since I don't know how you want to handle
it.
The problem turns out to be a fundamental assumption that a long is 32
bits.  The header includes a 32 bit number and its complement (both
defined as longs), and the program verifies integrity by adding these
together and comparing the result to 0L.  Of course with 64 bit longs
the result is not zero, so the comparison fails, but it only checks
before modifying the archive.  The result is it does not fail when
reading, extracting, or creating an archive.  The program can easily
be tested for this problem by creating an archive with a file
(eg. 'zoo -a zootest.zoo <testfile>'), and then repeating the command.
It should fail when trying to add the second time.

The following is a patch to the files, where I used a define of LONG64
to ifdef the change.  Notice that the change I used assumes that an
int is 32 bits, which I think is true of all x86 (not just AMD64), and
probably all other debian 32-bit architectures.



################ start of patch ##########
--- orig/makefile       2005-10-30 11:12:48.000000000 -0800
+++ makefile    2005-10-31 19:37:30.847038046 -0800
@@ -54,6 +54,7 @@
        @echo "convex:       Convex C200 series"
        @echo "sysv:         System V Release 2 or 3; or SCO Xenix"
        @echo "linux:        Linux"
+       @echo "linux64:      Linux with 64 bit long"
        @echo "scodos:       Cross-compiler under SCO Xenix/UNIX for MS-DOS"
        @echo "xenix286:     Older Xenix/286 (not tested)"
        @echo "xenix68k:     Xenix/68000 (not tested)"
@@ -95,6 +96,10 @@
 bsd:
        $(MAKE) CFLAGS="-c $(OPTIM) -DBSD4_3" $(TARGETS)
 
+# Linux64
+linux64:
+       $(MAKE) CC="gcc" CFLAGS="-c $(OPTIM) $(LINTFLAGS) -DLINUX -DLONG64 
-DANSI_HDRS" $(TARGETS)
+
 # Linux
 linux:
        $(MAKE) CC="gcc" CFLAGS="-c $(OPTIM) $(LINTFLAGS) -DLINUX -DANSI_HDRS" 
$(TARGETS)
--- orig/misc.c 2005-10-30 11:12:48.000000000 -0800
+++ misc.c      2005-10-31 19:35:28.437249303 -0800
@@ -173,7 +173,11 @@
 
    frd_zooh (header, zoo_file);
 
+#ifdef LONG64
+   if ((int)(header->zoo_start + header->zoo_minus) != 0)
+#else
    if ((header->zoo_start + header->zoo_minus) != 0L)
+#endif
       prterror ('f', failed_consistency);
    if (ver_too_high (header))
       prterror ('f', wrong_version, header->major_ver, header->minor_ver);
--- orig/zoodel.c       1991-07-05 09:00:00.000000000 -0700
+++ zoodel.c    2005-10-31 19:32:25.463491779 -0800
@@ -138,7 +138,11 @@
    
    /* read archive header */
    frd_zooh (&zoo_header, zoo_file);
+#ifdef LONG64
+   if ((int)(zoo_header.zoo_start + zoo_header.zoo_minus) != 0)
+#else
    if ((zoo_header.zoo_start + zoo_header.zoo_minus) != 0L)
+#endif
       prterror ('f', failed_consistency);
    if (ver_too_high (&zoo_header))
       prterror ('f', wrong_version, zoo_header.major_ver, 
zoo_header.minor_ver);
--- orig/zooext.c       2005-10-30 11:12:48.000000000 -0800
+++ zooext.c    2005-10-31 19:32:38.774946375 -0800
@@ -164,7 +164,11 @@
 } else {
    /* read header */
    frd_zooh (&zoo_header, zoo_file);
+#ifdef LONG64
+   if ((int)(zoo_header.zoo_start + zoo_header.zoo_minus) != 0) {
+#else
    if ((zoo_header.zoo_start + zoo_header.zoo_minus) != 0L) {
+#endif
       prterror ('w', failed_consistency);
       bad_header++;
                exit_status = 1;
--- orig/zoopack.c      2005-10-30 11:12:48.000000000 -0800
+++ zoopack.c   2005-10-31 19:32:49.517699187 -0800
@@ -140,7 +140,11 @@
 /* Read the header of the old archive. */
 frd_zooh(&old_zoo_header, zoo_file);
 
+#ifdef LONG64
+if ((int)(old_zoo_header.zoo_start + old_zoo_header.zoo_minus) != 0) {
+#else
 if ((old_zoo_header.zoo_start + old_zoo_header.zoo_minus) != 0L) {
+#endif
    prterror ('w', failed_consistency);
    ++bad_header;                    /* remember for future error message */
 }
################ end of patch ##########


-- 
Carl Johnson            [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to