Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#21616 closed defect (fixed)

john @1.7.0.2 breaks on macports 1.8.0 on Snow Leopard

Reported by: atma@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.8.0
Keywords: john the ripper Cc: hsivank@…, atma@…, ryandesign (Ryan Carsten Schmidt)
Port: john

Description (last modified by tobypeterson)

angel:~ atma$ sudo port info john
john @1.7.0.2 (sysutils, security)
Variants:             altivec, i386, powerpc

Description:          John the Ripper is a UNIX password cracker, currently available for UNIX (tested with Linux x86, FreeBSD x86, Solaris 2.x SPARC, OSF/1 Alpha), DOS,
                      WinNT/Win95.
Homepage:             http://www.openwall.com/john/

Platforms:            darwin
License:              unknown
Maintainers:          nomaintainer@macports.org
angel:~ atma$ port version
Version: 1.8.0
angel:~ atma$ sudo port install john
--->  Computing dependencies for john
--->  Building john
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_john/work/john-1.7.0.2/src" && /usr/bin/make -j2 clean macosx-x86-mmx " returned error 2
Command output: DES_std.c: In function 'DES_raw_set_key':
DES_std.c:596: error: 'pos' undeclared (first use in this function)
DES_std.c:598: error: nested functions are disabled, use -fnested-functions to re-enable
DES_std.c:598: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
DES_std.c:598: error: 'value1' undeclared (first use in this function)
DES_std.c:601: error: 'DES_KS_current' undeclared (first use in this function)
DES_std.c:601: error: 'DES_KS_table' undeclared (first use in this function)
DES_std.c:605: error: expected expression before ')' token
DES_std.c: In function 'DES_std_set_key':
DES_std.c:616: error: nested functions are disabled, use -fnested-functions to re-enable
DES_std.c:616: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
DES_std.c:616: error: 'value1' undeclared (first use in this function)
DES_std.c:616: error: 'value2' undeclared (first use in this function)
DES_std.c:616: warning: left-hand operand of comma expression has no effect
DES_std.c:640: error: 'DES_KS_table' undeclared (first use in this function)
DES_std.c:640: error: 'DES_KS_current' undeclared (first use in this function)
DES_std.c: At top level:
DES_std.c:668: error: expected ')' before 'R'
DES_std.c:723: error: expected ')' before 'binary'
DES_std.c:941: error: expected ')' before 'KS'
DES_std.c:1047: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'DES_raw_get_salt'
DES_std.c:1057: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'DES_std_get_salt'
DES_std.c:1066: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'DES_raw_get_count'
DES_std.c:1075: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
DES_std.c:1091: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
DES_std.c:1116: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
make[1]: *** [DES_fmt.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [DES_std.o] Error 1
make: *** [macosx-x86-mmx] Error 2

Error: Status 1 encountered during processing.

Attachments (4)

patch-src-Makefile.diff (445 bytes) - added by hsivank@… 15 years ago.
patch-john.diff (308 bytes) - added by hsivank@… 15 years ago.
patch-src-john.c.diff (308 bytes) - added by hsivank@… 15 years ago.
Portfile-john.diff (2.9 KB) - added by hsivank@… 15 years ago.

Download all attachments as: .zip

Change History (23)

comment:1 Changed 15 years ago by atma@…

I've used this program before. On my mac mini G4 ppc:

devo:~ atma$ uname -a
Darwin devo.local 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc
devo:~ atma$ port version
Version: 1.8.0
devo:~ atma$ john
-bash: john: command not found
devo:~ atma$ sudo port install john
Password:
--->  Computing dependencies for john
--->  Fetching john
--->  Attempting to fetch john-1.7.0.2.tar.bz2 from ftp://ftp.mathematik.uni-marburg.de/pub/mirror/openwall/projects/john/1.7.0.2/
--->  Verifying checksum(s) for john
--->  Extracting john
--->  Configuring john
--->  Building john
--->  Staging john into destroot
--->  Installing john @1.7.0.2_0+powerpc

You'll find the john files under /opt/local/share/john/

--->  Activating john @1.7.0.2_0+powerpc
--->  Cleaning john
devo:~ atma$ 

comment:2 Changed 15 years ago by tobypeterson

Description: modified (diff)

Changed 15 years ago by hsivank@…

Attachment: patch-src-Makefile.diff added

comment:3 Changed 15 years ago by hsivank@…

hello atma,

Is it ok with this 2 files ?

comment:4 Changed 15 years ago by hsivank@…

Cc: hsivank@… added

Cc Me!

comment:5 Changed 15 years ago by atma@…

Hello,

After applying the patches I've got here:

Entering interactive mode... ("help" for help, "quit" to quit)
[sysutils/john] > install john
--->  Computing dependencies for john
--->  Extracting john
--->  Applying patches to john
--->  Configuring john
--->  Building john
--->  Staging john into destroot
--->  Installing john @1.7.0.2_1+darwin_10

You'll find the john files under /opt/local/share/john/

--->  Activating john @1.7.0.2_1+darwin_10
--->  Cleaning john
[sysutils/john] > quit
Goodbye
angel:john root# john
fopen: john.ini: No such file or directory
angel:john root# 

I used " sudo port install john checksum.skip=yes -d" command in order to make it work (cheers to logix@Freenode) without checksum control.

Regards

comment:6 Changed 15 years ago by atma@…

Cc: atma@… added

Cc Me!

Changed 15 years ago by hsivank@…

Attachment: patch-john.diff added

comment:7 in reply to:  5 Changed 15 years ago by hsivank@…

angel:john root# john fopen: john.ini: No such file or directory

Hum, this is a new bug.

It seems that john.ini is not provided by the source package so we can ignore it ...

I have posted a new patch : patch-john.diff and update Portfile-john.diff

I used " sudo port install john checksum.skip=yes -d" command in order to make it work (cheers to logix@Freenode) without checksum control.

Have you got a problem with checksum step ?

comment:8 Changed 15 years ago by atma@…

Hello,

Apparently the patch does not apply:

angel:john root# wget http://trac.macports.org/raw-attachment/ticket/21616/Portfile-john.diff
--2009-09-26 20:18:31--  http://trac.macports.org/raw-attachment/ticket/21616/Portfile-john.diff
Resolving trac.macports.org (trac.macports.org)... 17.254.17.55
Connecting to trac.macports.org (trac.macports.org)|17.254.17.55|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2224 (2.2K) [text/x-diff]
Saving to: `Portfile-john.diff'

100%[==================================================================================================================================================================>] 2,224       2.97K/s   in 0.7s    

2009-09-26 20:18:33 (2.97 KB/s) - `Portfile-john.diff' saved [2224/2224]

angel:john root# patch -p0 < Portfile-john.diff 
patching file Portfile
Reversed (or previously applied) patch detected!  Assume -R? [n] y
Hunk #2 FAILED at 34.
1 out of 2 hunks FAILED -- saving rejects to file Portfile.rej
angel:john root# tail Portfile.rej 
      build.target    "clean macosx-ppc32"
  }
+ platform i386 {
      build.target    "clean macosx-x86-mmx"
  }
+ variant altivec conflicts i386 {
+     build.target    "clean macosx-ppc32-altivec"
  }
  
  destroot {
angel:john root# pwd
/opt/local/var/macports/sources/rsync.macports.org/release/ports/sysutils/john
angel:john root# cat Portfile.rej 
***************
*** 35,66 ****
                      rmd160 9e75f5fd5561595ec2f3a1a290e85605234b8c41
  worksrcdir          ${distname}/src
  
- use_parallel_build  no
- 
- patchfiles          patch-src-Makefile.diff \
-                     patch-john.diff
- 
  use_configure       no
- build.args-append JOHN_SYSTEMWIDE=1 JOHN_SYSTEMWIDE_EXEC=\"${prefix}/share/john\" JOHN_SYSTEMWIDE_HOME=\"${prefix}/share/john\"
  
- platform powerpc {   
      build.target    "clean macosx-ppc32"
  }
- 
- variant altivec {
-     build.target    "clean macosx-ppc32-altivec"
- }
- 
- platform darwin 9 {
      build.target    "clean macosx-x86-mmx"
  }
- 
- platform darwin 10 { 
-         if {$build_arch == "x86_64"} {
-                 build.target    "clean macosx-x86-64"
-         } else {
-               build.target    "clean macosx-x86-mmx"
-       }
  }
  
  destroot {
--- 34,58 ----
                      rmd160 9e75f5fd5561595ec2f3a1a290e85605234b8c41
  worksrcdir          ${distname}/src
  
+ post-patch {
+     if {[variant_isset powerpc]} {
+     reinplace "s,CFLAGS =,CFLAGS = -DJOHN_SYSTEMWIDE=1 -DJOHN_SYSTEMWIDE_EXEC=\\\\\\\\\\\\\"${prefix}/share/john\\\\\\\\\\\\\" -DJOHN_SYSTEMWIDE_HOME=\\\\\\\\\\\\\"${prefix}/share/john\\\\\\\\\\\\\",g" ${worksrcpath}/Makefile
+     reinplace "s,CFLAGS=\",CFLAGS=\"-DJOHN_SYSTEMWIDE=1 -DJOHN_SYSTEMWIDE_EXEC=\\\\\\\\\\\\\"${prefix}/share/john\\\\\\\\\\\\\" -DJOHN_SYSTEMWIDE_HOME=\\\\\\\\\\\\\"${prefix}/share/john\\\\\\\\\\\\\" ,g" ${worksrcpath}/Makefile
+     } else {
+         reinplace "s,CFLAGS =,CFLAGS = -DJOHN_SYSTEMWIDE=1 -DJOHN_SYSTEMWIDE_EXEC=\\\\\\\"${prefix}/share/john\\\\\\\" -DJOHN_SYSTEMWIDE_HOME=\\\\\\\"${prefix}/share/john\\\\\\\",g" ${worksrcpath}/Makefile
+         reinplace "s,CFLAGS=\",CFLAGS=\"-DJOHN_SYSTEMWIDE=1 -DJOHN_SYSTEMWIDE_EXEC=\\\\\\\"${prefix}/share/john\\\\\\\" -DJOHN_SYSTEMWIDE_HOME=\\\\\\\"${prefix}/share/john\\\\\\\" ,g" ${worksrcpath}/Makefile
+     }
+ }
  use_configure       no
  
+ platform powerpc {
      build.target    "clean macosx-ppc32"
  }
+ platform i386 {
      build.target    "clean macosx-x86-mmx"
  }
+ variant altivec conflicts i386 {
+     build.target    "clean macosx-ppc32-altivec"
  }
  
  destroot {
angel:john root# 

comment:9 Changed 15 years ago by hsivank@…

maybe, you need to revert the previous patch before apply the one ?

comment:10 in reply to:  9 Changed 15 years ago by atma@…

Replying to hsivank@…:

maybe, you need to revert the previous patch before apply the one ?

Where exactly should I put/apply the patch-john.diff file? It's not applied in the source code where john.c resides. It comes with errors.

comment:11 Changed 15 years ago by hsivank@…

You should create a directory named "files" in the same directory of the modified portefile of john Put patch-john.diff in this directory

then

sudo port clean && sudo port install

comment:12 Changed 15 years ago by hsivank@…

Note : you can put patch-src-Makefile.diff too !

comment:13 Changed 15 years ago by atma@…

Works!! :-) I've put the two patches in the files/ directory and applied the last patch on the portfile! :-)

angel:~ atma$ john
John the Ripper password cracker, version 1.7.0.2
Copyright (c) 1996-2006 by Solar Designer and others
Homepage: http://www.openwall.com/john/
[snip]
angel:~ atma$ uname -a
Darwin angel 10.0.0 Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 i386 i386
angel:~ atma$ 

comment:14 Changed 15 years ago by atma@…

hmm after some testing I can see that john does not accept the modes and doesn't start comets out with errors:

angel:~ atma$ uname -a
Darwin angel 10.0.0 Darwin Kernel Version 10.0.0: Fri Jul 31 22:47:34 PDT 2009; root:xnu-1456.1.25~1/RELEASE_I386 i386 i386
angel:~ atma$ john passwd 
Loaded 3 password hashes with 3 different salts (FreeBSD MD5 [32/64 X2])
No "single crack" mode rules found in (null)
angel:~ atma$ john -i=alpha passwd 
Loaded 3 password hashes with 3 different salts (FreeBSD MD5 [32/64 X2])
No charset defined for mode: alpha
angel:~ atma$ 

I can't tell if this is a minor issue. Probably some configuration files needed?

Changed 15 years ago by hsivank@…

Attachment: patch-src-john.c.diff added

Changed 15 years ago by hsivank@…

Attachment: Portfile-john.diff added

comment:15 Changed 15 years ago by hsivank@…

Hello atma,

  • The name "patch-john.diff" is not correct, so now it is "patch-src-john.c.diff"
  • I have updated 'Portfile-john.diff' to fix the config

It seems to work well !

Have you found another bug?

comment:16 Changed 15 years ago by atma@…

Ok with the latest patches works great. No other bugs found.

Thanks :-)

comment:17 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

atma, please remember WikiFormatting. Enclose your literal terminal output in {{{ and }}}. I have corrected your posts above.

comment:18 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

I didn't like the patches in this ticket. Too much going on. In r66272 I updated john to 1.7.3.4, turned off the parallel build which was causing the error reported in this ticket, and fixed the selection of the build.target based on configure.build_arch. Please open a new ticket if further problems are encountered or further changes are desired.

comment:19 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Note: See TracTickets for help on using tickets.