Bug 49988 - johntheripper-1.6-r1 fails applying john-ntlm.diff patch for samba USE flag
Bug#: 49988 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: bug-wranglers@gentoo.org Reported By: lists@sancho2k.net
Component: Ebuilds
URL: 
Summary: johntheripper-1.6-r1 fails applying john-ntlm.diff patch for samba USE flag
Keywords:  
Status Whiteboard: 
Opened: 2004-05-04 09:42 0000
Description:   Opened: 2004-05-04 09:42 0000
Emerging the ebuild for app-crypt/johntheripper-1.6-r1 fails when the 'samba'
USE flag is enabled. It fails while applying the john-ntlm.diff patch and will
not install successfully.


Reproducible: Always
Steps to Reproduce:
1. Set the 'samba' USE flag.
2. emerge /usr/portage/app-crypt/johntheripper/johntheripper-1.6-r1.ebuild


Actual Results:  
>>> md5 src_uri ;-) john-1.6.tar.gz
>>> md5 src_uri ;-) john_1.6-17.diff.gz
>>> md5 src_uri ;-) john-1.6-mysql-1.diff
>>> md5 src_uri ;-) john-ntlm-patch-v02.tgz
>>> md5 src_uri ;-) john-1.6.skey.patch-1
>>> md5 src_uri ;-) john-1.6.31-eggpatch-8.diff.gz
>>> Unpacking source...
>>> Unpacking john-1.6.tar.gz to /var/tmp/portage/johntheripper-1.6-r1/work
>>> Unpacking john_1.6-17.diff.gz to /var/tmp/portage/johntheripper-1.6-r1/work
>>> Unpacking john-1.6-mysql-1.diff to /var/tmp/portage/johntheripper-1.6-r1/work
unpack john-1.6-mysql-1.diff: file format not recognized. Ignoring.
>>> Unpacking john-ntlm-patch-v02.tgz to /var/tmp/portage/johntheripper-1.6-r1/work
>>> Unpacking john-1.6.skey.patch-1 to /var/tmp/portage/johntheripper-1.6-r1/work
unpack john-1.6.skey.patch-1: file format not recognized. Ignoring.
>>> Unpacking john-1.6.31-eggpatch-8.diff.gz to
/var/tmp/portage/johntheripper-1.6-r1/work
 * Applying john_1.6-17.diff...                                                
  [ ok ]
 * Applying john-1.6.skey.patch-1...                                           
  [ ok ]
samba
 * Applying john-ntlm.diff...

 * Failed Patch: john-ntlm.diff!
 * 
 * Include in your bugreport the contents of:
 * 
 *   /var/tmp/portage/johntheripper-1.6-r1/temp/john-ntlm.diff-20551.out


!!! ERROR: app-crypt/johntheripper-1.6-r1 failed.
!!! Function epatch, Line 322, Exitcode 0
!!! Failed Patch: john-ntlm.diff!

Expected Results:  
The ebuild should be patched correctly and emerge should finish.

Contents of
/var/tmp/portage/johntheripper-1.6-r1/temp/john-ntlm.diff-20551.out:

***** john-ntlm.diff *****

==========================

PATCH COMMAND:  patch -g0 -p0 < john-ntlm.diff

==========================
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/Makefile src/Makefile
|--- clean-src/Makefile Mon Oct 22 13:00:23 2001
|+++ src/Makefile       Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 16
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/john.c src/john.c
|--- clean-src/john.c   Tue May  8 02:59:28 2001
|+++ src/john.c Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 36
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/loader.c src/loader.c
|--- clean-src/loader.c Sat Aug 26 05:59:56 2000
|+++ src/loader.c       Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
4 out of 4 hunks ignored
can't find file to patch at input line 103
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/options.c src/options.c
|--- clean-src/options.c        Tue May 15 12:32:34 2001
|+++ src/options.c      Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
==========================

PATCH COMMAND:  patch -g0 -p1 < john-ntlm.diff

==========================
patching file Makefile
Hunk #1 FAILED at 37.
1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej
patching file john.c
Hunk #1 FAILED at 36.
Hunk #2 FAILED at 63.
2 out of 2 hunks FAILED -- saving rejects to file john.c.rej
patching file loader.c
patching file options.c
Hunk #1 succeeded at 58 (offset -1 lines).
Hunk #2 succeeded at 88 (offset -10 lines).
==========================

PATCH COMMAND:  patch -g0 -p2 < john-ntlm.diff

==========================
missing header for unified diff at line 4 of patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/Makefile src/Makefile
|--- clean-src/Makefile Mon Oct 22 13:00:23 2001
|+++ src/Makefile       Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
missing header for unified diff at line 16 of patch
can't find file to patch at input line 16
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/john.c src/john.c
|--- clean-src/john.c   Tue May  8 02:59:28 2001
|+++ src/john.c Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
missing header for unified diff at line 36 of patch
can't find file to patch at input line 36
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/loader.c src/loader.c
|--- clean-src/loader.c Sat Aug 26 05:59:56 2000
|+++ src/loader.c       Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
4 out of 4 hunks ignored
missing header for unified diff at line 103 of patch
can't find file to patch at input line 103
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/options.c src/options.c
|--- clean-src/options.c        Tue May 15 12:32:34 2001
|+++ src/options.c      Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
==========================

PATCH COMMAND:  patch -g0 -p3 < john-ntlm.diff

==========================
missing header for unified diff at line 4 of patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/Makefile src/Makefile
|--- clean-src/Makefile Mon Oct 22 13:00:23 2001
|+++ src/Makefile       Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
missing header for unified diff at line 16 of patch
can't find file to patch at input line 16
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/john.c src/john.c
|--- clean-src/john.c   Tue May  8 02:59:28 2001
|+++ src/john.c Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
missing header for unified diff at line 36 of patch
can't find file to patch at input line 36
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/loader.c src/loader.c
|--- clean-src/loader.c Sat Aug 26 05:59:56 2000
|+++ src/loader.c       Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
4 out of 4 hunks ignored
missing header for unified diff at line 103 of patch
can't find file to patch at input line 103
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/options.c src/options.c
|--- clean-src/options.c        Tue May 15 12:32:34 2001
|+++ src/options.c      Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
==========================

PATCH COMMAND:  patch -g0 -p4 < john-ntlm.diff

==========================
missing header for unified diff at line 4 of patch
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/Makefile src/Makefile
|--- clean-src/Makefile Mon Oct 22 13:00:23 2001
|+++ src/Makefile       Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
missing header for unified diff at line 16 of patch
can't find file to patch at input line 16
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/john.c src/john.c
|--- clean-src/john.c   Tue May  8 02:59:28 2001
|+++ src/john.c Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
missing header for unified diff at line 36 of patch
can't find file to patch at input line 36
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/loader.c src/loader.c
|--- clean-src/loader.c Sat Aug 26 05:59:56 2000
|+++ src/loader.c       Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
4 out of 4 hunks ignored
missing header for unified diff at line 103 of patch
can't find file to patch at input line 103
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -u clean-src/options.c src/options.c
|--- clean-src/options.c        Tue May 15 12:32:34 2001
|+++ src/options.c      Mon Jun 10 15:34:36 2002
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored

------- Comment #1 From Ghislain Bourgeois 2004-05-04 20:13:02 0000 -------
The bug seems to come before john-ntlm.diff patch... 

unpack john-1.6.skey.patch-1: file format not recognized. Ignoring.
* Applying john-1.6.skey.patch-1...                                           
  [ ok ]
samba

It makes me think the problem is with skey patch...

Hysteric

------- Comment #2 From Ghislain Bourgeois 2004-05-04 20:27:27 0000 -------
Not exactly like I tought... The skey patch changes the file before the ntlm
patch applies... Patch cannot find the exact spot since there was a line
changed... I'll rebuild the ntlm patch and post it here...

Hysteric

------- Comment #3 From Ghislain Bourgeois 2004-05-04 20:36:36 0000 -------
Created an attachment (id=30760) [details]
Corrected the patch so it applies correctly after the skey patch

The skey patch was applied before this patch so the content of Makefile and
john.c was not the same and patch could not find where to apply the patch. Now
eggpatch needs the same thing.

Hysteric

------- Comment #4 From Ghislain Bourgeois 2004-05-04 20:44:19 0000 -------
Created an attachment (id=30761) [details]
This ebuild applies the eggpatch before optional patches

Now ntlm patch needs to be remodified, and all will go well

Hysteric

------- Comment #5 From Ghislain Bourgeois 2004-05-04 21:01:19 0000 -------
Created an attachment (id=30765) [details]
ntlm patch corrected to patch after skey and eggpatch

------- Comment #6 From Ghislain Bourgeois 2004-05-04 21:02:11 0000 -------
Created an attachment (id=30766) [details]
eggpatch corrected to apply after skey patch

------- Comment #7 From Ghislain Bourgeois 2004-05-04 21:04:26 0000 -------
This bug doesn't apply anymore, but johntheripper-1.6-r2 (the new ebuild with
the patches corrected) doesn't compile. But it's too late now to look at this!

Hysteric

------- Comment #8 From Ghislain Bourgeois 2004-05-17 14:55:22 0000 -------
Looks like a header is missing with the skey patch:

SKEY_fmt.c:39:18: skey.h: No such file or directory
make[1]: *** [SKEY_fmt.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/johntheripper-1.6-r2/work/john-1.6/src'
make: *** [linux-x86-mmx-elf] Error 2

------- Comment #9 From Ghislain Bourgeois 2004-05-17 15:25:41 0000 -------
I suggest that john starts to use the use flag "skey" to decide whether it
should build support for it.

Also, the samba use flag is supposed to add support for Samba, not for
everything windows... There should be a local use flag NTLM for john to build
NTLM support.

And I absolutely do not understand why the eggdrop patch is forced in. I think
the majority of users do not want to crack password of an IRC bot. 

I will post a new ebuild with my suggestions in.

------- Comment #10 From Ghislain Bourgeois 2004-05-17 15:42:45 0000 -------
Created an attachment (id=31611) [details]
Corrected ebuild with new use flags and not forcing support for eggdrop

Now with this ebuild, johntheripper compiles correctly. It uses the skey use
flag to decide whether to apply the SKEY patch. It uses a new ntlm use flag to
decide whether to apply the NTLM patch. Eggdrop patch is commented out, since
it is not needed and it doesn't work. I will also work on a new NTLM patch to
apply if both skey and ntlm flags are there. It is not urgent though, because
NTLM doesn't compile anyway.

Hysteric

------- Comment #11 From John Davis (zhen) (RETIRED) 2004-05-17 16:58:58 0000 -------
i really do not have to time to work on packages with my release
responsibilities, please assign to another dev.

------- Comment #12 From Ghislain Bourgeois 2004-05-17 19:10:52 0000 -------
Created an attachment (id=31627) [details]
Updated ebuild that correctly applies NTLM patch if SKEY patch was applied

With this ebuild, this bug can be closed.

-No more eggdrop patch forced in
-Using skey and a new ntlm use flag
-Patches the ntlm patch if skey is in use

Hysteric

------- Comment #13 From Ghislain Bourgeois 2004-05-17 19:12:10 0000 -------
Created an attachment (id=31628) [details]
Patch to the ntlm patch

The ebuild above needs this file in the files directory to work correctly.
NTLM patch will be applied correctly, but still it doesn't compile. Need
another bug for this.

Hysteric

------- Comment #14 From Daniel Black 2004-05-17 21:22:28 0000 -------
commited version 1.6-r2. Mysql support dropped. All patches were adding stuff
to the same lines of code.  Ghislain Bourgeois has emailed upstream devs to get
better module support.

------- Comment #15 From Ghislain Bourgeois 2004-05-18 14:42:45 0000 -------
the answer I've got from the devs:

Hi,

On Tue, May 18, 2004 at 04:13:50AM +0000, Ghislain Bourgeois wrote:
> I've been working on bugs in Gentoo Linux and one was about john the 
> ripper. The problem was that many patches of contributions were being 
> applied to the code, but each patch works at the same point in the code. 
> After the first patch, the other ones cannot be applied. The problem is not 
> your fault, but I've talked with another Gentoo developper, and we think 
> that there should be an easy way to incorporate modules in john. Maybe it 
> could be a good enhancement to make an interface for modules so that 
> contribution could be added easily.

And there is.  But the modules do need to register themselves with the
main John.  This is where the patch conflicts are.  I don't see a
clean way to resolve that, short of providing an entire subdirectory
into which modules could be dropped.  But that'd be too much added
magic to the build process to be worth it.

> Or, another option would be to put all 
> the contributions in the code and make them build or not with the configure 
> script.

There're several reasons why the contributions aren't getting in.
They include inadequate code quality, dependencies on external
libraries which are unsuitable for the portable John, and licensing.

-- 
Alexander Peslyak <solar@openwall.com>
GPG key ID: B35D3598  fp: 6429 0D7E F130 C13E C929  6447 73C3 A290 B35D 3598
http://www.openwall.com - bringing security into open computing environments

Guess we won't get better support... we'll need to make different version of each patch we want to include or don't include them at all... this package is a mess!


Hysteric