[GH-ISSUE #1783] on latest release (1.8.0.6-jumbo1) make install is broken #1187

Closed
opened 2026-10-14 03:38:24 +07:00 by bsakaguchi · 12 comments
Owner

Originally created by @rofl0r on GitHub (Sep 25, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1783

Originally assigned to: @magnumripper on GitHub.

./configure --prefix=
make ...
make install DESTDIR=foo

expected:

[ -d foo/etc/bash_completion.d ] && cp ../run/john.bash_completion foo/etc/bash_comp...
...

actual result:

[ -d /etc/bash_completion.d ] && cp ../run/john.bash_completion /etc/bash_compl$
cp: can't create '/etc/bash_completion.d/john.bash_completion': Permission deni$
[ -d /usr/local/etc/bash_completion.d ] && cp ../run/john.bash_completion /usr/$
[ -d /opt/local/etc/bash_completion.d ] && cp ../run/john.bash_completion /opt/$
Bash-completion for JtR opportunistically installed.
Source ". ../run/john.bash_completion" or logout/login to activate the changes
[ -d /usr/share/zsh/functions/Completion/Unix ] && cp ../run/john.zsh_completio$
[ -d /usr/share/zsh/site-functions ] && cp ../run/john.zsh_completion /usr/shar$
[ -d /usr/local/share/zsh/site-functions ] && cp ../run/john.zsh_completion /us$
zsh-completion for JtR opportunistically installed.
Source ". ../run/john.zsh_completion" or logout/login to activate the changes
Stripping executables.
/bin/strip ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/undrop$
/bin/strip: Unable to recognise the format of the input file `../run/john'
/bin/strip: Unable to recognise the format of the input file `../run/unshadow'
/bin/strip: Unable to recognise the format of the input file `../run/unafs'

[this is due to x86_64 strip called with arm binaries, this is a cross-compile]

the makefile should do something like

bash-completion:
        [ -d $(DESTDIR)$(prefix)/etc/bash_completion.d ] && install -dM 644 ../run/john.bash_completion $(DESTDIR)$(prefix)/etc/bash_completion.d/john.bash_completion

etc

Originally created by @rofl0r on GitHub (Sep 25, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1783 Originally assigned to: @magnumripper on GitHub. ``` ./configure --prefix= make ... make install DESTDIR=foo ``` expected: ``` [ -d foo/etc/bash_completion.d ] && cp ../run/john.bash_completion foo/etc/bash_comp... ... ``` actual result: ``` [ -d /etc/bash_completion.d ] && cp ../run/john.bash_completion /etc/bash_compl$ cp: can't create '/etc/bash_completion.d/john.bash_completion': Permission deni$ [ -d /usr/local/etc/bash_completion.d ] && cp ../run/john.bash_completion /usr/$ [ -d /opt/local/etc/bash_completion.d ] && cp ../run/john.bash_completion /opt/$ Bash-completion for JtR opportunistically installed. Source ". ../run/john.bash_completion" or logout/login to activate the changes [ -d /usr/share/zsh/functions/Completion/Unix ] && cp ../run/john.zsh_completio$ [ -d /usr/share/zsh/site-functions ] && cp ../run/john.zsh_completion /usr/shar$ [ -d /usr/local/share/zsh/site-functions ] && cp ../run/john.zsh_completion /us$ zsh-completion for JtR opportunistically installed. Source ". ../run/john.zsh_completion" or logout/login to activate the changes Stripping executables. /bin/strip ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/undrop$ /bin/strip: Unable to recognise the format of the input file `../run/john' /bin/strip: Unable to recognise the format of the input file `../run/unshadow' /bin/strip: Unable to recognise the format of the input file `../run/unafs' [this is due to x86_64 strip called with arm binaries, this is a cross-compile] ``` the makefile should do something like ``` bash-completion: [ -d $(DESTDIR)$(prefix)/etc/bash_completion.d ] && install -dM 644 ../run/john.bash_completion $(DESTDIR)$(prefix)/etc/bash_completion.d/john.bash_completion ``` etc
Author
Owner

@rofl0r commented on GitHub (Sep 25, 2015):

optimally the bash/zsh completion location needs to be specified with a configure argument.
if not specified, it should be omitted

<!-- gh-comment-id:143335644 --> @rofl0r commented on GitHub (Sep 25, 2015): optimally the bash/zsh completion location needs to be specified with a configure argument. if not specified, it should be omitted
Author
Owner

@rofl0r commented on GitHub (Sep 25, 2015):

apart from stripping and the bash completion, there doesnt seem to be anything installed.
is there a description of where in the FS the binaries and other files like *.chr need to be installed ?
copying anything from run/ into /bin seems to be a bad idea since there's mixed content and a lot of scripts that may have conflicting names with system programs.

<!-- gh-comment-id:143340668 --> @rofl0r commented on GitHub (Sep 25, 2015): apart from stripping and the bash completion, there doesnt seem to be anything installed. is there a description of where in the FS the binaries and other files like *.chr need to be installed ? copying anything from run/ into /bin seems to be a bad idea since there's mixed content and a lot of scripts that may have conflicting names with system programs.
Author
Owner

@magnumripper commented on GitHub (Sep 26, 2015):

I agree about some of your points... but what makes you think DESTDIR should be honoured? Is that some standard thing?

<!-- gh-comment-id:143382596 --> @magnumripper commented on GitHub (Sep 26, 2015): I agree about some of your points... but what makes you think DESTDIR should be honoured? Is that some standard thing?
Author
Owner

@magnumripper commented on GitHub (Sep 26, 2015):

BTW just FYI the latest release was 1.8.0-jumbo-1 in December 2014 (it probably had these exact bugs), and next release will be jumbo-2 - probably in several months from now. Everything in between is bleeding-edge.

<!-- gh-comment-id:143383862 --> @magnumripper commented on GitHub (Sep 26, 2015): BTW just FYI the latest release was 1.8.0-jumbo-1 in December 2014 (it probably had these exact bugs), and next release will be jumbo-2 - probably in several months from now. Everything in between is bleeding-edge.
Author
Owner

@rofl0r commented on GitHub (Sep 26, 2015):

yes, DESTDIR is a standard thing https://www.gnu.org/prep/standards/html_node/DESTDIR.html
without it its impossible (without comparing fs snapshots) to create a binary distribution.
sabotage linux uses the feature to put every app into its own directory and then symlink it into the standard paths (like gnu stow).

<!-- gh-comment-id:143476376 --> @rofl0r commented on GitHub (Sep 26, 2015): yes, DESTDIR is a standard thing https://www.gnu.org/prep/standards/html_node/DESTDIR.html without it its impossible (without comparing fs snapshots) to create a binary distribution. sabotage linux uses the feature to put every app into its own directory and then symlink it into the standard paths (like gnu stow).
Author
Owner

@magnumripper commented on GitHub (Sep 26, 2015):

I see, thank you! Hopefully fixed in e14451e. I did not use $(prefix) yet though, because we have a tricky legacy (prefix will probably be used for "JOHN_SYSTEMWIDE" at some point in the future). But 'strip' and 'ar' should now be correctly chosen for cross-compile. Does this solve your problems? Please close if so.

<!-- gh-comment-id:143482768 --> @magnumripper commented on GitHub (Sep 26, 2015): I see, thank you! Hopefully fixed in e14451e. I did not use `$(prefix)` yet though, because we have a tricky legacy (prefix will probably be used for "JOHN_SYSTEMWIDE" at some point in the future). But 'strip' and 'ar' should now be correctly chosen for cross-compile. Does this solve your problems? Please close if so.
Author
Owner

@magnumripper commented on GitHub (Sep 26, 2015):

BTW, we should ideally use AC_CHECK_TOOL for yasm too, but I'm currently relying on AC_PATH_PROGS_FEATURE_CHECK so I'm not quite sure how to accomplish that. Perhaps run the former first, and then try to use its result for the latter check...

<!-- gh-comment-id:143483804 --> @magnumripper commented on GitHub (Sep 26, 2015): BTW, we should ideally use AC_CHECK_TOOL for yasm too, but I'm currently relying on AC_PATH_PROGS_FEATURE_CHECK so I'm not quite sure how to accomplish that. Perhaps run the former first, and then try to use its result for the latter check...
Author
Owner

@magnumripper commented on GitHub (Sep 26, 2015):

apart from stripping and the bash completion, there doesnt seem to be anything installed.
is there a description of where in the FS the binaries and other files like *.chr need to be installed ?
copying anything from run/ into /bin seems to be a bad idea since there's mixed content and a lot of scripts that may have conflicting names with system programs.

There isn't anything else installed... everything is still in ../run directory. This is how "John Proper" works and I'm not sure I can change it easily. For distros, you are really supposed to use JOHN_SYSTEMWIDE (located in params.h, which is also the only documentation...). But that doesn't currently work well with autoconf (or maybe it does, I did not really test it), so then you should probably use Makefile.legacy... which is not a good thing.

Ideally, some distro maintainer should work this out with me and Solar on john-dev mailing list. I'm not quite sure how to attack this mess.

On another note, a distro is also supposed to use fallback binaries. They too are only "documented" in params.h...

<!-- gh-comment-id:143485572 --> @magnumripper commented on GitHub (Sep 26, 2015): > apart from stripping and the bash completion, there doesnt seem to be anything installed. > is there a description of where in the FS the binaries and other files like *.chr need to be installed ? > copying anything from run/ into /bin seems to be a bad idea since there's mixed content and a lot of scripts that may have conflicting names with system programs. There isn't anything else installed... everything is still in ../run directory. This is how "John Proper" works and I'm not sure I can change it easily. For distros, you are really supposed to use JOHN_SYSTEMWIDE (located in params.h, which is also the only documentation...). But that doesn't currently work well with autoconf (or maybe it does, I did not really test it), so then you should probably use Makefile.legacy... which is not a good thing. Ideally, some distro maintainer should work this out with me and Solar on john-dev mailing list. I'm not quite sure how to attack this mess. On another note, a distro is also supposed to use fallback binaries. They too are only "documented" in params.h...
Author
Owner

@rofl0r commented on GitHub (Sep 27, 2015):

yasm is getting used as well ? i didn't notice.
i personally prefer asm files written in gnu syntax so they can be passed to gcc/clang without having to invoke an external assembler (the gcc frontend calls the binutils as from the (cross)compiler install). this makes especially crosscompilation much easier (yasm is x86 only).

i see the dilemma with the stuff in run/ - you definitely dont want everything in /bin.
a possible make install strategy:
put john binary and *2john into $(DESTDIR)$(bindir)/ (where $(bindir) is $(prefix)/bin, unless overridden by the user).
the .chr and similar files could go into $(sharedir)/john-data ($(prefix)/share)
the other perl scripts with non-john specific name could go into $(sharedir)/john-scripts/
john.conf into ($sysconfdir)/ (usually $(prefix)/etc)
docs would go into $(sharedir)/docs/john/
to make it customizable for a non-root user, john would then search the files first in ~/.john and if not found pick them up from $(sharedir) or whatever.

<!-- gh-comment-id:143528817 --> @rofl0r commented on GitHub (Sep 27, 2015): yasm is getting used as well ? i didn't notice. i personally prefer asm files written in gnu syntax so they can be passed to gcc/clang without having to invoke an external assembler (the gcc frontend calls the binutils as from the (cross)compiler install). this makes especially crosscompilation much easier (yasm is x86 only). i see the dilemma with the stuff in run/ - you definitely dont want everything in /bin. a possible make install strategy: put john binary and *2john into $(DESTDIR)$(bindir)/ (where $(bindir) is $(prefix)/bin, unless overridden by the user). the .chr and similar files could go into $(sharedir)/john-data ($(prefix)/share) the other perl scripts with non-john specific name could go into $(sharedir)/john-scripts/ john.conf into ($sysconfdir)/ (usually $(prefix)/etc) docs would go into $(sharedir)/docs/john/ to make it customizable for a non-root user, john would then search the files first in ~/.john and if not found pick them up from $(sharedir) or whatever.
Author
Owner

@magnumripper commented on GitHub (Sep 27, 2015):

Yasm is only used for AES-NI which is Intel specific anyway.

The default when using JOHN_SYSTEMWIDE is:
/usr/libexec/john: executable code
/usr/share/john: data, read-only for user (.chr files etc)
~/.john: read-write data directory for user. Created when running john, if it does not exist.

All three are configurable. Any distro should definitely define JOHN_SYSTEMWIDE.

<!-- gh-comment-id:143540260 --> @magnumripper commented on GitHub (Sep 27, 2015): Yasm is only used for AES-NI which is Intel specific anyway. The default when using JOHN_SYSTEMWIDE is: /usr/libexec/john: executable code /usr/share/john: data, read-only for user (.chr files etc) ~/.john: read-write data directory for user. Created when running john, if it does not exist. All three are configurable. Any distro should **definitely** define JOHN_SYSTEMWIDE.
Author
Owner

@magnumripper commented on GitHub (Oct 8, 2015):

Closing in favor of #982

<!-- gh-comment-id:146688480 --> @magnumripper commented on GitHub (Oct 8, 2015): Closing in favor of #982
Author
Owner

@magnumripper commented on GitHub (Oct 26, 2015):

See also https://github.com/magnumripper/JohnTheRipper/wiki/Fallback-binary-chain,-without-JOHN_SYSTEMWIDE (which of course can be slightly modified to do JOHN_SYSTEMWIDE too).

<!-- gh-comment-id:151314204 --> @magnumripper commented on GitHub (Oct 26, 2015): See also https://github.com/magnumripper/JohnTheRipper/wiki/Fallback-binary-chain,-without-JOHN_SYSTEMWIDE (which of course can be slightly modified to do JOHN_SYSTEMWIDE too).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1187
No description provided.