summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-07-31 12:11:48 +0200
committerGitHub <noreply@github.com>2017-07-31 12:11:48 +0200
commite362b5a77f8667c44fd79057c91d9aea909cac69 (patch)
tree1e5a4006178003cff3b23b57883c321c2ee893d8
parent8ec1a07998758f6a85f3ea5bf2ed14d87609398f (diff)
parent010585873454d07625ee962ffa2ef2823624bfbe (diff)
downloadsystemd-e362b5a77f8667c44fd79057c91d9aea909cac69.tar.gz
Merge pull request #6472 from yuwata/journal-gateway-fix
Some journal-gateway and journal-remote related fixes
-rw-r--r--src/journal-remote/journal-gatewayd.c6
-rw-r--r--src/journal-remote/journal-remote.c12
-rw-r--r--src/journal-remote/microhttpd-util.h10
-rw-r--r--sysusers.d/systemd-remote.conf.m41
-rw-r--r--units/systemd-journal-gatewayd.service.in1
5 files changed, 25 insertions, 5 deletions
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c
index 9a1c5b76ca..63261bfa6c 100644
--- a/src/journal-remote/journal-gatewayd.c
+++ b/src/journal-remote/journal-gatewayd.c
@@ -1041,7 +1041,7 @@ int main(int argc, char *argv[]) {
MHD_USE_DEBUG |
MHD_USE_DUAL_STACK |
MHD_USE_ITC |
- MHD_USE_POLL |
+ MHD_USE_POLL_INTERNAL_THREAD |
MHD_USE_THREAD_PER_CONNECTION;
if (n > 0)
@@ -1053,10 +1053,10 @@ int main(int argc, char *argv[]) {
{MHD_OPTION_HTTPS_MEM_KEY, 0, arg_key_pem};
opts[opts_pos++] = (struct MHD_OptionItem)
{MHD_OPTION_HTTPS_MEM_CERT, 0, arg_cert_pem};
- flags |= MHD_USE_SSL;
+ flags |= MHD_USE_TLS;
}
if (arg_trust_pem) {
- assert(flags & MHD_USE_SSL);
+ assert(flags & MHD_USE_TLS);
opts[opts_pos++] = (struct MHD_OptionItem)
{MHD_OPTION_HTTPS_MEM_TRUST, 0, arg_trust_pem};
}
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index 810206c621..0e051c8ff9 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -644,6 +644,7 @@ static int setup_microhttpd_server(RemoteServer *s,
{ MHD_OPTION_END},
{ MHD_OPTION_END},
{ MHD_OPTION_END},
+ { MHD_OPTION_END},
{ MHD_OPTION_END}};
int opts_pos = 4;
int flags =
@@ -663,6 +664,15 @@ static int setup_microhttpd_server(RemoteServer *s,
if (r < 0)
return log_error_errno(r, "Failed to make fd:%d nonblocking: %m", fd);
+/* MHD_OPTION_STRICT_FOR_CLIENT is introduced in microhttpd 0.9.54,
+ * and MHD_USE_PEDANTIC_CHECKS will be deprecated in future. */
+#ifdef MHD_USE_PEDANTIC_CHECKS
+ opts[opts_pos++] = (struct MHD_OptionItem)
+ {MHD_OPTION_STRICT_FOR_CLIENT, 1};
+#else
+ flags |= MHD_USE_PEDANTIC_CHECKS;
+#endif
+
if (key) {
assert(cert);
@@ -671,7 +681,7 @@ static int setup_microhttpd_server(RemoteServer *s,
opts[opts_pos++] = (struct MHD_OptionItem)
{MHD_OPTION_HTTPS_MEM_CERT, 0, (char*) cert};
- flags |= MHD_USE_SSL;
+ flags |= MHD_USE_TLS;
if (trust)
opts[opts_pos++] = (struct MHD_OptionItem)
diff --git a/src/journal-remote/microhttpd-util.h b/src/journal-remote/microhttpd-util.h
index 7f88c2cb7d..8112851b16 100644
--- a/src/journal-remote/microhttpd-util.h
+++ b/src/journal-remote/microhttpd-util.h
@@ -41,6 +41,16 @@
# define MHD_USE_EPOLL MHD_USE_EPOLL_LINUX_ONLY
#endif
+/* Renamed in µhttpd 0.9.52 */
+#ifndef MHD_USE_SSL
+# define MHD_USE_TLS MHD_USE_SSL
+#endif
+
+/* Renamed in µhttpd 0.9.53 */
+#ifndef MHD_USE_POLL_INTERNALLY
+# define MHD_USE_POLL_INTERNAL_THREAD MHD_USE_POLL_INTERNALLY
+#endif
+
/* Both the old and new names are defines, check for the new one. */
/* Renamed in µhttpd 0.9.53 */
diff --git a/sysusers.d/systemd-remote.conf.m4 b/sysusers.d/systemd-remote.conf.m4
index 0e9d71cdd0..83b362643f 100644
--- a/sysusers.d/systemd-remote.conf.m4
+++ b/sysusers.d/systemd-remote.conf.m4
@@ -6,7 +6,6 @@
# (at your option) any later version.
m4_ifdef(`HAVE_MICROHTTPD',
-u systemd-journal-gateway - "systemd Journal Gateway"
u systemd-journal-remote - "systemd Journal Remote"
)m4_dnl
m4_ifdef(`HAVE_LIBCURL',
diff --git a/units/systemd-journal-gatewayd.service.in b/units/systemd-journal-gatewayd.service.in
index 99099967e7..42da3504b8 100644
--- a/units/systemd-journal-gatewayd.service.in
+++ b/units/systemd-journal-gatewayd.service.in
@@ -15,6 +15,7 @@ ExecStart=@rootlibexecdir@/systemd-journal-gatewayd
User=systemd-journal-gateway
Group=systemd-journal-gateway
SupplementaryGroups=systemd-journal
+DynamicUser=yes
PrivateTmp=yes
PrivateDevices=yes
PrivateNetwork=yes