-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
rhel-10.0
-
None
-
No
-
Moderate
-
rhel-sst-idm-ds
-
ssg_idm
-
0
-
False
-
-
None
-
None
-
None
-
None
-
None
What were you trying to do that didn't work?
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).
What is the impact of this issue to you?
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.
Please provide the package NVR for which the bug is seen:
openldap-2.6.7-5.el10.x86_64
openldap-2.6.8-5.fc41.x86_64
How reproducible is this bug?:
always reliable
Steps to reproduce
- dnf install gdb curl
- gdb --args curl --version
- (gdb) break getaddrinfo
- (gdb) run
Expected results
No network activity happens, unless something is actually requested. This is not the case.
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.
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.