]> git.ipfire.org Git - thirdparty/glibc.git/commit
Simplify allocations and fix merge and continue actions [BZ #28931]
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 17 Mar 2022 06:14:34 +0000 (11:44 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Tue, 22 Mar 2022 14:08:36 +0000 (19:38 +0530)
commit1c37b8022e8763fedbb3f79c02e05c6acfe5a215
tree6eb6224a8354c5ff5e2550a0151d181e06ba2267
parent9df157b4ed52108495de9f8bc77ef922034e3b66
Simplify allocations and fix merge and continue actions [BZ #28931]

Allocations for address tuples is currently a bit confusing because of
the pointer chasing through PAT, making it hard to observe the sequence
in which allocations have been made.  Narrow scope of the pointer
chasing through PAT so that it is only used where necessary.

This also tightens actions behaviour with the hosts database in
getaddrinfo to comply with the manual text.  The "continue" action
discards previous results and the "merge" action results in an immedate
lookup failure.  Consequently, chaining of allocations across modules is
no longer necessary, thus opening up cleanup opportunities.

A test has been added that checks some combinations to ensure that they
work correctly.

Resolves: BZ #28931

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
nss/Makefile
nss/tst-nss-gai-actions.c [new file with mode: 0644]
nss/tst-nss-gai-actions.root/etc/host.conf [new file with mode: 0644]
nss/tst-nss-gai-actions.root/etc/hosts [new file with mode: 0644]
sysdeps/posix/getaddrinfo.c