app-admin/rsyslog: Rev bump to fix hostname detection without network
authorThomas Deutschmann <whissi@gentoo.org>
Thu, 1 Jun 2017 14:19:26 +0000 (16:19 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Thu, 1 Jun 2017 14:19:48 +0000 (16:19 +0200)
See https://github.com/rsyslog/rsyslog/pull/1595

Package-Manager: Portage-2.3.5, Repoman-2.3.2

app-admin/rsyslog/files/8-stable/rsyslog-8.27.0-fix-hostname-detection-when-getaddrinfo-fails.patch [new file with mode: 0644]
app-admin/rsyslog/rsyslog-8.27.0-r1.ebuild [moved from app-admin/rsyslog/rsyslog-8.27.0.ebuild with 99% similarity]

diff --git a/app-admin/rsyslog/files/8-stable/rsyslog-8.27.0-fix-hostname-detection-when-getaddrinfo-fails.patch b/app-admin/rsyslog/files/8-stable/rsyslog-8.27.0-fix-hostname-detection-when-getaddrinfo-fails.patch
new file mode 100644 (file)
index 0000000..a9470cc
--- /dev/null
@@ -0,0 +1,27 @@
+From 1a7d3a088969b47798bc1da712ca2772f91a7c02 Mon Sep 17 00:00:00 2001
+From: Jiri Vymazal <jvymazal@redhat.com>
+Date: Wed, 31 May 2017 16:26:56 +0200
+Subject: [PATCH] Ignoring NONAME error from getaddrinfo so we have hostname
+ set even without working network
+
+---
+ runtime/net.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/runtime/net.c b/runtime/net.c
+index 2d8de9429..edffc677a 100644
+--- a/runtime/net.c
++++ b/runtime/net.c
+@@ -1188,7 +1188,11 @@ getLocalHostname(uchar **ppName)
+               memset(&flags, 0, sizeof(flags));
+               flags.ai_flags = AI_CANONNAME;
+               int error = getaddrinfo((char*)hnbuf, NULL, &flags, &res);
+-              if (error != 0) {
++              if (error != 0 &&
++                  error != EAI_NONAME && error != EAI_AGAIN && error != EAI_FAIL) {
++                      /* If we get one of errors above, network is probably
++                       * not working yet, so we fall back to local hostname below
++                       */
+                       dbgprintf("getaddrinfo: %s\n", gai_strerror(error));
+                       ABORT_FINALIZE(RS_RET_IO_ERROR);
+               }
similarity index 99%
rename from app-admin/rsyslog/rsyslog-8.27.0.ebuild
rename to app-admin/rsyslog/rsyslog-8.27.0-r1.ebuild
index ef11286bd709bec2a8c68023e16afaa11b7bdac4..c1791672bd3b08c825675435112b73a1f77bbdeb 100644 (file)
@@ -56,6 +56,7 @@ else
        PATCHES=(
                "${FILESDIR}"/8-stable/${PN}-8.26.0-fix-zmq3-format-security.patch
                "${FILESDIR}"/8-stable/${PN}-8.27.0-fix-librdkafka-detection.patch
+               "${FILESDIR}"/8-stable/${PN}-8.27.0-fix-hostname-detection-when-getaddrinfo-fails.patch
        )
 fi