Bug 1211890 - slaptest doesn't convert perlModuleConfig lines
Summary: slaptest doesn't convert perlModuleConfig lines
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: openldap
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Matus Honek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-15 07:41 UTC by Jan Synacek
Modified: 2015-11-05 09:53 UTC (History)
8 users (show)

Fixed In Version: openldap-2.4.41-1.fc24
Clone Of: 1184585
Environment:
Last Closed: 2015-11-05 09:53:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenLDAP ITS 8105 0 None None None Never

Description Jan Synacek 2015-04-15 07:41:13 UTC
+++ This bug was initially created as a clone of Bug #1184585 +++

Description of problem:

When using the perl backend, slaptest doesn't convert perlModuleConfig lines from slapd.conf to slapd.d.
[root@host-049 openldap]# cat perl/PerlConf.pm
#!/usr/bin/perl

package PerlConf;

use strict;
use warnings;
use POSIX;
use Data::Dumper;

sub new {
        my $class = shift;

        my $this = {};
        bless $this, $class;
        print {*STDERR} "PerlConf module loaded\n";
        $this->{test} = 0;

        return $this;
}

sub init {
        my $this = shift;
        my $log = $this->{LOG};

        if (!$this->{test}) {
                print {*STDERR} "FAIL Config option missing\n";
                return 1;
        } else {
                print {*STDERR} "PASS Config option set\n";
        }

        return 0;
}

sub search {
        my $this = shift;
        my ( $base, $scope, $deref, $sizeLim, $timeLim, $filter, $attrOnly, @attrs ) = @_;

        my @match_entries = ();

        return ( 0, @match_entries );
}

sub config {
        my $this = shift;
        my $log = $this->{LOG};

        my (@args) = @_;
        print {*STDERR} "config\n";

        my $test = shift @args;

        if ($test eq "ItWorked") {
                print {*STDERR} "GOOD Config option found\n";
                $this->{test} = 1;
                return 0;
        }

        print {*STDERR} "FAIL Config option missing\n";
        return 1;
}

1;


[root@host-049 openldap]# cat slapd.conf
include /etc/openldap/schema/core.schema

pidfile /var/run/openldap/slapd.pid
argsfile /var/run/openldap/slapd.args
moduleload back_perl.la
database perl
perlModulePath /etc/openldap/perl
perlModule PerlConf
perlModuleConfig ItWorked
suffix "dc=perl,dc=test"
rootdn "cn=Manager,dc=perl,dc=test"




Version-Release number of selected component (if applicable):
openldap-servers-2.4.39-6.el7.x86_64

How reproducible:
Easily

Steps to Reproduce:
1. copy PerlConf.pm from above to /etc/openldap/perl
2. copy slapd.conf from above to /etc/openldap
3. slaptest -f /etc/openldap/slapd.conf -F /etc/openldap/slapd.d
4. chown -R ldap.ldap /etc/openldap/slapd.d
5. restorecon -R /etc/openldap/slapd.d
6. systemctl start slapd.service


Actual results:
[root@host-049 openldap]# rm -rf slapd.d
[root@host-049 openldap]# ls
certs  check_password.conf  ldap.conf  perl  schema  slapd.conf
[root@host-049 openldap]# slaptest -f slapd.conf
PerlConf module loaded
config
GOOD Config option found
PASS Config option set
config file testing succeeded
[root@host-049 openldap]# mkdir slapd.d
[root@host-049 openldap]# slaptest -f slapd.conf -F slapd.d
PerlConf module loaded
config
GOOD Config option found
PASS Config option set
config file testing succeeded
[root@host-049 openldap]# chown -R ldap.ldap slapd.d
[root@host-049 openldap]# restorecon -R slapd.d
[root@host-049 openldap]# systemctl start slapd
Job for slapd.service failed. See 'systemctl status slapd.service' and 'journalctl -xn' for details.
[root@host-049 openldap]# systemctl status slapd
slapd.service - OpenLDAP Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/slapd.service; disabled)
   Active: failed (Result: exit-code) since Wed 2015-01-21 11:58:32 CST; 4s ago
     Docs: man:slapd
           man:slapd-config
           man:slapd-hdb
           man:slapd-mdb
           file:///usr/share/doc/openldap-servers/guide.html
  Process: 28874 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=1/FAILURE)
  Process: 28861 ExecStartPre=/usr/libexec/openldap/check-config.sh (code=exited, status=0/SUCCESS)

Jan 21 11:58:32 host-049.virt.lab systemd[1]: Starting OpenLDAP Server Daemon...
Jan 21 11:58:32 host-049.virt.lab runuser[28864]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
Jan 21 11:58:32 host-049.virt.lab slapd[28874]: @(#) $OpenLDAP: slapd 2.4.39 (Dec  9 2014 03:55:47) $  mockbuild:/builddir/build/BUILD/openldap-2.4.39/openldap-2.4.39/servers/slapd
Jan 21 11:58:32 host-049.virt.lab slapd[28874]: PerlConf module loaded
Jan 21 11:58:32 host-049.virt.lab systemd[1]: slapd.service: control process exited, code=exited status=1
Jan 21 11:58:32 host-049.virt.lab systemd[1]: Failed to start OpenLDAP Server Daemon.
Jan 21 11:58:32 host-049.virt.lab systemd[1]: Unit slapd.service entered failed state.


Expected results:
The config token ItWorked should be found in /etc/openldap/slapd.d and the perl module should see the config option when slapd starts as a service.

Comment 1 Fedora Admin XMLRPC Client 2015-04-29 10:50:21 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Fedora End Of Life 2015-11-04 15:32:59 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Matus Honek 2015-11-05 09:53:23 UTC
The latests rawhide build (openldap-2.4.41-1.fc24) fixes the issue thanks to the patches included in the upstream release 2.4.41.


Note You need to log in before you can comment on or make changes to this bug.