Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 13 May 2011 20:13:39 +0400
From: Solar Designer <solar@...nwall.com>
To: john-users@...ts.openwall.com
Subject: Re: ITIMER_REAL'  error in bench.c

Robert, Jim, all -

On Wed, May 11, 2011 at 05:47:08PM -0400, Robert Harris wrote:
> I get the following error trying to compile 
> 
> JtR 1.7.7 and JtR 1.7.7 jumbo 1 on Solaris x86.
> 
> bench.c: In function `benchmark_format':
> bench.c:96: error: storage size of 'it' isn't known
> bench.c:140: warning: implicit declaration of function `setitimer'
> bench.c:140: error: `ITIMER_REAL' undeclared (first use in this function)

This must be a regression introduced with this change:

http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/john/john/src/bench.c.diff?r1=1.8;r2=1.9

documented as:

"Define _XOPEN_SOURCE for setitimer(2).  Problem seen when compiling
with musl."

musl is an alternative libc for Linux:

http://www.etalabs.net/musl/

Apparently, Solaris thinks that having _XOPEN_SOURCE merely defined
without requesting a specific version of the X/Open specification means
that we want a fairly old version.

Thus, a workaround is to remove "#define _XOPEN_SOURCE" (this breaks
compiles with musl, but should allow the code to compile on Solaris).

A proper fix is to figure out what to replace the "#define _XOPEN_SOURCE"
with.  Maybe replace _XOPEN_SOURCE with _POSIX_SOURCE.  Maybe specify a
version, like:

#define _XOPEN_SOURCE 500

This is what signals.c uses because it also needs siginterrupt(3).

Robert - can you please give "#define _XOPEN_SOURCE 500" a try?  If it
works, this is likely the fix I'll commit.

To give another example, c3_fmt.c uses this weird combination:

#define _XOPEN_SOURCE 4 /* for crypt(3) */
#define _XOPEN_SOURCE_EXTENDED
#define _XOPEN_VERSION 4
#define _XPG4_2

which is needed (based on my experience with popa3d) to get crypt(3)
defined on a variety of systems.

We need to come up with similarly portable yet preferably minimal and
clean settings for getting setitimer(2) defined.  Hopefully, a simple
"#define _XOPEN_SOURCE 500" will be it.

Thanks,

Alexander

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.