Bug 2392068 - LDAP initialization does unnecessary resolution of hostname [f43]
Summary: LDAP initialization does unnecessary resolution of hostname [f43]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: openldap
Version: 43
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Simon Pichugin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-08-30 01:59 UTC by Simon Pichugin
Modified: 2025-09-15 01:41 UTC (History)
2 users (show)

Fixed In Version: openldap-2.6.10-4.fc43
Clone Of:
Environment:
Last Closed: 2025-09-15 01:41:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Simon Pichugin 2025-08-30 01:59:10 UTC
This bug was initially created as a copy of Bug #2331728

I am copying this bug because: 

curl --version does try to resolve local hostname, which is usually stored in $HOSTNAME variable. It seems it does that for no good reason. It does not matter whether machine hostname is already FQDN or not, it always try it unconditionally by calling getaddrinfo(3).

Every usage of dnf tries to resolve hostname. That is then supressed by myhostname on Fedora, which returns non-helping response. I think hostname should be fetched from actual network responses.

Seen with:
openldap-2.6.8-5.fc41.x86_64

Reproducible: Always

Steps to Reproduce:
1. dnf install gdb curl
2. gdb --args curl --version
3. (gdb) break getaddrinfo
4. (gdb) run
Actual Results:  
getaddrinfo is called with current hostname, stored into ldap_int_hostname variable. That is used only when ldap client has not configured target server. But this hostname seems fetched always.

Expected Results:  
No network activity happens, unless something is actually requested. This is not the case.

I think it should be made lazy initialized. It should be tried only when necessary. This seems to be useful when tlso_session_chkhost in libraries/libldap/tls_o.c is used. I think should initialize hostname only once conditions to use it happens. There is a fallback anyway. It should query FQDN only when name_in contains unusable response.

Related: https://github.com/systemd/systemd/issues/34897
Related: https://issues.redhat.com/browse/RHEL-70922

Comment 1 Fedora Update System 2025-08-30 03:25:08 UTC
FEDORA-2025-bd0c6d87b4 (openldap-2.6.10-4.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-bd0c6d87b4

Comment 2 Fedora Update System 2025-08-31 01:39:42 UTC
FEDORA-2025-bd0c6d87b4 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-bd0c6d87b4`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-bd0c6d87b4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 3 Fedora Update System 2025-09-15 01:41:39 UTC
FEDORA-2025-bd0c6d87b4 (openldap-2.6.10-4.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.