diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Initialization/GlobalInit.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Initialization/GlobalInit.pm index ae9a18880..0e63509d3 100755 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Initialization/GlobalInit.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Initialization/GlobalInit.pm @@ -278,7 +278,7 @@ sub forgeHeadersInit { ); $self->safe( $jail->build_safe() ); $forgeHeaders->{$alias} = - $jail->jail_reval( "sub{$sub}", "sub{return($sub)}" ); + $jail->jail_reval( $sub ); Lemonldap::NG::Handler::Main::Logger->lmLog( "$self: Unable to forge headers: $@: sub {$sub}", 'error' ) @@ -476,7 +476,7 @@ sub conditionSub { 'customFunctions' => $self->customFunctions ); $self->safe( $jail->build_safe() ); - my $sub = $jail->jail_reval( "sub{return($cond)}", "sub{return($cond)}" ); + my $sub = $jail->jail_reval( $cond ); # Return sub and protected flag return ( $sub, 0 ); diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Jail.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Jail.pm index 9f6393246..c72e68931 100755 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Jail.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Jail.pm @@ -117,12 +117,12 @@ sub share_from { # Build and return restricted eval command with SAFEWRAP, if activated # @return evaluation of $reval or $reval2 sub jail_reval { - my ( $self, $reval, $reval2 ) = splice @_; + my ( $self, $reval ) = splice @_; return ( SAFEWRAP - ? $self->safe->wrap_code_ref( $self->safe->reval($reval) ) - : $self->safe->reval($reval2) + ? $self->safe->wrap_code_ref( $self->safe->reval("sub{$reval}") ) + : $self->safe->reval("sub{return($reval)}") ); }