Bug#350210: amd64 build of unshield fails to extract files due to checksum error - Patch from SVN

2007-09-17 Thread Julien Valroff
tags 350210 + patch
thanks

Hi,

The patch submitted by Zinx was committed upstream. I guess it would be
nice to have it included in the Debian package as well.

You'll find attached a patch against current Debian package sources
adding a patch system (dpatch) and the fix for (at least) amd64
architecture.

Cheers,
Julien
diff -ruN unshield-0.5/debian/changelog unshield-0.5.NEW/debian/changelog
--- unshield-0.5/debian/changelog	2007-09-17 19:49:39.0 +0200
+++ unshield-0.5.NEW/debian/changelog	2007-09-17 19:49:25.0 +0200
@@ -1,3 +1,11 @@
+unshield (0.5-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Added patch system for the Debian package
+  * Added patch from SVN to fix issue with amd64 architecture (Closes: #350210)
+
+ -- Julien Valroff <[EMAIL PROTECTED]>  Mon, 17 Sep 2007 19:48:54 +0200
+
 unshield (0.5-3) unstable; urgency=low
 
   * Added Build-Depends to libtool, autoconf, and automake
diff -ruN unshield-0.5/debian/control unshield-0.5.NEW/debian/control
--- unshield-0.5/debian/control	2007-09-17 19:49:39.0 +0200
+++ unshield-0.5.NEW/debian/control	2007-09-17 19:46:04.0 +0200
@@ -2,7 +2,7 @@
 Section: utils
 Priority: optional
 Maintainer: Volker Christian <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>= 4.0.0), zlib1g-dev (>= 1.2.1), libtool (>= 1.4), autoconf, automake1.7
+Build-Depends: debhelper (>= 4.0.0), zlib1g-dev (>= 1.2.1), libtool (>= 1.4), autoconf, automake1.7, dpatch
 Build-Conflicts: autoconf2.13, automake1.4
 Standards-Version: 3.6.2
 
diff -ruN unshield-0.5/debian/patches/00list unshield-0.5.NEW/debian/patches/00list
--- unshield-0.5/debian/patches/00list	1970-01-01 01:00:00.0 +0100
+++ unshield-0.5.NEW/debian/patches/00list	2007-09-17 19:44:14.0 +0200
@@ -0,0 +1 @@
+01_amd64-fix.dpatch
diff -ruN unshield-0.5/debian/patches/01_amd64-fix.dpatch unshield-0.5.NEW/debian/patches/01_amd64-fix.dpatch
--- unshield-0.5/debian/patches/01_amd64-fix.dpatch	1970-01-01 01:00:00.0 +0100
+++ unshield-0.5.NEW/debian/patches/01_amd64-fix.dpatch	2007-09-17 19:48:50.0 +0200
@@ -0,0 +1,31 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_amd64-fix.dpatch by  <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: AMD64 patch from upstream SVN.
+
[EMAIL PROTECTED]@
+diff -urNad unshield-0.5~/lib/md5/global.h unshield-0.5/lib/md5/global.h
+--- unshield-0.5~/lib/md5/global.h	2003-08-25 13:45:20.0 +0200
 unshield-0.5/lib/md5/global.h	2007-09-17 19:47:52.0 +0200
+@@ -17,7 +17,7 @@
+ typedef unsigned short int UINT2;
+ 
+ /* UINT4 defines a four byte word */
+-typedef unsigned long int UINT4;
++typedef unsigned int UINT4;
+ 
+ /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
+ If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
+diff -urNad unshield-0.5~/lib/md5/md5c.c unshield-0.5/lib/md5/md5c.c
+--- unshield-0.5~/lib/md5/md5c.c	2003-08-25 13:45:20.0 +0200
 unshield-0.5/lib/md5/md5c.c	2007-09-17 19:48:08.0 +0200
+@@ -68,7 +68,7 @@
+ 
+ /* ROTATE_LEFT rotates x left n bits.
+  */
+-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n
++#define ROTATE_LEFT(x, n) x) << (n)) & 0xU) | ((x) >> (32-(n
+ 
+ /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
+ Rotation is separate from addition to prevent recomputation.
diff -ruN unshield-0.5/debian/rules unshield-0.5.NEW/debian/rules
--- unshield-0.5/debian/rules	2007-09-17 19:49:39.0 +0200
+++ unshield-0.5.NEW/debian/rules	2007-09-17 19:47:00.0 +0200
@@ -6,6 +6,7 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+include /usr/share/dpatch/dpatch.make
 
 # These are used for cross-compiling and for saving the configure script
 # from having to guess our platform (since we know it already)
@@ -24,7 +25,7 @@
 	INSTALL_PROGRAM += -s
 endif
 
-config.status: configure	
+config.status: patch configure	
 	chmod +x bootstrap
 	./bootstrap
 	dh_testdir
@@ -35,7 +36,7 @@
 		--infodir=\$${prefix}/share/info
 
 
-build: build-stamp
+build: patch build-stamp
 
 build-stamp:  config.status
 	dh_testdir
@@ -46,7 +47,7 @@
 
 	touch build-stamp
 
-clean:
+clean: unpatch
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp 
@@ -65,7 +66,7 @@
 
 	dh_clean 
 
-install: build
+install: patch build
 	dh_testdir
 	dh_testroot
 	dh_clean -k 


Bug#350210: amd64 build of unshield fails to extract files due to checksum error

2006-01-28 Thread Zinx Verituse
Absolutely: the problem is two-fold...
1)
in lib/md5/global.h, line 20:
/* UINT4 defines a four byte word */
typedef unsigned long int UINT4;

That's not a four byte word on amd64.
Proper thing would be to either use stdint's uint32_t or to do
a check in configure for a 4-byte word.  "unsigned int" is also
32 bits on amd64.

configure would be more portable for non-GNU systems, as not
all compilers support C99.

2)
in lib/md5/md5c.c, line 71:
#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n

That assumes math is done at 32-bits, so it doesn't bother to truncate
the extra bits generated from the left shift.

either mask the left shift with 0x, or cast the result to UINT4

I have verified that making these changes fixes it, but my changes are not as
portable as they may seem.  I'm including them here for reference; they won't
break any arches that aren't already broken, but if 'unsigned int' happens to
be a different size on some platform, it won't work there.

in global.h, line 20:
typedef unsigned int UINT4;

in md5c.c, line 71:
#define ROTATE_LEFT(x, n) x) << (n)) & 0xU) | ((x) >> (32-(n

On Sat, Jan 28, 2006 at 08:19:06PM +0100, Volker Christian wrote:
> Hi,
> 
> thanks for this report. Would it be possible for you do track down the 
> problem 
> as i didn't own a amd64-based machine?
> 
> regards
> voc
> 
> 
> On Saturday 28 January 2006 00:15, Zinx Verituse wrote:
> > Package: unshield
> > Version: 0.5-3
> > Severity: important
> >
> > Extracting any cab on amd64 with the amd64 binary with -D 3 yields:
> > [unshield_file_save:710] MD5 checksum failure for file 66 (W83627THF.ini)
> > Failed to extract file 'W83627THF.ini'.
> >
> > Extracting with the 32-bit debian version, still on amd64, works fine
> > (extracts files, does not have a checksum error)
> >
> > -- System Information:
> > Debian Release: testing/unstable
> >   APT prefers unstable
> >   APT policy: (500, 'unstable')
> > Architecture: amd64 (x86_64)
> > Shell:  /bin/sh linked to /bin/bash
> > Kernel: Linux 2.6.15-1-amd64-k8-smp
> > Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
> >
> > Versions of packages unshield depends on:
> > ii  libc6 2.3.5-12   GNU C Library: Shared
> > libraries an ii  libunshield0  0.5-3  library to
> > extracts CAB files from ii  zlib1g1:1.2.3-9 
> > compression library - runtime
> >
> > unshield recommends no packages.
> >
> > -- no debconf information


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



Bug#350210: amd64 build of unshield fails to extract files due to checksum error

2006-01-28 Thread Volker Christian
Hi,

thanks for this report. Would it be possible for you do track down the problem 
as i didn't own a amd64-based machine?

regards
voc


On Saturday 28 January 2006 00:15, Zinx Verituse wrote:
> Package: unshield
> Version: 0.5-3
> Severity: important
>
> Extracting any cab on amd64 with the amd64 binary with -D 3 yields:
> [unshield_file_save:710] MD5 checksum failure for file 66 (W83627THF.ini)
> Failed to extract file 'W83627THF.ini'.
>
> Extracting with the 32-bit debian version, still on amd64, works fine
> (extracts files, does not have a checksum error)
>
> -- System Information:
> Debian Release: testing/unstable
>   APT prefers unstable
>   APT policy: (500, 'unstable')
> Architecture: amd64 (x86_64)
> Shell:  /bin/sh linked to /bin/bash
> Kernel: Linux 2.6.15-1-amd64-k8-smp
> Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
>
> Versions of packages unshield depends on:
> ii  libc6 2.3.5-12   GNU C Library: Shared
> libraries an ii  libunshield0  0.5-3  library to
> extracts CAB files from ii  zlib1g1:1.2.3-9 
> compression library - runtime
>
> unshield recommends no packages.
>
> -- no debconf information


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



Bug#350210: amd64 build of unshield fails to extract files due to checksum error

2006-01-27 Thread Zinx Verituse
Package: unshield
Version: 0.5-3
Severity: important

Extracting any cab on amd64 with the amd64 binary with -D 3 yields:
[unshield_file_save:710] MD5 checksum failure for file 66 (W83627THF.ini)
Failed to extract file 'W83627THF.ini'.

Extracting with the 32-bit debian version, still on amd64, works fine
(extracts files, does not have a checksum error)

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-amd64-k8-smp
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages unshield depends on:
ii  libc6 2.3.5-12   GNU C Library: Shared libraries an
ii  libunshield0  0.5-3  library to extracts CAB files from
ii  zlib1g1:1.2.3-9  compression library - runtime

unshield recommends no packages.

-- no debconf information


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