Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 219 of 237  Not logged in ELOG logo
New entries since:Thu Jan 1 01:00:00 1970
icon4.gif   -W -Wall options (using gcc), posted by Heiko Scheit on Fri Feb 13 12:25:15 2004 
Maybe consider using the options -W -Wall when compiling elogd.
There are several warning messages.
    icon2.gif   Re: -W -Wall options (using gcc), posted by Stefan Ritt on Fri Feb 13 21:52:48 2004 
Thanks, I did so.
       icon5.gif   Re: -W -Wall options (using gcc), posted by Stefan Ritt on Mon Feb 16 16:07:34 2004 
So I fixed all compiler generated warnigns except these:

[midas@pc2075 ~/elog]$ gcc -g -O -W -Wall -o elogd src/elogd.c
src/elogd.c: In function `set_cookie':
src/elogd.c:4675: warning: `%y' yields only last 2 digits of year
src/elogd.c: In function `send_file_direct':
src/elogd.c:5483: warning: `%y' yields only last 2 digits of year
src/elogd.c: In function `show_elog_list':
src/elogd.c:11938: warning: `%x' yields only last 2 digits of year in some 
locales
src/elogd.c:11957: warning: `%x' yields only last 2 digits of year in some 
locales
src/elogd.c:11979: warning: `%x' yields only last 2 digits of year in some 
locales
src/elogd.c:11987: warning: `%x' yields only last 2 digits of year in some 
locales
src/elogd.c: In function `ctrlc_handler':
src/elogd.c:15864: warning: empty body in an if-statement
src/elogd.c: In function `hup_handler':
src/elogd.c:15870: warning: empty body in an if-statement

Do you know how to disable these warnings or any other workaround? I would 
like to compile without any remaining warnings.
          icon5.gif   Re: -W -Wall options (using gcc), posted by Heiko Scheit on Mon Feb 16 16:40:50 2004 
> So I fixed all compiler generated warnigns except these:
> 
> [midas@pc2075 ~/elog]$ gcc -g -O -W -Wall -o elogd src/elogd.c
> src/elogd.c: In function `set_cookie':
> src/elogd.c:4675: warning: `%y' yields only last 2 digits of year
> src/elogd.c: In function `send_file_direct':
> src/elogd.c:5483: warning: `%y' yields only last 2 digits of year
> src/elogd.c: In function `show_elog_list':
> src/elogd.c:11938: warning: `%x' yields only last 2 digits of year in some 
> locales
> src/elogd.c:11957: warning: `%x' yields only last 2 digits of year in some 
> locales
> src/elogd.c:11979: warning: `%x' yields only last 2 digits of year in some 
> locales
> src/elogd.c:11987: warning: `%x' yields only last 2 digits of year in some 
> locales
> src/elogd.c: In function `ctrlc_handler':
> src/elogd.c:15864: warning: empty body in an if-statement
> src/elogd.c: In function `hup_handler':
> src/elogd.c:15870: warning: empty body in an if-statement
> 
> Do you know how to disable these warnings or any other workaround? I would 
> like to compile without any remaining warnings.


Have a look at the gcc info pages:

$ info gcc "invoking gcc" "warning options"
             icon5.gif   Re: -W -Wall options (using gcc), posted by Stefan Ritt on Mon Feb 16 16:47:55 2004 
> Have a look at the gcc info pages:
> 
> $ info gcc "invoking gcc" "warning options"

Sure, I'm not stupid! I looked for ~10 minutes how to turn off the remaining 
warnings, but I could not find it. The code is now correct, like I do want the 
"%y" format specifier in the strftime() function, but the warning is wrong. The 
closest I came to was 

-W -Wall -Wno-format

which removes ther warning in strftime(), but I do want this warning, since it 
helps in many other printf() statements.
                icon5.gif   Re: -W -Wall options (using gcc), posted by Heiko Scheit on Mon Feb 16 17:18:39 2004 
> > Have a look at the gcc info pages:
> > 
> > $ info gcc "invoking gcc" "warning options"
> 
> Sure, I'm not stupid! 

  Sorry, didn't mean to offend you.

> I looked for ~10 minutes how to turn off the remaining 
> warnings, but I could not find it. The code is now correct, like I do want the 
> "%y" format specifier in the strftime() function, but the warning is wrong.

  One way to remove the warnings would be to use "%Y" in a separate strftime() call
  and then taking only the last two digits (characters) of that string.

  Something like:
old:
   strftime(str, sizeof(str), "%A, %d-%b-%y %H:%M:%S GMT", gmt);

new:
   strftime(str, sizeof(str), "%A, %d-%b-XX %H:%M:%S GMT", gmt);
   strftime(year, sizeof(year), "%Y", gmt);
   i=strstr(str,"XX"); /* find position of XX */
   if ( i+1 < sizeof(str) ) {
     str[i]  =year[3];
     str[i+1]=year[4];
   } else ...

  Somewhat cumbersome, but should work.  Maybe consider using the four 
  digit year directly, where possible.

  Gruss, Heiko
icon8.gif   elog (not elogd) submit does not work anymore, posted by Heiko Scheit on Fri Feb 13 12:21:25 2004 
Somehow elog does not use the -s option (subdir) anymore,
resulting in a 'HTTP/1.1 404 Not Found' error.

For now I am using elog from version 2.3.9 together with elogd v2.5.0,
which seems to work OK.
    icon2.gif   Re: elog (not elogd) submit does not work anymore, posted by Stefan Ritt on Fri Feb 13 21:59:44 2004 
Oops! I 're-used' the '-s' flag for email suppression, so it was actually 
double used. I changed the email supprssion flag to '-p', so '-s' should 
work again for specifying subdirectories.
icon5.gif   Behaviour of text when using quote marks in header fields , posted by Fergus Lynch on Wed Feb 11 15:06:38 2004 
Hi,

First off let me say what an excellent program, simple yet powerful...

I've noticed some erratic behaviour when using "quote marks" in header 
fields.  Basically all text to the right of a " disappears.  Try adding an 
entry with quote marks or replying to this post.

Presume this is a bug.

Keep up the good work

Fergus
    icon2.gif   Re: Behaviour of text when using "quote marks" in header fields , posted by Stefan Ritt on Fri Feb 13 21:34:57 2004 
Like this one ^^^ ???

I'm joking! I fixed the bug and updated the elogd server. Please find the new 
version under CVS.

- Stefan
       icon7.gif   Re: Behaviour of text when using "quote marks" in header fields , posted by Fergus Lynch on Fri Feb 13 21:50:59 2004 
> Like this one ^^^ ???
> 
> I'm joking! I fixed the bug and updated the elogd server. Please find the new 
> version under CVS.
> 
> - Stefan

Blimey! That was quick!

Many thanks for amending this.  You'll be pleased to hear that my IT Operations  
Team think this is the best thing since sliced bread...its going to replace a 
blizzard of spreadsheets.

Cheers
Fergus
icon8.gif   segmentation fault, posted by Heiko Scheit on Fri Feb 13 12:18:19 2004 
Around line 2240 (in loc()) in elogd.c the following is written, 
which results in an infinite loop, since loc() recursively with
the same argument "Change %s".

   /* special case: "Change %s" */
   if (strstr(orig, "Change ")) {
      sprintf(result, loc("Change %s"), orig + 7);
      return result;
   }

For now I just commented these lines.
    icon7.gif   Re: segmentation fault, posted by Stefan Ritt on Fri Feb 13 21:50:09 2004 
This problem has been fixed recently. The new code is

   /* special case: "Change %s" */
   if (strstr(orig, "Change ") && strcmp(orig, "Change %s") != 0) {
      sprintf(result, loc("Change %s"), orig + 7);
      return result;
   }

Alternatively you can get the updated version from CVS.

- Stefan
icon1.gif   Javascript for Bookmark Link for one-click submission to elog, posted by Fred Hooper on Sat Jan 31 09:33:35 2004 elogsubmit-template.js
I have created a javascript to be used as a browser link that allows a one
step cut and paste from a web browser into a elog logbook. 

The intended application is allow a user to do a text selection in a web
browser, then click on a bookmark that automagically pastes the selected
text, the current browser page url, and the current browser page title into
a pre-defined elog logbook.   I do some research where I would like to save
some text from a webpage, but also have a record of where the webpage came
from.  However, you should find that you can extend this script in a varity
of ways for your own application.  

The script is a simple one: it uses javascript in a saved bookmark to get
your selected text, title, and url, and then creates a new browser window
with a elog form, and print the document variables into the form, and then
submits the form to elog.   The key advantage to this approach is that you
can use the "post" command, rather than "get", to submit to the text section
of an elog logbook.  The only way I found now to submit to elog via a
bookmark is using the "get" command, and it doesn't allow entry of the
"text" field, only attribute fields.    

The second major advantage to using POST is that you can submit a much large
quanity of information ; However, some checking on this leads me to believe
that the limit is browser and server depended, so YMMV.  However, a great
discussion on the limits of browsers can be found here: 
http://www.squarefree.com/bookmarklets/browsers.html .

