Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Contributions to ELOG, Page 1 of 6  Not logged in ELOG logo
ID Date Author Author Email Category Subjectup Status Last Revision
  29   Thu Nov 27 11:43:32 2008 T. Ribbrockemgaron+elog@ribbrock.orgScript/etc/init.d/elog script for Debian-like distrosStable 

The attached script was used by the Debian package (which is no longer maintained) to start/stop elogd. I have changed it based on some comments in the forum (see script) to add some more functionality. As there is no mainatined elog package for Debian anymore, I'm placing it here in the hope that it might come in handy for users who want to run elog under Debian.

This script needs to be placed in /etc/init.d and expects elogd to be installed as /usr/sbin/elogd (can be changed, of course).

Attachment 1: elog
#!/bin/sh
# Init script for ELOG.
# Copyright © 2003, 2005  Recai Oktaş <roktas@omu.edu.tr>
#
# Additional changes by Thomas Ribbrock <emgaron@ribbrock.org>
# - 2008-11-27: Added better reload functionality, based on suggestion and
#   code from Yoshio Imai as posted in elog forum
#
# Licensed under the GNU General Public License, version 2.
# See the file `http://www.gnu.org/copyleft/gpl.txt'.

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/elogd
NAME=elogd
DESC="ELOG daemon"

test -f $DAEMON || exit 0

set -e

# Admin should be able to lock some options.
if [ -f /etc/default/elog ]; then
	. /etc/default/elog
fi

# To be in the safe side, the followings should be always defined.
PIDFILE=${PIDFILE:-/var/run/$NAME.pid}
CONFFILE=${CONFFILE:-/etc/elog.conf}

# Add the options to argument list only if defined previously.  Since
# some options may also be present in the conffile, we couldn't preset
# those options which would otherwise overwrite the settings in the
# conffile.  Also note that, all have reasonable compiled-in defaults.
ARGS="${PIDFILE+"-f $PIDFILE"}         \
      ${CONFFILE+"-c $CONFFILE"}       \
      ${LOGBOOKDIR+"-d $LOGBOOKDIR"}   \
      ${RESOURCEDIR+"-s $RESOURCEDIR"} \
      ${PORT+"-p $PORT"}               \
      ${HOST+"-n $HOST"}               \
      ${VERBOSE+"-v"}"
      
# Always run as a daemon.
ARGS=`echo $ARGS -D`

case "$1" in
	start)
		echo -n "Starting $DESC: "
		start-stop-daemon --start --quiet --pidfile $PIDFILE \
			--exec $DAEMON -- $ARGS 2>&1
		sleep 1
		if [ -f "$PIDFILE" ] && ps h `cat "$PIDFILE"` >/dev/null; then
			echo "$NAME."
		else
			echo "$NAME failed to start; check syslog for diagnostics."
			exit 1
		fi
		;;
	stop)
		echo -n "Stopping $DESC: $NAME"
		start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
			--exec $DAEMON -- $ARGS 2>&1
		echo "."
		;;
	reload)
		# Send HUP signal to reload config file
		# (Only needed if config is edited manually and not via
		# webinterface)
		if [ -f $PIDFILE ]; then
			echo -n "$DESC to reread config file ... "
			kill -HUP `cat "$PIDFILE"`
			echo "done"
		else
			echo "No $PIDFILE found!"
		fi
		;;
	restart|force-reload)
		$0 stop
		sleep 1
		$0 start
		if [ "$?" != "0" ]; then
			exit 1
		fi
		;;
	*)
		N=/etc/init.d/$NAME
		echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
		exit 1
		;;
esac

exit 0

# vim:ai:sts=8:sw=8:
  153   Tue Dec 7 01:38:23 2021 Anthony J Krishockajkrishock@gmail.comTheme/SkinAstronomical logbook using ElogStableTue Dec 7 01:44:25 2021 by Anthony J Krishock

Hello all,

I became aware of the usefulness of Elog while working at Brookhaven National Lab. Since that time, I have developed a version of Elog that can be used as a log book for observations in Astronomy (my longtime hobby). Attached is my default.css theme and replacement icon files that match the theme. The color scheme is chosen to minimize bright lights and preserve night vision

To install, just place the default.css file in the default theme directory and copy over the icon files into the default theme directory and replace the default ones. 

Comments and suggestions welcome!

Thank you

Attachment 1: theme.zip
Attachment 2: elog.PNG
elog.PNG
  7   Wed Jan 14 18:30:34 2004 Francois CukierFrancois.Cukier@Umontreal.caTheme/SkinBubble for pleasure 1 -- still under developpement but working ;)Beta 
Uncompress "Bubbleforpleasure1.zip" in your Themes\default folder if you want to replace the original elog theme. Otherwise, if you decompress it in another folder, you will need to modify your elogd.cfg file as described at this adress: http://midas.psi.ch/elog/config.html
Attachment 1: Bubbleforpleasure1.zip
Attachment 2: BubbleForPleasure1-theme.GIF
BubbleForPleasure1-theme.GIF
  13   Thu Apr 28 15:45:58 2005 Alex Halexsynergie-infcomTheme/SkinBubble for pleasure by L'ange noirStableMon Aug 1 09:35:26 2005 by Alex H
The original theme is from Francois Cukier but I have change a some color 
and font.

Francois Cukier  said : "Uncompress "Bubble.zip" in your Elog default 
folder if you want to replace the original elog theme. Otherwise, if you 
decompress it in another folder, you will need to modify your elogd.cfg 
file as described at this adress: http://midas.psi.ch/elog/config.html"

Do it at the same ;o)

I want to thanks Francois Cukier and Stephan Ritt for their works, so 
THANKS a lot !

I wait your comments :o).


-UPDATE------------------------------------------------------------------------
2005/08/1 : Alexander Sheremet correct CSS bug thanks to it, archive re-uploaded
Attachment 1: bubble2-1.gif
bubble2-1.gif
Attachment 2: bubble2-2.gif
bubble2-2.gif
Attachment 3: Bubble.zip
  33   Thu Feb 3 23:51:16 2011 T. Ribbrockemgaron+elog@ribbrock.orgOtherBuilding elog on OpenBSDStable 

Two things are required to get elog (tested with 2.8.1) to compile on OpenBSD (tested on OpenBSD 4.8):

Step 1 - Patch Makefile:

--- Makefile~ Mon Jan 24 21:38:09 2011
+++ Makefile Mon Jan 24 21:42:57 2011
@@ -50,6 +50,10 @@
 RM = /usr/bin/rm -f
 endif

+ifeq ($(OSTYPE),OpenBSD)
+LIBS += -lcrypto
+endif
+
 ifeq ($(OSTYPE),Darwin)
 OSTYPE=darwin
 endif

Step 2 - Use "gmake" instead of the standard "make" to build.

 

  52   Fri Sep 15 17:19:47 2017 Andreas Luedekeandreas.luedeke@psi.chScriptCheck logbook files for wrong referencesStableFri Sep 15 17:41:41 2017 by Andreas Luedeke
You can run this little script to check if all entries referenced "In reply to:" do actually exist.
To use it, you first need to "cd" to your logbook directory ("cd /usr/local/elog/logbooks") and then run it without arguments "logcheck".
If it finds references pointing to a missing entry, it'll print the path to the file with the offending reference and some lines. For example:
### error: reference to entry 146, that exists 0 times. Reference is:
### Proscan/2012/120507a.log-<p>[...].</p>
### Proscan/2012/120507a.log-$ @ MID @ $: 147
### Proscan/2012/120507a.log-Date: Mon, 07 May 2012 13:44:03 +0200
### Proscan/2012/120507a.log:In reply to: 146
### Proscan/2012/120507a.log-Wann: 1336373261
### Proscan/2012/120507a.log-Autor: [...]
### Proscan/2012/120507a.log-Eintrag: Problem
[...]-

