Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Contributions to ELOG  Not logged in ELOG logo
Entry   Compiling elogd.c on HP-UX 64 bit, posted by Peter Rienstra on Wed Jul 11 11:13:16 2007 elogdhpux64.c.gz
    Reply   Re: Compiling elogd.c on HP-UX 64 bit, posted by Stefan Ritt on Fri Jul 13 12:36:45 2007 
       Reply   Re: Compiling elogd.c on HP-UX 64 bit, posted by Peter Rienstra on Mon Jul 16 15:27:08 2007 man_setuid.txtman_setreuid.txtman_setresuid.txt
          Reply   Re: Compiling elogd.c on HP-UX 64 bit, posted by Stefan Ritt on Mon Jul 16 15:57:47 2007 
             Reply   Re: Compiling elogd.c on HP-UX 64 bit, posted by Peter Rienstra on Mon Jul 16 16:43:07 2007 
Message ID: 22     Entry time: Wed Jul 11 11:13:16 2007     Reply to this: 23
Author: Peter Rienstra 
Author Email: peter.rienstra@gmail.com 
Category: Other 
Subject: Compiling elogd.c on HP-UX 64 bit 
Status: Beta 
Last Revision: Thu Jul 12 09:38:47 2007 by Peter Rienstra 
We succeeded in compiling and running elogd (elog-2.6.5) on HP-UX 64 bit Itanium platform (HP-UX B.11.23 U ia64).

The main problem was we got a core dump after starting elogd. The cause was that the memory has be allocated with a 4 byte boundary. This could be the case on other 64 bit platforms as well. A colleague of mine (Sander Notting) found the solution.

Unzip and untar the zip file (elog-latest.tar.gz)
Go to the src directory (elog-2.6.5/src)

Edit elogd.c

Replace all:

show_selection_page(NULL); => show_selection_page();
seteuid => setuid
setegid => setgid

On line 564:
void *buffer => char *buffer


Line 645, add the text in bold:

void *xmalloc(size_t bytes)
{
char *temp;

/* Align buffer on 4 byte boundery for HP UX and other 64 bit systems to prevent Bus error(core dump)*/
if (bytes & 3)
bytes += 4 - (bytes & 3);


temp = (char *) malloc(bytes + 12);


After that compile:

cc -w -c -o regex.o regex.c
cc -w -c -o mxml.o ../../mxml/mxml.c
cc -w -c -o strlcpy.o ../../mxml/strlcpy.c
cc -I../../mxml -o elogd elogd.c regex.o mxml.o strlcpy.o

We didn't try to run elogd under root yet.
Attachment 1: elogdhpux64.c.gz  156 kB  Uploaded Thu Jul 12 10:41:27 2007
ELOG V3.1.5-fe60aaf