Confusing documentation for custom functions
Concerned version
Version: 2.0.14
Platform: (Nginx/Apache/Node.js)
Documentation
This is what the documentation for custom functions say:
https://lemonldap-ng.org/documentation/2.0/customfunctions.html
[all]
require = /path/to/functions.pl, /path/to/SSOExtensions.pm
# OR
require = SSOExtensions::function1, SSOExtensions::function2
Then
If your function is not compliant with Safe jail, you will need to disable the jail.
And
You can now use your function in a macro, an header or an access rule, for example:
SSOExtensions::function1( $uid, $ENV{REMOTE_ADDR} )
What does not work
However, after a lot of painful trial and error, here is what I observed:
require=SSOExtensions
does not work
require=SSOExtensions::function1
does not work
SSOExtensions::function1
in a macro does not work if the Safe Jail is on. Even if the function is Safe Jail compatible (return 'test';
)
What works
require = /usr/share/perl5/SSOExtensions.pm
customFunctions = SSOExtensions::function1
then, using function1()
in macros works fine if useSafeJail=1 or useSafeJail=0
require = /usr/share/perl5/SSOExtensions.pm
then, using SSOExtensions::function1()
in macros works fine only if useSafeJail=0
@guimard Are there any bugs here, or do we simply need to update the documentation ?