Use of configuration cache can mix global and local configuration parameters
Here is a use case I got with OpenID Connect register feature. This feature calls the configuration access object from portal code to store a new configuration in the backend (Lemonldap/NG/Portal/Issuer/OpenIDConnect.pm
):
# Register RP in global configuration
my $conf = $self->confAcc->getConf( { raw => 1 } );
...
if ( $self->confAcc->saveConf($conf) ) {
The issue is that with local configuration cache, when calling getConf
, we get the local parameters stored in the cache, like templateDir
for example. Then when saving conf, this local parameter is stored in global configuration, which should not, as the parameter is not defined in Manager rules. It is then not possible to update configuration:
# /usr/share/lemonldap-ng/bin/lmConfigEditor
Running as uid 33 and gid 33 0
Use of uninitialized value in hash element at /usr/share/perl5/Lemonldap/NG/Manager/Conf/Parser.pm line 1117, <F1> line 958.
Can't call method "logger" on unblessed reference at /usr/share/perl5/Lemonldap/NG/Manager/Conf/Parser.pm line 1119, <F1> line 958.
There is no issue when disabling configuration cache in lemonldap-ng.ini
.