Very often this happens if an entry is deleted AFTER someone already replied to it. Normally that is no problem, but in some cases you might get infinite loops and that causes ELOG to hang. The script is not checking for loops, but wrong references might give you a hint where to look.

The script will print duplicate entries as well, if the referenced entry exist more than once.

Cheers, Andreas

PS: never include the string "$ @ MID @ $:" without spaces in an ELOG entry: apparently ELOG cuts off all text from that token on.

Attachment 1: logcheck
#!/usr/bin/perl
$cmd=q/find * -noleaf -maxdepth 0 -wholename Backup -prune -o -wholename en -prune -o -type d -exec printf '%s:' {} + /;
#print $cmd;
$logf=q/*\/[0-9][0-9][01][0-9][0-3][0-9]a.log/;
open(INP,$cmd . "2>/dev/null |") || die "can't open " . $cmd . ": $!";
$list=<INP>;
close(INP);
#print "list=" . $list ."\n";
foreach $dir (split(":",$list)) {
    chomp $dir;
    if (length($dir) > 1) {
        print "Check \"" . $dir . "\"\n";
        $files=$dir . "/" . $logf;
        $cmd="grep ^In.reply.to: " . $files . " 2>/dev/null | cut -d \" \" -f 4 | sort -nu |";
        open(INPB,$cmd) || die "can't open " . $cmd . ": $!";
        while (<INPB>) {
            chomp;
            $id=$_;
            $cmd="grep '[\$\]\@MID\@[\$\]:.$id\$' $files |";
            open(INPC,$cmd) || die "can't open " . $cmd . ": $!";
            $c=0;
            while (<INPC>) {$c++};
            close(INPC);
            if ($c != 1) {
                print "### error: reference to entry $id, that exists $c times. Reference is:\n";
                $cmd="grep -C 3 '^In.reply.to:.$id\$' $files |";
                #print $cmd;
                open(INPD,$cmd) || die "can't open " . $cmd . ": $!";
                while (<INPD>) {
                    print "### ".$_;
                }
                close(INPD);
            }
        }
        close(INPB);
    }
}
  42   Mon Apr 29 04:29:33 2013 Ryan Blakesleerb@blakesys.netTheme/SkinClean plain-text CSS - modified from default.cssStableMon Apr 29 23:34:40 2013 by Ryan Blakeslee
Hello,

I am using ELOG 2.5.2. I had a real need for a simplified almost text-only version of the application.  For me 
personally, I like simple, minimalist and text-only as much as possible for the tools I use.  I personally found 
the layout with all the colors to be distracting from the content of each log entry.  Again this is ONLY my 
personal preference, NO offense meant. :-)

I took the default.css and modified it to achieve what I needed.  I am uploading here, the .css file.  It uses 
"blue" for some of the things such as attribute fields on single page view, etc.  but overall it's all clean, 
plain-text.

I don't know if this css will work on newer versions of ELOG (since I know i'm using an old one.)  But it's my 
hope that others like me, will find this modification very useful.

Thank you Stefan, and community -- this is an awesome tool, that I use in my business.  It's amazing how simple 
tools are always the most powerful and scale-able!  Fantastic, excellent job on this app.
Attachment 1: plaintxt-blue.css
\/* default formatting */
body {
  margin:3px;
  color:black;
  background-color:white;
  font-family:sans-serif;
}

