Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon5.gif   Running elog as ordinnary user, posted by G. Vandemoortele on Fri Jan 27 20:40:00 2006 
    icon2.gif   Re: Running elog as ordinnary user, posted by Stefan Ritt on Fri Jan 27 23:18:07 2006 
       icon2.gif   Re: Running elog as ordinnary user, posted by G. Vandemoortele on Sat Jan 28 10:40:18 2006 
          icon2.gif   Re: Running elog as ordinnary user, posted by Stefan Ritt on Sat Jan 28 12:54:03 2006 screendump.png
Message ID: 1637     Entry time: Fri Jan 27 23:18:07 2006     In reply to: 1636     Reply to this: 1638
Icon: Reply  Author: Stefan Ritt  Author Email: stefan.ritt@psi.ch 
Category: Question  OS: Linux  ELOG Version: 2.6.1 CVS 
Subject: Re: Running elog as ordinnary user 

G. Vandemoortele wrote:
I've configured elog with some commands running a shell :

Preset R-Date = $shell(/usr/bin/date +"%Y/%m/%d %H:%S")
; for testing :
Preset $text = $shell(whoami && set)
Preset $text = Some fixed text

That worked well when elog was started by root (and falling to user elog),
but later, I moved all the elog tree to /home/my_name/.elog,
(I'd like to start it only when I'm logged, it's only for personnal data)
changed all the attributes/permissions ($chown -R my_name:my_group .elog)
and none of these commands still works ! I use the -x option to allow
shell substitution.

More surprisingly, even the fixed text doesn't work (???)


First of all, you could use

Preset R-Date = $date

instead of the shell command. Secondly, the command

Preset $text = $shell(whoami && set)

is wrong. Replace it by

Preset text = $shell(whoami && set)

without the "$".


G. Vandemoortele wrote:
By the way, I also seen that it is necessary to set Usr and Grp to "elog"
via the config file even when it's started by root, because otherwise,
you always get the strings 'Falling back to default group "elog"' and
Falling back to default user "elog" in the output of the shell substitutions.


There is a good reason for that. If you run elogd as root, this can open a dangerous hole into your system. If there would be any bug in elog, an attacker could gain root access easily. By falling back to a non-root user, the damage can be minimized. As a precaustion, elog falls back to Usr and Grp "elog" if that setting is missing in the config file.

When you run elog under your user name, this fallback is not necessary. Why you got the message 'Falling back' is a mystery to me. I tried to reproduce that, so I run under a non-root account with following config:
[global]
port = 1234

[demo]
Attributes = Subject
Preset Subject = $shell(date +"%Y/%m/%d %H:%S")
and correctly got the date in the "Subject" field with ELOG V2.6.1-1640.
ELOG V3.1.5-2eba886