One of the major limits is that IE6.0 browsers have a maxium of 508 bytes
per bookmark - This book runs over 800 bytes, so I suspect tha IE6+ will not
allow it.  I tested the link with Mozilla and Firebird 0.7.

This script will need to edited for you to use with your elog logbook.
The script should be fairly self-explainitory, if you are used to html forms
and have some exposure to javascript.

You will need to modifiy the following fields:

1) in form action = http://<your_domain.com>/elog/<logbook>/?cmd=New
      change the link to point to your specific logbook to be used for entry.

2) the attribute fields need match up with the ones in your logbook.

     The ones listed in the template are Author, Email, Title, and URL.

     If you have fixed fields (like Author and Email), then you can
predefine these fields as shown.  

      I have the page title used as the entry for Title, and the page url is
 use as the URL attribute.

      Finally, I have the text selection used as the entry for the Text field.

      You can add additional fields by creating a new <input ...>  segment
in the script.  For those more clever than me, you can concatinate the
title, url and selection to paste into the Text area as well.  

3) once you have a edited version of the script (make sure you keep it as a
single line), you can then create a new bookmark in your browser, and then
paste the script into the properties->location field (for Mozilla/Firebird)
or the properites->url field (IE).  Give it a good name like "post to elog"

4) once saved, you can then go a web page, select some text, and then go to
your bookmarks and click on the bookmark.  It should then create a new
window in elog with a completed logbook entry.


some notes:

1) again, this may not work on IE6+ browsers due to M$ limitations.

2) You may have to be logged in already to elog for this work - I have not
tested the interaction using a password protected elog

3) You can only post to a single elog logbook - You'll need to have multiple
bookmarks for multiple logbooks.
   
    icon2.gif   Re: Javascript for Bookmark Link for one-click submission to elog, posted by Stefan Ritt on Wed Feb 4 12:00:14 2004 
I find this script very nice. Indeed JavaScript can be very powerful to do such 
things. I added some JavaScript support to the elogd server itself. If one opens 
the "New" page like

http://localhost/demo/?cmd=New&js=test.js

then the JavaScript "test.js" (which has to be present in 
themes/default/test.js) gets inserted into the page header and executed. This 
can be used to add custom form validation, which is more powerful than the built 
in checking if required attributes are present.

Then I tried to redo the bookmark script with the new method. A server-side 
script has of course more space than just a bookmark. I started with a bookmark 
like:

javascript:window.open("http://localhost/demo/?cmd=New&js=test.js");

which even works on IE6. The script "test.js" contains:

function a()
{
  var d=opener.document;
  alert("test.js");
  alert(d.location.href);
  alert(d.getSelection());
}

a();

While the first alert() works, the others fail. It seems like the "opener" 
method does not correctly dereference the right window. If anybody has some 
idea, please let me know.

The new version of elogd which supports the "js=" command can be found here:

http://midas.psi.ch/cgi-bin/cvsweb/elog/src/elogd.c?rev=1.235
icon6.gif   New major ELOG version 2.5.0 released, posted by Stefan Ritt on Thu Jan 29 10:14:13 2004 sync.gif
Version 2.5.0 of ELOG has been released yesterday. The main new feature is 
the automatic mirroring of logbooks between different elog servers. 

This is useful if one wants to synchronize logbooks between a desktop PC 
and a laptop, for example. During synchronization, new or modified entries 
on both sides are merged intelligently. Another application is if several 
companies or institutes want to keep a ELOG database locally, but have the 
databases synchronized periodically with each other. Periodic mirroring 
can be set up with a built in cron-like facility. 

Although the synchronization has been tested extensively, I still consider 
this part in beta state. Before using it, one should make a backup of 
existing logbooks. The flag "Mirror simulate" can be used to test the 
mirroring without actually overwriting or deleting anything. If problems 
arise with mirroring, they should be reported to the author.

