Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 27 Sep 2012 20:34:05 +0530
From: Dhiru Kholia <dhiru.kholia@...il.com>
To: john-dev@...ts.openwall.com
Subject: Compiling JtR (unstable-jumbo) on FreeBSD 9.1

Hi,

I had to install and use gmake on FreeBSD in order to compile JtR.

1. I ran into the following problem during compilation,

dmg_fmt_plug.c:34:20: error: alloca.h: No such file or directory
gmake[1]: *** [dmg_fmt_plug.o] Error 1

It seems that the declaration of of alloca function is in stdlib.h on
FreeBSD systems.

The following patch solved the problem,

diff --git a/src/dmg_fmt_plug.c b/src/dmg_fmt_plug.c
index 5df3207..1629f96 100644
--- a/src/dmg_fmt_plug.c
+++ b/src/dmg_fmt_plug.c
@@ -28,9 +28,12 @@
  *
  * NOTE: format is marked as FMT_NOT_EXACT for testing purposes */

+#if (defined(__unix__) || defined(unix)) && !defined(USG)
+#include <sys/param.h>  // to get BSD define
+#endif
 #include <string.h>
 #include <errno.h>
-#ifndef _MSC_VER
+#if !defined _MSC_VER && !defined BSD
 #include <alloca.h>
 #endif
 #include <fcntl.h>

Is this patch okay?

2. Is it necessary to include alloca.h file at all? gpg format uses
alloca function and it doesn't include alloca.h file.

3. Is alloca's declaration same across all platforms? Can we just
manually specify its prototype instead of including alloca.h file?

-- 
Cheers,
Dhiru

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