Possible error in SSOWat package

My Configuration (not running YunoHost)

Hardware: x64 lxc container running Ubuntu 18.04.1 LTS
Installed Packages: nginx-extras lua-json lua-ldap lua-filesystem lua-socket lua-rex-pcre

Description of my problem

The test at this line: https://github.com/YunoHost/SSOwat/blob/stretch-unstable/helpers.lua#L302 of the SSOWat package is returning true no matter what value is set in the conf.json

This probably isnt a big deal for actual YunoHost setups, but I’m using an alternative LDAP provider which doesnt provide a ‘userPassword’ attribute meaning the ensure_user_password_uses_strong_hash always leads to an error.

I’ve tried debugging this by having the value of conf[‘ldap_enforce_crypt’] dumped to the log. Even when the value is false the if-test is considered positive.

I’ve tried the following conf.json configurations without any luck:
“ldap_enforce_crypt”: false
“ldap_enforce_crypt”: “false”

I suspect this might have something to do with the way the conf file is being loaded in. Is it perhaps being loaded as a string instead of a true boolean. I have tested this theory by altering the test to read:

if conf[‘ldap_enforce_crypt’] ~= “false” then

and it now behaves as expected. I appreciate this is a plaster rather than fixing the root of the problem and so haven’t considered offering a pull request. I don’t have the lua knowledge to debug the config.lua module.

For my needs I can just work with a fork of the repository, but I hoped this might be helpful to the great development team at YunoHost.

Thank you.

Hi @AcidUK

Thanks for taking a look at this issue and the detailled write up.

I think this type of issue should probably be discussed with the developers that would probably be better notified if the issue was added on https://github.com/YunoHost/issues/issues Can you contribute your bug report over there ?

So sorry, I’ve just read the GitHub page and it even says to report it on the issue tracker. I will of course.

1 Like