Localization files have been updated, so if anybody volunteers to update 
or make a new translation, please contact the author.
icon4.gif   Strange timezone in email sent with Postfix, posted by Joseph Giaime on Thu Jan 29 00:24:44 2004 
Hi all,
I'm having trouble getting a sensible timezone to be attached to e-mail that gets sent out when messages are posted. I'm using Postfix, not sendmail (Mac OS X Server uses this beginning with version 10.3). In this set-up, the 'sendmail' program is a front-end for Postfix, not the real thing. I suspect that there are subtle differences that cause this problem.
Instead of something like "Date: Wed, 28 Jan 2004 14:46:16 -0600", the "-0600" is replaced by a large number that doesn't correspond with anything I can figure out. This is the sort of thing that does no real harm, but the notebook users keep complaining
Any thoughts or suggestions would be appreciated. -Joe
Here is what gets mailed when a messages is posted:
Return-Path: 
Received: from ligo.phys.lsu.edu ([unix socket])
	by ligo.phys.lsu.edu (Cyrus v2.1.13) with LMTP; Wed, 28 Jan 2004 16:27:03 -0600
X-Sieve: CMU Sieve 2.2
Received: from ligo.phys.lsu.edu (ligo.phys.lsu.edu [130.39.181.231])
	by ligo.phys.lsu.edu (Postfix) with SMTP
	id 5E12A788D1; Wed, 28 Jan 2004 16:27:03 -0600 (CST)
To: ELOG@ligo.phys.lsu.edu, user@ligo.phys.lsu.edu
From: elog@ligo.phys.lsu.edu
Subject: New playground elog entry
X-Mailer: Elog, Version 2.3.9
X-Elog-URL: http://ligo.phys.lsu.edu:8080/playground/13
X-Elog-submit-type: web|elog
Date: Wed, 28 Jan 2004 22:27:03 +52182819
Content-Type: TEXT/PLAIN; charset=US-ASCII
Message-Id: <20040128222703.5E12A788D1@ligo.phys.lsu.edu>

A new entry has been submitted on ligo.phys.lsu.edu

Logbook             : playground
Author              : Joseph Giaime
Type                : Other
Category            : Other
Subject             : yet another test

Logbook URL         : http://ligo.phys.lsu.edu:8080/playground/13
    icon2.gif   Re: Strange timezone in email sent with Postfix, posted by Stefan Ritt on Thu Jan 29 09:25:45 2004 
> Instead of something like "Date: Wed, 28 Jan 2004 14:46:16 -0600", the
> "-0600" is replaced by a large number that doesn't correspond with anything
> I can figure out.  This is the sort of thing that does no real harm, but the
> notebook users keep complaining. 

This is caused by the elogd program itself. To produce the "-0600", it uses the 
variable "timezone", which is defined as difference in seconds between local time 
and coordinated universl time. This works find under Windows, Linux, FreeBSD, but 
apparently not under MacOSX. Although this variable is defined, it's unassigned. 

The code where this is used is in sendmail(), at the lines

   time(&now);
   ts = localtime(&now);
   strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S", ts);
   offset = (-(int) timezone);
   if (ts->tm_isdst)
      offset += 3600;

The current localtime gets written into "buf", then the timzone offset gets 
corrected by the daylight savings time, then the offset is used to produce the 
"-0600".

So if anybody being familiar with MacOSX has some idea, please let me know.

- Stefan
icon3.gif   whishlist direct shortcut to select a files or folder (not http), posted by Etienne Van Caillie on Wed Dec 3 06:32:09 2003 
whishlist

an entry like
file:///E:/Dossier\!!shorcut
will open IE with these current adresse

Stef could you add a logbook  
'wishlist'
'subgroup' contribution/icons
    icon2.gif   Re: whishlist direct shortcut to select a files or folder (not http), posted by Stefan Ritt on Wed Dec 3 09:18:25 2003 
> an entry like
> file:///E:/Dossier\!!shorcut
> will open IE with these current adresse

Yes it does, and what is your question?

> Stef could you add a logbook  
> 'wishlist'
> 'subgroup' contribution/icons

If you have any icons, just put it under the contributions logbook. There 
are only few entries, so no deed to make a subgroup.

As for wishlist, start with the "Forum" Logbook. If a wish gets "accepted", 
I put it on the official web page.
       icon2.gif   Re: whishlist direct shortcut to select a files or folder (not http), posted by Etienne Van Caillie on Wed Dec 3 14:57:05 2003 
> > an entry like
> > file:///E:/Dossier\!!shorcut
> > will open IE with these current adresse
> 
> Yes it does, and what is your question?
> 
> > Stef could you add a logbook  
> > 'wishlist'
> > 'subgroup' contribution/icons
> 
> If you have any icons, just put it under the contributions logbook. There 
> are only few entries, so no deed to make a subgroup.
> 
> As for wishlist, start with the "Forum" Logbook. If a wish gets "accepted", 
> I put it on the official web page.

sorry for my 'stupid' question please delete this entry :)
ELOG V3.1.5-3fb85fa6