Merge pull request #23339 from poettering/sockaddr-size-limit

tree-wide: add support for connecting to AF_UNIX sockets in the file system beyond the 108ch limit
This commit is contained in:
Luca Boccassi
2022-05-21 15:09:04 +01:00
committed by GitHub
13 changed files with 123 additions and 125 deletions
+2 -6
View File
@@ -408,10 +408,6 @@ _public_ int sd_journal_perror(const char *message) {
}
_public_ int sd_journal_stream_fd(const char *identifier, int priority, int level_prefix) {
static const union sockaddr_union sa = {
.un.sun_family = AF_UNIX,
.un.sun_path = "/run/systemd/journal/stdout",
};
_cleanup_close_ int fd = -1;
char *header;
size_t l;
@@ -424,9 +420,9 @@ _public_ int sd_journal_stream_fd(const char *identifier, int priority, int leve
if (fd < 0)
return -errno;
r = connect(fd, &sa.sa, SOCKADDR_UN_LEN(sa.un));
r = connect_unix_path(fd, AT_FDCWD, "/run/systemd/journal/stdout");
if (r < 0)
return -errno;
return r;
if (shutdown(fd, SHUT_RD) < 0)
return -errno;