/* standard link colors and decorations */
a:link { color:#0000FF; text-decoration:none }
a:visited { color:#0000FF; text-decoration:none }
a:hover { color:#0000FF; text-decoration:underline }
a:active { color:#0000FF; text-decoration:underline }
a:focus { color:#0000FF; text-decoration:underline }

td {
  color:black;
  font-family:sans-serif; 
}

/* frame table */
.frame {
  width:100%;
}

/* printable frame table */
.pframe {
  width:600;
}

/* standard formatting for logbook tabs */
.tabs {
  font-family:sans-serif;
  font-size:10pt;
  background-color:white;
}

/* logbook selection page */
.selframe {
  width:60%;
  background-color:#486090; 
  border:1px solid #486090;
  font-size:12pt;
}

.seltitle {
  border:1px solid #0000FF;
  border-top:1px solid white;
  border-left:1px solid white;
  background-color:#CCCCFF;
  color:#486090;
  text-align:center;
}

.selexp {
  border:1px solid #0000FF;
  border-top:1px solid white;
  border-left:1px solid white;
  background-color:#CCCCFF;
  color:#486090;
  text-align:left;
  font-size:10pt;
}

.selspace {
  width:2%;
  border:1px solid #308000;
  border-top:1px solid white;
  border-left:1px solid white;
  background-color:#EEEEEE;
}

.selgroup {
  border:1px solid #308000;
  border-top:1px solid white;
  border-left:1px solid white;
  background-color:#FFCCFF;
  padding:3px;
  text-align:left;
  font-weight:bold;
  font-size:14pt;
}

.sellogbook {
  border:1px solid #308000;
  border-top:1px solid white;
  border-left:1px solid white;
  background-color:#DDEEBB;
  padding:3px;
  text-align:left;
  font-weight:bold;
}

.selcomment {
  font-size:8pt;
}

.selentries {
  background-color:#E0E0A0;
  border:1px solid #0000FF;
  border-top:1px solid white;
  border-left:1px solid white;
  text-align:center;
  font-size:10pt;
}

/* unselected and selected group tabs */

.gtab a {
  background-color:#B0E0B0;
  padding-left:5px;
  padding-right:5px;
}

.gtab {
  background-color:#B0E0B0;
  border-right:1px solid #409040;
}

.sgtab a {
  color:white;
  padding-left:5px;
  padding-right:5px;
}

.sgtab {
  background-color:#486090;
  color:white;
  border-right:1px solid #084070;
}

.sgtab a:visited { color:white; } /* bug for IE */

/* unselected and selected logbook tabs */

.ltab a {
  background-color:#E0E0E0;
  padding-left:5px;
  padding-right:5px;
}

.ltab {
  background-color:#E0E0E0;
  border-right:1px solid gray;
}

.sltab a {
  background-color:#486090;
  color:white;
  padding-left:5px;
  padding-right:5px;
}

.sltab {
  background-color:#486090;
  color:white;
  border-right:1px solid #084070;
}

.sltab a:visited { color:white; } /* bug for IE */

/* logbook title, left, middle and right cell */

.title1 {
  background-color:#486090;
  border-bottom:1px solid gray;
  border-top:1px solid #E0E0E0;
  border-left:1px solid #E0E0E0;
  color:white;
  font-size:medium;
  font-family:sans-serif;
  text-align:left;
}

.title1 a:visited { color:#A0FFA0; }
.title1 a:link { color:#A0FFA0; }

.title2 {
  background-color:#486090;
  border-bottom:1px solid black;
  border-top:1px solid #E0E0E0;
  color:white;
  font-size:medium;
  font-family:sans-serif;
  text-align:center;
}

.title3 {
  border-bottom:1px solid black;
  border-top:1px solid #E0E0E0;
  border-right:0px solid gray;
  background-color:#486090;
  text-align:left;
}

/* main menu row */

.menuframe {
  border:0px solid black;
  border-top:1px solid gray;
  border-right:0px solid gray;
  border-left:0px solid gray;
  padding:3px;
  background-color:white;
}

.menu1 {
  text-align:left;
  font-size:10pt;
}

.menu2a {
  text-align:left;
  font-size:10pt;
}

.menu2b {
  text-align:right;
  font-size:10pt;
}

.menu3 {
  text-align:left;
  font-size:8pt;
  font-weight:bold;
}

.menu4 {
  text-align:right;
  font-size:10pt;
  vertical-align:middle;
}

/* frame table in listings */
.listframe {
  border:0px solid gray;
  border-top:0px solid gray;
  border-left:0pc solid gray;
  background-color:white;
  border:0px;
}

/* title row in listing */
.listtitle {
  border:0px solid black;
  border-top:1px solid gray;
  border-left:0px solid gray;
  background-color:white;
  text-align:left;
}

/* attachment line */

.attachment {
  border-left:1px solid gray;
  border-right:1px solid gray;
  border-bottom:1px solid gray;
  background-color:#FFFFB0;
  text-align:left;
}

/* threaded listing */
.thread {
  border:0px solid gray;
  border-top:0px solid gray;
  border-left:0px solid gray;
  background-color:white;
}

.threadreply {
  border:0px solid #808040;
  border-top:0px solid white;
  border-left:0px solid white;
  background-color:white;
  text-align:left;
}

/* attribute names and values on single message page */
.attribhead {
  background-color:white;
  border:0px solid gray;
  border-top:1px solid gray;
  border-bottom:1px solid gray;
  border-left:0px solid gray;
  padding:0px;
  font-size:12pt;
  font-family:sans-serif;
}

.attribname {
  width:150px;
  background-color:#486090;
  color:white;
  padding-left:5px;
  padding-right:5px;
  padding:3px;
  border:1px solid white;
}

.attribvalue {
... 225 more lines ...
Attachment 2: summary.png
summary.png
Attachment 3: full.png
full.png
Attachment 4: single-view.png
single-view.png
Attachment 5: find.png
find.png
  148   Mon Mar 11 09:28:15 2019 Mauratgm001@free.frScriptCode change for LDAP authenticationStableMon Mar 11 10:15:43 2019 by Maurat

Hi,

I had to change code to authenticate users in my organization's LDAP directory. Indeed, accounts are distributed under several organizational units in my LDAP directory.

The current version of the code can't authenticate accounts when these are in different organizational units. Hence my contribution.

I Use a read account to request LDAP to locate the account that has logged in (with e-mail address in the search filter).

I get the number of LDAP entries. If I have one entry then I call ldap_get_dn function to get the DN account and then I call ldap_simple_bind_s using the account's DN and password to perform LDAP authentication.

I changed configuration file elogd.cfg. I added two parameters:

LDAP DN user = <DN read account>

LDAP PW user = <password read account>

I changed code auth.c too (see attached file)

I had to change Makefile. I added a call to lber library

ifdef USE_LDAP
ifneq ($(USE_LDAP),0)
CFLAGS += -DHAVE_LDAP
LIBS += -lldap -llber
endif
endif

Have good day

 

 

 

 

 

 

Attachment 1: auth.c
/********************************************************************\

  Name:         auth.c
  Created by:   Stefan Ritt
  Copyright 2000 + Stefan Ritt

  ELOG is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  ELOG is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with ELOG.  If not, see <http://www.gnu.org/licenses/>.


  Contents:     Authentication subroutines. Currently supported:

                - password file authentication
                - kerberos5 password authentication

  $Id: elog.c 2350 2010-12-23 10:45:10Z ritt $

\********************************************************************/

#include "elogd.h"

#ifdef HAVE_KRB5
#include <krb5.h>
#endif

#ifdef HAVE_LDAP
#include <ldap.h>

LDAP *ldap_ld;
char ldap_login_attr[64];
char ldap_dn_user[256];
char ldap_pw_user[64];
char ldap_userbase[256];
char ldap_bindDN[512];
#endif  /* HAVE_LDAP */

extern LOGBOOK *lb_list;

/*==================================================================*/

/*---- Kerberos5 routines ------------------------------------------*/

#ifdef HAVE_KRB5

int auth_verify_password_krb5(LOGBOOK * lbs, const char *user, const char *password, char *error_str,
                              int error_size)
{
   char *princ_name, str[256], realm[256];
   krb5_error_code error;
   krb5_principal princ;
   krb5_context context;
   krb5_creds creds;
   krb5_get_init_creds_opt options;

   if (krb5_init_context(&context) < 0)
      return FALSE;

   strlcpy(str, user, sizeof(str));
   if (getcfg(lbs->name, "Kerberos Realm", realm, sizeof(realm))) {
      strlcat(str, "@", sizeof(str));
      strlcat(str, realm, sizeof(str));
   }
   if ((error = krb5_parse_name(context, str, &princ)) != 0) {
      strlcpy(error_str, "<b>Kerberos error:</b>
", error_size); strlcat(error_str, krb5_get_error_message(context, error), error_size); strlcat(error_str, ".
Please check your Kerberos configuration.", error_size); return FALSE; } error = krb5_unparse_name(context, princ, &princ_name); if (error) { strlcpy(error_str, "<b>Kerberos error:</b>
", error_size); strlcat(error_str, krb5_get_error_message(context, error), error_size); strlcat(error_str, ".
Please check your Kerberos configuration.", error_size); return FALSE; } sprintf(str, "Using %s as server principal for authentication", princ_name); write_logfile(lbs, str); memset(&options, 0, sizeof(options)); krb5_get_init_creds_opt_init(&options); memset(&creds, 0, sizeof(creds)); error = krb5_get_init_creds_password(context, &creds, princ, (char *) password, NULL, NULL, 0, NULL, &options); krb5_free_context(context); if (error && error != KRB5KDC_ERR_PREAUTH_FAILED && error != KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN) { sprintf(error_str, "<b>Kerberos error %d:</b>
", error); strlcat(error_str, krb5_get_error_message(context, error), error_size); strlcat(error_str, ".
Please check your Kerberos configuration.", error_size); return FALSE; } if (error) return FALSE; return TRUE; } int auth_change_password_krb5(LOGBOOK * lbs, const char *user, const char *old_pwd, const char *new_pwd, char *error_str, int error_size) { char *princ_name, str[256], realm[256]; int result_code, n; krb5_error_code error; krb5_data result_code_string, result_string; krb5_principal princ; krb5_context context; krb5_creds creds; krb5_get_init_creds_opt options; if (krb5_init_context(&context) < 0) return FALSE; strlcpy(str, user, sizeof(str)); if (getcfg(lbs->name, "Kerberos Realm", realm, sizeof(realm))) { strlcat(str, "@", sizeof(str)); strlcat(str, realm, sizeof(str)); } if ((error = krb5_parse_name(context, str, &princ)) != 0) { strlcpy(error_str, "<b>Kerberos error:</b>
", error_size); strlcat(error_str, krb5_get_error_message(context, error), error_size); strlcat(error_str, ".
Please check your Kerberos configuration.", error_size); return FALSE; } error = krb5_unparse_name(context, princ, &princ_name); sprintf(str, "Using %s as server principal for authentication", princ_name); write_logfile(lbs, str); memset(&options, 0, sizeof(options)); krb5_get_init_creds_opt_init(&options); krb5_get_init_creds_opt_set_tkt_life(&options, 300); krb5_get_init_creds_opt_set_forwardable(&options, FALSE); krb5_get_init_creds_opt_set_proxiable(&options, FALSE); memset(&creds, 0, sizeof(creds)); error = krb5_get_init_creds_password(context, &creds, princ, (char *) old_pwd, NULL, NULL, 0, "kadmin/changepw", &options); if (error) { strlcpy(error_str, "<b>Kerberos error:</b>
", error_size); strlcat(error_str, krb5_get_error_message(context, error), error_size); strlcat(error_str, ".
Please check your Kerberos configuration.", error_size); return FALSE; } error = krb5_set_password(context, &creds, (char *) new_pwd, princ, &result_code, &result_code_string, &result_string); if (error) { strlcpy(error_str, "<b>Kerberos error:</b>
", error_size); strlcat(error_str, krb5_get_error_message(context, error), error_size); strlcat(error_str, ".
Please check your Kerberos configuration.", error_size); return FALSE; } if (result_code > 0) { if (result_code_string.length > 0) { strlcpy(error_str, result_code_string.data, error_size); if ((int) result_code_string.length < error_size) error_str[result_code_string.length] = 0; } if (result_string.length > 0) { strlcat(error_str, ": ", error_size); n = strlen(error_str) + result_string.length; strlcat(error_str, result_string.data, error_size); if (n < error_size) error_str[n] = 0; } } krb5_free_data_contents(context, &result_code_string); krb5_free_data_contents(context, &result_string); krb5_free_cred_contents(context, &creds); krb5_get_init_creds_opt_free(context, &options); krb5_free_context(context); if (result_code > 0) return FALSE; return TRUE; } #endif /*---- LDAP routines ------------------------------------------*/ #ifdef HAVE_LDAP int ldap_init(LOGBOOK *lbs, char *error_str, int error_size) { char str[512], ldap_server[256]; int version; int bind=0; // Read Config file if (getcfg(lbs->name, "LDAP server", ldap_server, sizeof(ldap_server))) { strlcpy(str, ldap_server, sizeof(str)); } else { strlcpy(error_str, "<b>LDAP initialization error</b>
", error_size); strlcat(error_str, "
Please check your LDAP configuration.", error_size); strlcat(str, "ERR: Cannot find LDAP server entry!", sizeof(str)); write_logfile(lbs, str); return FALSE; } if (!getcfg(lbs->name, "LDAP userbase", ldap_userbase, sizeof(ldap_userbase))) { strlcpy(error_str, "<b>LDAP initialization error</b>
", error_size); strlcat(error_str, "
Please check your LDAP configuration.", error_size); strlcat(str, ", ERR: Cannot find LDAP userbase (e.g. \'ou=People,dc=example,dc=org\')!", sizeof(str)); write_logfile(lbs, str); return FALSE; } if (!getcfg(lbs->name, "LDAP login attribute", ldap_login_attr, sizeof(ldap_login_attr))) { strlcpy(error_str, "<b>LDAP initialization error</b>
", error_size); strlcat(error_str, "
Please check your LDAP configuration.", error_size); strlcat(str, ", ERR: Cannot find LDAP login attribute (e.g. uid, cn, ...)!", sizeof(str)); write_logfile(lbs, str); return FALSE; } if (!getcfg(lbs->name, "LDAP DN User", ldap_dn_user, sizeof(ldap_dn_user))) { strlcpy(error_str, "<b>LDAP initialization error</b>
", error_size); strlcat(error_str, "
Please check your LDAP configuration.", error_size); strlcat(str, ", ERR: Cannot find LDAP login attribute (e.g. uid, cn, ...)!", sizeof(str)); write_logfile(lbs, str); return FALSE; } if (!getcfg(lbs->name, "LDAP PW User", ldap_pw_user, sizeof(ldap_pw_user))) { strlcpy(error_str, "<b>LDAP initialization error</b>
", error_size); strlcat(error_str, "
Please check your LDAP configuration.", error_size); strlcat(str, ", ERR: Cannot find LDAP login attribute (e.g. uid, cn, ...)!", sizeof(str)); write_logfile(lbs, str); return FALSE; } // Initialize/open LDAP connection if(ldap_initialize( &ldap_ld, ldap_server )) { perror("ldap_initialize"); strlcpy(error_str, "<b>LDAP initialization error</b>
", error_size); strlcat(error_str, "
Please check your LDAP configuration.", error_size); return FALSE; } // Use the LDAP_OPT_PROTOCOL_VERSION session preference to specify that the client is LDAPv3 client version = LDAP_VERSION3; ldap_set_option(ldap_ld, LDAP_OPT_PROTOCOL_VERSION, &version); write_logfile(lbs, str); return TRUE; } int auth_verify_password_ldap(LOGBOOK *lbs, const char *user, const char *password, char *error_str, int error_size) { LDAPMessage *result, *err, *entry; int bind=0, i, rc=0, nb=0; char str[512], filter[512]; char *attribute , *dn; BerElement *ber; BerValue **values; ldap_ld = NULL; memset(&ldap_bindDN[0], 0, sizeof(ldap_bindDN)); struct timeval timeOut = {3,0}; // 3 second connection/search timeout // zerotime.tv_sec = zerotime.tv_usec = 0L; if(!ldap_init(lbs,error_str,error_size)) { strlcpy(error_str, "<b>LDAP initialization error</b>
", error_size); strlcat(error_str, "
Please check your LDAP configuration.", error_size); return FALSE; } printf("\n dn: %s\n", ldap_dn_user ); //Bind with read account bind = ldap_simple_bind_s(ldap_ld, ldap_dn_user, ldap_pw_user, LDAP_AUTH_SIMPLE); if(bind != LDAP_SUCCESS) { strlcpy(error_str, "<b>LDAP BIND error with read account</b>
", error_size); strlcat(error_str, "
Please check your LDAP configuration.", error_size); return FALSE; } // search user sprintf(filter, "(%s=%s)", ldap_login_attr, user); rc = ldap_search_ext_s( ldap_ld, // LDAP session handle ldap_userbase, // Search Base
... 318 more lines ...
  22   Wed Jul 11 11:13:16 2007 Peter Rienstrapeter.rienstra@gmail.comOtherCompiling elogd.c on HP-UX 64 bitBetaThu 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
  39   Fri Sep 17 06:19:39 2010 Stefan Rittstefan.ritt@psi.chScriptCustom input forms implementationStableThu Jul 2 20:55:55 2015 by Stefan Ritt

Dear ELOG users,

starting with SVN revision 2328, custom input forms are implemented. This allows application specific formats for check lists etc. In our specific case we had to implement a shift check list, which was quite long. Furthermore the check list should be optimized for an iPad, which we take in the field and record various checks and readings (in our case some gas pressure gauges at the PSI particle accelerator). Since the standard ELOG interface was too inflexible, a completely hand-written form was needed. The form can be activated by the new configuration options Custom New Form, Custom Edit Form and Custom Display Form, one for a new entry, an entry to edit and and entry to display. In our case we used the same form for all three cases. This is how the shift check list looks under the Safari Browser on a PC:

Capture.png

And here is how it looks on the iPad:

IMAG0036.jpg

Each section can be collapsed and expanded (blue arrows at the left), and various internal checks are made before the check list can be submitted.

Implementing such forms is however more something for the advanced user, since you have to hand-write HTML with CSS and JavaScript code. It can then however be a powerful method for check lists. Please find in the attachments the elogd.cfg configuration for that logbook and the shiftcheck.html source code file. It is a bit complicated since the page is a static page, elogd just serves it from the file. This requires all the dynamic functions to be implemented inside the HTML file with JavaScript. To display an entry for example, the JavaScript loads the raw data with the "?cmd=Download" command and the populates the form fields. The collapsing and expanding is done by using CSS properties. The integrated style sheet was optimized for the rendering on an iPad. Rather large fonts were chosen so that the items can be checked easily with your finger tips. Various parameters are sent between the browser and the elogd program via hidden fields and cookies. So only something for experts! But if you go through the effort and hand-write the form, it can be very handy. Note that you have to upgrade to SVN revision 2328 for the three new options.

 

Attachment 2: elogd.cfg
[global]
Port = 8080
Password file = passwd

[ShiftCheck]
Comment = Shift Check List

Attributes = Author, D, M, Y, Shift, a1, a2, a3, a4, a5, h1, h2, h3, h4, h5, c1, c2, c3, c4, c5, c6, c7, bb1, cr1, cr2, cr3, cr4, cr5, cr6, cr7, cr8, cr9, cr10, cr11, cr12, cr13, cr14, cr15, cr16, cr17, cr18, cr19, cr20, cr21, cr22, cr23, cr24, cr25, cr26, sw1, sw2, sw3, sw4, sw5
Quick filter = Shift, Author
Options Shift = Morning, Evening, Night

Enable attachments = 0
Show text = 0
Custom new form = /home/meg/meg/online/elog/shiftcheck.html
Custom edit form = /home/meg/meg/online/elog/shiftcheck.html
Custom display form = /home/meg/meg/online/elog/shiftcheck.html
List after submit = 1
Attachment 4: shiftcheck.html
Attachment 5: sc_up.png
sc_up.png
Attachment 6: sc_down.png
sc_down.png
ELOG V3.1.5-2eba886