fileio: port read_file_full() to use connect_unix_path()
authorLennart Poettering <lennart@poettering.net>
Tue, 10 May 2022 14:18:35 +0000 (16:18 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 13 May 2022 20:01:38 +0000 (05:01 +0900)
commit28ae8da97240c0048f03ed516d64fe064a7fc161
treecff26bfa8ca06c1179d01a2cfdfbe27a17c9fe0e
parent2679aee440409b89b8922f268c3e27f4327f8093
fileio: port read_file_full() to use connect_unix_path()

This way we can connect correctly to any AF_UNIX socket in the file
system, and even save some code. Yay!

This also adds some test code for this, that ensures read_file_full()
works correctly for AF_UNIX sockets that violate the 108 char limit.

Supporting sockets like this kinda matters I think, for the simple
reason that apps want to build socket paths via XDG_RUNTIME_DIR and
suchlike, and we should be able to connect to them, even via
non-normalized paths.
src/basic/fileio.c
src/test/test-fileio.c