Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 65 of 806  Not logged in ELOG logo
New entries since:Thu Jan 1 01:00:00 1970
ID Date Icon Author Author Email Category OS ELOG Version Subject
  69351   Fri Apr 23 16:21:05 2021 Reply Stefan Rittstefan.ritt@psi.chBug reportLinuxELOG V3.1.4-611Re: segfault in auth.c:366

Well, if you find a solution with works for everybody, I'm happy to commit it to the main repository. But unfortunately I cannot test it because I don't have LDAP here, so I'm flying blind.

Stefan

  69350   Fri Apr 23 15:46:39 2021 Reply Sebastian Schenksebastian.schenk@physik.uni-halle.deBug reportLinuxELOG V3.1.4-611Re: segfault in auth.c:366

Hi Mr. Holman,

The problem you are facing is more likely the issue, that the LDAP method is only provided as-is from a different developer.

I had a similar issue with the LDAP of my university.
I can't remember the correct error messages, but it looks similar, which arises from the used c library for LDAP.
The LDAP connection response can have 2 different variable types and only one of them is implemented in the elog, the other one crashes the elog with segfault.

I could fix it with this patch:
https://bitbucket.org/merrx/elog/commits/5a75fdb3e0b723380dae73bb57653946ed72690c
Obviously you have to adapt "displayName" and "postOfficeBox" to represent the name and email attributes of your LDAP structure.

I didn't made a PR for this commit, because it would break the current LDAP implementation, i assume.

Best wishes,
Sebastian

gary holman wrote:

Elog version:  ELOG V3.1.4-611489ba

I am running openldap on the localhost.  For some reason now, elogd is segfaulting when (I believe) when a new user is being added to the password file.  For example:

1. I delete user passord file defined in elogd.cfg

2. Bind/Authenticate to LDAP successfully

3.  Segfaults in auth.c ldap_adduser_file()

 

Makefile:
...
ELOGDIR    = /opt/elog
DESTDIR    = $(ROOT)$(PREFIX)/bin
SDESTDIR   = $(ROOT)$(PREFIX)/sbin
RCDIR      = $(ROOT)/etc/rc.d/init.d
SRVDIR     = $(ROOT)/usr/lib/systemd/system

# flag for SSL support
USE_SSL    = 1

# flag for Kerberos support, please turn off if you don't need Kerberos
USE_KRB5   = 0

# flag for LDAP support, please turn off if you don't need LDAP
USE_LDAP   = 1# flag for PAM support, please turn of if you don't need PAM
USE_PAM    = 0
...

For authentication, I am using openldap in the localhost:

----
Authentication = LDAP
LDAP server = ldap://localhost:389
LDAP userbase = ou=people,dc=example,dc=org
LDAP login attribute = uid
LDAP register = 1
Password file = /opt/elog/users
 

gdb output

----------

(gdb) run -s /opt/elog -c /opt/elog/elogd.cfg -f /var/run/elog/elog.pid
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/ubuntu/UPGRADE-42221/work-src/elog/elogd -s /opt/elog -c /opt/elog/elogd.cfg -f /var/run/elog/elog.pid
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
elogd 3.1.4 built Apr 22 2021, 19:19:39 revision 611489ba
File "/var/run/elog/elog.pid" exists, overwriting it.
CKeditor detected
ImageMagick detected
Indexing logbooks ... done
Server listening on port 9011 ...

Breakpoint 1, ldap_adduser_file (lbs=0x555556811ad8, user=0x7ffffffd3bd0 "testuser", password=0x5555558ea110 <_value+6000> "testuser", error_str=0x7ffffffd53d0 "", error_size=<optimized out>) at src/auth.c:350
350       if (rc != LDAP_SUCCESS) {
(gdb) n
337       rc = ldap_search_ext_s(
(gdb) n
350       if (rc != LDAP_SUCCESS) {
(gdb) n
358       for(entry = ldap_first_entry(ldap_ld,result);
(gdb) n
371                   if(strcmp(attribute,"mail")==0 || strcmp(attribute,"rfc822Mailbox")==0)
(gdb) n
361          for(attribute = ldap_first_attribute(ldap_ld,entry,&ber);
(gdb) n
365             if((values = ldap_get_values(ldap_ld,entry,attribute)) != NULL ) {
(gdb) n
366                for(i=0; values[i] != NULL; i++) {
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
ldap_adduser_file (lbs=0x555556811ad8, user=0x7ffffffd3bd0 "testuser", password=0x5555558ea110 <_value+6000> "testuser", error_str=<optimized out>, error_size=<optimized out>) at src/auth.c:366
366                for(i=0; values[i] != NULL; i++) {
(gdb) p attribute
$1 = 0x5555567f6a20 "uid"
(gdb) p values
$2 = (char **) 0x567f74f0
 

This user in LDAP:
-------------------------
# TESTUSER, people, example.org
dn: uid=TESTUSER,ou=people,dc=example,dc=org
uid: TESTUSER
cn: TESTUSER
givenName: TESTUSER
sn:: VEVTVFVTRVIg
mail: TESTUSER
uidNumber: 10000
gidNumber: 10000
homeDirectory: /dev/null
objectClass: top
objectClass: posixAccount
objectClass: shadowAccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
userPassword:: e1NTSEF9Y21ua1lsdFpMZ3ZrZlZ4OUp3MFN3cUY3NWIzdkFCSWY=
 

 

 

 

 

  69349   Fri Apr 23 04:59:58 2021 Entry gary holmanholman@uw.eduBug reportLinuxELOG V3.1.4-611segfault in auth.c:366

Elog version:  ELOG V3.1.4-611489ba

I am running openldap on the localhost.  For some reason now, elogd is segfaulting when (I believe) when a new user is being added to the password file.  For example:

1. I delete user passord file defined in elogd.cfg

2. Bind/Authenticate to LDAP successfully

3.  Segfaults in auth.c ldap_adduser_file()

 

Makefile:
...
ELOGDIR    = /opt/elog
DESTDIR    = $(ROOT)$(PREFIX)/bin
SDESTDIR   = $(ROOT)$(PREFIX)/sbin
RCDIR      = $(ROOT)/etc/rc.d/init.d
SRVDIR     = $(ROOT)/usr/lib/systemd/system

# flag for SSL support
USE_SSL    = 1

# flag for Kerberos support, please turn off if you don't need Kerberos
USE_KRB5   = 0

# flag for LDAP support, please turn off if you don't need LDAP
USE_LDAP   = 1# flag for PAM support, please turn of if you don't need PAM
USE_PAM    = 0
...

For authentication, I am using openldap in the localhost:

----
Authentication = LDAP
LDAP server = ldap://localhost:389
LDAP userbase = ou=people,dc=example,dc=org
LDAP login attribute = uid
LDAP register = 1
Password file = /opt/elog/users
 

gdb output

----------

(gdb) run -s /opt/elog -c /opt/elog/elogd.cfg -f /var/run/elog/elog.pid
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/ubuntu/UPGRADE-42221/work-src/elog/elogd -s /opt/elog -c /opt/elog/elogd.cfg -f /var/run/elog/elog.pid
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
elogd 3.1.4 built Apr 22 2021, 19:19:39 revision 611489ba
File "/var/run/elog/elog.pid" exists, overwriting it.
CKeditor detected
ImageMagick detected
Indexing logbooks ... done
Server listening on port 9011 ...

Breakpoint 1, ldap_adduser_file (lbs=0x555556811ad8, user=0x7ffffffd3bd0 "testuser", password=0x5555558ea110 <_value+6000> "testuser", error_str=0x7ffffffd53d0 "", error_size=<optimized out>) at src/auth.c:350
350       if (rc != LDAP_SUCCESS) {
(gdb) n
337       rc = ldap_search_ext_s(
(gdb) n
350       if (rc != LDAP_SUCCESS) {
(gdb) n
358       for(entry = ldap_first_entry(ldap_ld,result);
(gdb) n
371                   if(strcmp(attribute,"mail")==0 || strcmp(attribute,"rfc822Mailbox")==0)
(gdb) n
361          for(attribute = ldap_first_attribute(ldap_ld,entry,&ber);
(gdb) n
365             if((values = ldap_get_values(ldap_ld,entry,attribute)) != NULL ) {
(gdb) n
366                for(i=0; values[i] != NULL; i++) {
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
ldap_adduser_file (lbs=0x555556811ad8, user=0x7ffffffd3bd0 "testuser", password=0x5555558ea110 <_value+6000> "testuser", error_str=<optimized out>, error_size=<optimized out>) at src/auth.c:366
366                for(i=0; values[i] != NULL; i++) {
(gdb) p attribute
$1 = 0x5555567f6a20 "uid"
(gdb) p values
$2 = (char **) 0x567f74f0
 

This user in LDAP:
-------------------------
# TESTUSER, people, example.org
dn: uid=TESTUSER,ou=people,dc=example,dc=org
uid: TESTUSER
cn: TESTUSER
givenName: TESTUSER
sn:: VEVTVFVTRVIg
mail: TESTUSER
uidNumber: 10000
gidNumber: 10000
homeDirectory: /dev/null
objectClass: top
objectClass: posixAccount
objectClass: shadowAccount
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
userPassword:: e1NTSEF9Y21ua1lsdFpMZ3ZrZlZ4OUp3MFN3cUY3NWIzdkFCSWY=
 

 

 

 

  69347   Mon Apr 12 14:17:52 2021 Reply Gys Wuytsgys.wuyts@gmail.comQuestionWindows3.1.4 (latest)Re: auto pre-fill fields issue

Super, overlooked that one. Works now

 

g

Stefan Ritt wrote:

"Subst xxx" replaces after you submit an entry, while "Preset xxx" replaces before you create an entry. I believe you want the second one.

Stefan

Gys Wuyts wrote:

[global]

port = 8080

ssl = 0

Password file = passwords.txt

Admin user = user1

SMTP host = smtp. mail.com

SMTP port = 25

SMTP username = user1@mail.com

SMTP Password = GIwbx7UbmkWs5J0P8lVztX7Anje0/21BU/Tmk0aPm.

Logfile = ELog_log.txt

Logging level = 3

 

 

[Server]

Logbook dir = Server

Theme = default

Comment = Server Change Log

Attributes = Author, Email, Type, Category, Subject

Subst Author = $long_name from $remote_host

Subst Email = $user_email

Options Type = SRV 1, SRV 2, SRV Sup, BMS content, BMS setpoints, BMS new

Options Category = Config, User, Access, Connection, Change, New, Delete

Extendable Options =

Required Attributes = Author, Type

Page Title = ELOG - $subject

Reverse sort = 1

Quick filter = Date, Type

Andreas Luedeke wrote:

If you would post a minimal config file where the problem occurs, then we could look what the problem is.

Gys Wuyts wrote:

Thank you but that is already  in place. I have the same issue on both Windows 10 and Windows Server 2016 and 2019.

tnks

g

Stefan Ritt wrote:

You need user-level access control, using 

Password file = ...

Stefan

Gys Wuyts wrote:

Hello,

what are the pre-requisites to automatically fill the Author and Author Email fields. The documented method:

Subst Author = $long_name from $remote_host

Subst Email = $user_email

in the elogd.cfg file does not seem to work.

(I see it works here on this platform)

Tnks

 

G

 

 

 

 

 

 

  69346   Mon Apr 12 13:57:18 2021 Reply Stefan Rittstefan.ritt@psi.chQuestionWindows3.1.4 (latest)Re: auto pre-fill fields issue

"Subst xxx" replaces after you submit an entry, while "Preset xxx" replaces before you create an entry. I believe you want the second one.

Stefan

Gys Wuyts wrote:

[global]

port = 8080

ssl = 0

Password file = passwords.txt

Admin user = user1

SMTP host = smtp. mail.com

SMTP port = 25

SMTP username = user1@mail.com

SMTP Password = GIwbx7UbmkWs5J0P8lVztX7Anje0/21BU/Tmk0aPm.

Logfile = ELog_log.txt

Logging level = 3

 

 

[Server]

Logbook dir = Server

Theme = default

Comment = Server Change Log

Attributes = Author, Email, Type, Category, Subject

Subst Author = $long_name from $remote_host

Subst Email = $user_email

Options Type = SRV 1, SRV 2, SRV Sup, BMS content, BMS setpoints, BMS new

Options Category = Config, User, Access, Connection, Change, New, Delete

Extendable Options =

Required Attributes = Author, Type

Page Title = ELOG - $subject

Reverse sort = 1

Quick filter = Date, Type

Andreas Luedeke wrote:

If you would post a minimal config file where the problem occurs, then we could look what the problem is.

Gys Wuyts wrote:

Thank you but that is already  in place. I have the same issue on both Windows 10 and Windows Server 2016 and 2019.

tnks

g

Stefan Ritt wrote:

You need user-level access control, using 

Password file = ...

Stefan

Gys Wuyts wrote:

Hello,

what are the pre-requisites to automatically fill the Author and Author Email fields. The documented method:

Subst Author = $long_name from $remote_host

Subst Email = $user_email

in the elogd.cfg file does not seem to work.

(I see it works here on this platform)

Tnks

 

G

 

 

 

 

 

  69345   Mon Apr 12 13:32:53 2021 Reply Gys Wuytsgys.wuyts@gmail.comQuestionWindows3.1.4 (latest)Re: auto pre-fill fields issue

[global]

port = 8080

ssl = 0

Password file = passwords.txt

Admin user = user1

SMTP host = smtp. mail.com

SMTP port = 25

SMTP username = user1@mail.com

SMTP Password = GIwbx7UbmkWs5J0P8lVztX7Anje0/21BU/Tmk0aPm.

Logfile = ELog_log.txt

Logging level = 3

 

 

[Server]

Logbook dir = Server

Theme = default

Comment = Server Change Log

Attributes = Author, Email, Type, Category, Subject

Subst Author = $long_name from $remote_host

Subst Email = $user_email

Options Type = SRV 1, SRV 2, SRV Sup, BMS content, BMS setpoints, BMS new

Options Category = Config, User, Access, Connection, Change, New, Delete

Extendable Options =

Required Attributes = Author, Type

Page Title = ELOG - $subject

Reverse sort = 1

Quick filter = Date, Type

Andreas Luedeke wrote:

If you would post a minimal config file where the problem occurs, then we could look what the problem is.

Gys Wuyts wrote:

Thank you but that is already  in place. I have the same issue on both Windows 10 and Windows Server 2016 and 2019.

tnks

g

Stefan Ritt wrote:

You need user-level access control, using 

Password file = ...

Stefan

Gys Wuyts wrote:

Hello,

what are the pre-requisites to automatically fill the Author and Author Email fields. The documented method:

Subst Author = $long_name from $remote_host

Subst Email = $user_email

in the elogd.cfg file does not seem to work.

(I see it works here on this platform)

Tnks

 

G

 

 

 

 

  69344   Sun Apr 11 18:16:02 2021 Reply Andreas Luedekeandreas.luedeke@psi.chQuestionWindows3.1.4 (latest)Re: auto pre-fill fields issue

If you would post a minimal config file where the problem occurs, then we could look what the problem is.

Gys Wuyts wrote:

Thank you but that is already  in place. I have the same issue on both Windows 10 and Windows Server 2016 and 2019.

tnks

g

Stefan Ritt wrote:

You need user-level access control, using 

Password file = ...

Stefan

Gys Wuyts wrote:

Hello,

what are the pre-requisites to automatically fill the Author and Author Email fields. The documented method:

Subst Author = $long_name from $remote_host

Subst Email = $user_email

in the elogd.cfg file does not seem to work.

(I see it works here on this platform)

Tnks

 

G

 

 

 

  69343   Sat Apr 10 20:58:35 2021 Reply Gys Wuytsgys.wuyts@gmail.comQuestionWindows3.1.4 (latest)Re: auto pre-fill fields issue

Thank you but that is already  in place. I have the same issue on both Windows 10 and Windows Server 2016 and 2019.

tnks

g

Stefan Ritt wrote:

You need user-level access control, using 

Password file = ...

Stefan

Gys Wuyts wrote:

Hello,

what are the pre-requisites to automatically fill the Author and Author Email fields. The documented method:

Subst Author = $long_name from $remote_host

Subst Email = $user_email

in the elogd.cfg file does not seem to work.

(I see it works here on this platform)

Tnks

 

G

 

 

ELOG V3.1.5-3fb85fa6