Skip to content

[autobackport: sssd-2-13] RESOLV: handle empty addr list properly#8775

Merged
alexey-tikhonov merged 1 commit into
SSSD:sssd-2-13from
sssd-bot:SSSD-sssd-backport-pr8773-to-sssd-2-13
Jun 4, 2026
Merged

[autobackport: sssd-2-13] RESOLV: handle empty addr list properly#8775
alexey-tikhonov merged 1 commit into
SSSD:sssd-2-13from
sssd-bot:SSSD-sssd-backport-pr8773-to-sssd-2-13

Conversation

@sssd-bot

@sssd-bot sssd-bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

This is an automatic backport of PR#8773 RESOLV: handle empty addr list properly to branch sssd-2-13, created by @alexey-tikhonov.

Please make sure this backport is correct.

Note

The commits were cherry-picked without conflicts.

You can push changes to this pull request

git remote add sssd-bot git@github.com:sssd-bot/sssd.git
git fetch sssd-bot refs/heads/SSSD-sssd-backport-pr8773-to-sssd-2-13
git checkout SSSD-sssd-backport-pr8773-to-sssd-2-13
git push sssd-bot SSSD-sssd-backport-pr8773-to-sssd-2-13 --force

Original commits
b6e7f05 - RESOLV: handle empty addr list properly

Backported commits

  • 833cfb8 - RESOLV: handle empty addr list properly

Original Pull Request Body

The address list can be NULL or empty when '/etc/hosts' has an IPv6 only entry and IPv4 was requested or vice versa. It was treated as an indicator that the name component contains the path to an LDAPI socket, leading to a crash.

@sssd-bot sssd-bot requested review from ikerexxe and sumit-bose June 4, 2026 13:52
@alexey-tikhonov alexey-tikhonov added the no-backport This should go to target branch only. label Jun 4, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a check to handle cases where the address list (h_addr_list) returned from resolv_gethostbyname_files_send is NULL or empty, preventing potential issues when /etc/hosts has mismatched IP version entries. The reviewer suggests a defensive programming improvement to also check if hostent itself is NULL before dereferencing it, which prevents potential crashes in unexpected edge cases.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/resolv/async_resolv.c

@ikerexxe ikerexxe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I wouldn't worry too much about Gemini's comment

The address list can be NULL or empty when '/etc/hosts' has
an IPv6 only entry and IPv4 was requested or vice versa. It
was treated as an indicator that the name component contains
the path to an LDAPI socket, leading to a crash.

Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>
(cherry picked from commit b6e7f05)
@sssd-bot

sssd-bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

The pull request was accepted by @alexey-tikhonov with the following PR CI status:


🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-43-x86_64:upstream (success)
🟢 rpm-build:fedora-44-x86_64:upstream (success)
🟢 rpm-build:fedora-rawhide-x86_64:upstream (success)
🟢 testing-farm:fedora-43-x86_64:upstream (success)
🟢 testing-farm:fedora-44-x86_64:centos-stream-10 (success)
🟢 testing-farm:fedora-44-x86_64:upstream (success)
🔴 testing-farm:fedora-rawhide-x86_64:upstream (failure)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

@sssd-bot sssd-bot force-pushed the SSSD-sssd-backport-pr8773-to-sssd-2-13 branch from 833cfb8 to 327e7b0 Compare June 4, 2026 17:59
@alexey-tikhonov alexey-tikhonov merged commit 9a3938f into SSSD:sssd-2-13 Jun 4, 2026
3 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accepted no-backport This should go to target branch only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants