aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execParallel.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-11-02 21:11:50 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2020-11-02 21:11:50 -0500
commitf28b089cbd3541a6df05a7e2907e40b5e516a063 (patch)
tree34196c96f8ae32bd9cffed1e13e9020faf2530d3 /src/backend/executor/execParallel.c
parentfc5b2203bfe80a4ac1b3c2c3ff536247514df304 (diff)
downloadpostgresql-f28b089cbd3541a6df05a7e2907e40b5e516a063.tar.gz
postgresql-f28b089cbd3541a6df05a7e2907e40b5e516a063.zip
Fix unportable use of getnameinfo() in pg_hba_file_rules view.
fill_hba_line() thought it could get away with passing sizeof(struct sockaddr_storage) rather than the actual addrlen previously returned by getaddrinfo(). While that appears to work on many platforms, it does not work on FreeBSD 11: you get back a failure, which leads to the view showing NULL for the address and netmask columns in all rows. The POSIX spec for getnameinfo() is pretty clearly on FreeBSD's side here: you should pass the actual address length. So it seems plausible that there are other platforms where this coding also fails, and we just hadn't noticed. Also, IMO the fact that getnameinfo() failure leads to a NULL output is pretty bogus in itself. Our pg_getnameinfo_all() wrapper is careful to emit "???" on failure, and we should use that in such cases. NULL should only be emitted in rows that don't have IP addresses. Per bug #16695 from Peter Vandivier. Back-patch to v10 where this code was added. Discussion: https://postgr.es/m/16695-a665558e2f630be7@postgresql.org
Diffstat (limited to 'src/backend/executor/execParallel.c')
0 files changed, 0 insertions, 0 deletions