[GH-ISSUE #670] handling missing "libbz2-dev" package #323

Closed
opened 2026-10-14 03:01:20 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @kholia on GitHub (Jun 23, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/670

On a new Ubuntu 14.04 box, which did not have libbz2-dev package installed, I get,

$ make -s -j32
gpg2john.o: In function `inflate_bzip2':
...src/gpg2john.c:2586: undefined reference to `BZ2_bzDecompress'
...src/gpg2john.c:2599: undefined reference to `BZ2_bzDecompressEnd'
gpg2john.o: In function `Compressed_Data_Packet':
...src/gpg2john.c:2716: undefined reference to `BZ2_bzDecompressInit'

Can the new fancy autoconf stuff help us here?

Originally created by @kholia on GitHub (Jun 23, 2014). Original GitHub issue: https://github.com/openwall/john/issues/670 On a new Ubuntu 14.04 box, which did not have `libbz2-dev` package installed, I get, ``` $ make -s -j32 gpg2john.o: In function `inflate_bzip2': ...src/gpg2john.c:2586: undefined reference to `BZ2_bzDecompress' ...src/gpg2john.c:2599: undefined reference to `BZ2_bzDecompressEnd' gpg2john.o: In function `Compressed_Data_Packet': ...src/gpg2john.c:2716: undefined reference to `BZ2_bzDecompressInit' ``` Can the new fancy autoconf stuff help us here?
bsakaguchi 2026-10-14 03:01:20 +07:00
  • closed this issue
  • added the
    invalid
    label
Author
Owner

@magnumripper commented on GitHub (Jun 23, 2014):

It was supposed to already do that - it should only enable it if present.

<!-- gh-comment-id:46903409 --> @magnumripper commented on GitHub (Jun 23, 2014): It was supposed to already do that - it should only enable it if present.
Author
Owner

@magnumripper commented on GitHub (Jun 23, 2014):

This is the autoconf source:

AC_CHECK_HEADER([bzlib.h], [AC_CHECK_LIB([bz2],[main],
                          AC_DEFINE([HAVE_LIBBZ2],1,[Define to 1 if you have bz2 library and headers]) [AC_SUBST(BZ2_LIBS, [-lbz2])])])

This means it should only define HAVE_LIBBZ2 if the header and the library is present. Maybe the problem is in the #if's in gpg2john.c.

<!-- gh-comment-id:46903633 --> @magnumripper commented on GitHub (Jun 23, 2014): This is the autoconf source: ``` AC_CHECK_HEADER([bzlib.h], [AC_CHECK_LIB([bz2],[main], AC_DEFINE([HAVE_LIBBZ2],1,[Define to 1 if you have bz2 library and headers]) [AC_SUBST(BZ2_LIBS, [-lbz2])])]) ``` This means it should only define HAVE_LIBBZ2 if the header _and_ the library is present. Maybe the problem is in the #if's in gpg2john.c.
Author
Owner

@magnumripper commented on GitHub (Jun 23, 2014):

gpg2john.c looks fine. What's the output of grep BZ2 autoconfig.h?

<!-- gh-comment-id:46903839 --> @magnumripper commented on GitHub (Jun 23, 2014): gpg2john.c looks fine. What's the output of `grep BZ2 autoconfig.h`?
Author
Owner

@kholia commented on GitHub (Jun 23, 2014):

$ grep BZ2 autoconfig.h
/* #undef HAVE_LIBBZ2 */

Everything seems to be fine. I had the configure results from the last OS installation.

Labeling the issue as PEBCAK ;(

<!-- gh-comment-id:46904303 --> @kholia commented on GitHub (Jun 23, 2014): ``` $ grep BZ2 autoconfig.h /* #undef HAVE_LIBBZ2 */ ``` Everything seems to be fine. I had the `configure` results from the last OS installation. Labeling the issue as PEBCAK ;(
Author
Owner

@jfoug commented on GitHub (Jun 23, 2014):

lol, yes lbz2 was added specifically for this tool, to give it support for 'extra' types, but if the lib is not there, it should still build.

<!-- gh-comment-id:46904545 --> @jfoug commented on GitHub (Jun 23, 2014): lol, yes lbz2 was added specifically for this tool, to give it support for 'extra' types, but if the lib is not there, it should still build.
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#323
No description provided.