Commit 294e35cb authored by Yadd's avatar Yadd

Error with PPolicy + CleanupHandler not launched

parent c40c1373
......@@ -487,3 +487,10 @@ manager_clean:
- $(MAKE) -C ${SRCMANAGERDIR} distclean
@rm -vf manager*
debian-packages: debian-dist
mv lemonldap-ng_$(VERSION).orig.tar.gz /tmp/
version=$(VERSION) && \
cd /tmp/ && \
tar xzf lemonldap-ng_$$version.orig.tar.gz && \
cd lemonldap-ng-$$version && \
debuild
......@@ -174,7 +174,10 @@ sub abort {
sub startSyslog {
my $self = shift;
return if ( $self->{_syslog} );
eval "use Sys::Syslog; openlog('lemonldap-ng','ndelay','$self->{syslog}');";
eval {
use Sys::Syslog;
openlog( 'lemonldap-ng', 'ndelay', '$self->{syslog}' );
};
$self->abort( "Unable to use syslog", $@ ) if ($@);
$self->{_syslog} = 1;
}
......
......@@ -238,10 +238,11 @@ sub getDBConf {
/^(?:exportedVars|locationRules|groups|exportedHeaders|macros|globalStorageOptions)$/
)
{
if ( $v !~ /^\$/ ) {
$conf->{$k} = {};
if ( defined($v) and $v !~ /^\$/ ) {
print STDERR
"Lemonldap::NG : Warning: configuration is in old format, you've to migrate !\n";
eval 'require Storable;require MIME::Base64;';
eval { require Storable; require MIME::Base64; };
if ($@) {
$msg = "Error : $@";
return 0;
......
......@@ -409,17 +409,11 @@ sub childInit {
if ( MP() == 2 ) {
Apache2::ServerUtil->server->push_handlers( PerlChildInitHandler =>
sub { return $class->initLocalStorage( $_[1], $_[0] ); } );
Apache2::ServerUtil->server->push_handlers(
PerlCleanupHandler => sub { return $class->cleanLocalStorage(@_); }
);
}
elsif ( MP() == 1 ) {
Apache->push_handlers(
PerlChildInitHandler => sub { return $class->initLocalStorage(@_); }
);
Apache->push_handlers(
PerlCleanupHandler => sub { return $class->cleanLocalStorage(@_); }
);
}
1;
}
......@@ -863,7 +857,6 @@ sub fetchId {
sub run ($$) {
my $class;
( $class, $apacheRequest ) = @_;
return DECLINED unless ( $apacheRequest->is_initial_req );
my $uri = $apacheRequest->uri
. ( $apacheRequest->args ? "?" . $apacheRequest->args : "" );
......@@ -925,6 +918,11 @@ sub run ($$) {
# Hide Lemonldap::NG cookie
$class->hideCookie;
# Cleanup
$apacheRequest->push_handlers(
PerlCleanupHandler => sub { return $class->cleanLocalStorage(@_); }
);
if ( defined( $transform->{$uri} ) ) {
return &{ $transform->{$uri} };
}
......
......@@ -21,7 +21,7 @@ use base qw(Lemonldap::NG::Portal::_WebForm);
# @return Lemonldap::NG::Portal constant
sub authInit {
my $self = shift;
if ( $self->{portal}->{ldapPpolicyControl} and not $self->Lemonldap::NG::Portal::_LDAP::loadPP) {
if ( $self->{ldapPpolicyControl} and not $self->ldap->loadPP()) {
return PE_LDAPERROR;
}
PE_OK;
......
......@@ -98,7 +98,7 @@ sub loadPP {
return 1 if ($ppLoaded);
# require Perl module
eval 'require Net::LDAP::Control::PasswordPolicy';
eval {require Net::LDAP::Control::PasswordPolicy};
if ($@) {
$self->lmLog(
"Module Net::LDAP::Control::PasswordPolicy not found in @INC",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment