Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Make slapd listen also on ipv6 #1916

Merged
merged 1 commit into from
Jul 22, 2024
Merged

[Fix] Make slapd listen also on ipv6 #1916

merged 1 commit into from
Jul 22, 2024

Conversation

Josue-T
Copy link
Contributor

@Josue-T Josue-T commented Jul 21, 2024

The problem

Some app are configured to connect to LDAP this way: ldap://localhost:389.
But currently, slapd listen only on IPv4. On my side I've this result with ss:

ss -ntlp | grep 389
LISTEN 0      1024       127.0.0.1:389        0.0.0.0:*    users:(("slapd",pid=1434,fd=9)) 

We have this issue here: https://forum.yunohost.org/t/seafile-11-0-9-cant-login-with-client/30504/2

Solution

Configure slapd to listen also on ipv6.

PR Status

This is ready

How to test

Tested with netcat and now connection work with IPv4 and IPv6.

We can also test with ss with has this result:

ss -ntlp | grep 389
LISTEN 0      1024       127.0.0.1:389        0.0.0.0:*    users:(("slapd",pid=1434,fd=9))                                                                                                 
LISTEN 0      1024           [::1]:389           [::]:*    users:(("slapd",pid=1434,fd=8))                                                                                                 

@Josue-T Josue-T requested review from zamentur and alexAubin July 21, 2024 08:36
@alexAubin
Copy link
Member

cf fbfa249 , listening only to ipv4 only is actually not a bug but a feature because this crashes on ipv4-only instances, which then results in disaster as in "being completely locked out of the server" because LDAP is down ... It feels much simpler to change the app's conf to bind to 127.0.0.1 rather than localhost ... But if we really do want IPv6 then we should have a similar mechanism to what's done for sshd_config where we only enable it if ipv6 seems to be available

@Josue-T
Copy link
Contributor Author

Josue-T commented Jul 22, 2024

Ok, it was what I suspeceted. But well the issue is that many apps are impacted by this and also the doc don't warn about this. Note also that some apps just don't work if IPv6 is disabled cf YunoHost-Apps/synapse_ynh#458

And finally last question, why disabling completely IPv6 🤔

@Josue-T
Copy link
Contributor Author

Josue-T commented Jul 22, 2024

Well, it would be interesting to know it my change still work with IPv6 disabled, as listening on localhost which is implicitly on IPv4+IPv6 is different than the previous version which is explicit to listen on IPv6 and which is normal that it don't work if IPv6 is disabled.

@alexAubin
Copy link
Member

Tested by disabling ipv6 from sysctl.conf and it does only listens to ipv4 indeed, so let's merge this and pray to god that no user has some stupidly specific network conf where slapd will explode because of this ...

@alexAubin alexAubin merged commit 34861f9 into dev Jul 22, 2024
2 of 3 checks passed
@alexAubin alexAubin deleted the fix_slapd_listen_ipv6 branch July 22, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants