diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-06-22 13:36:31 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-07-15 22:31:41 -0400 |
commit | 8201af08fa09c2bd0f005fbe262f27e2c5bd2d86 (patch) | |
tree | 548dba06347317740d4c236467615fa2ee4be450 /src/journal-remote/microhttpd-util.c | |
parent | 24739b7b757d22a4b629d410a768e4e85fb02282 (diff) |
journal-remote: allow splitting incoming logs by source host
Previously existing scheme where the file name would be based on
the source was just too ugly and unpredicatable. Now there are
only two options:
1. just one file (until rotation),
2. one file per source host, using the hostname as filename part.
For the cases where the source is specified by the user, only
option one is allowed, and the full of the file must be specified.
Diffstat (limited to 'src/journal-remote/microhttpd-util.c')
-rw-r--r-- | src/journal-remote/microhttpd-util.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/journal-remote/microhttpd-util.c b/src/journal-remote/microhttpd-util.c index d0466867b7..53354938db 100644 --- a/src/journal-remote/microhttpd-util.c +++ b/src/journal-remote/microhttpd-util.c @@ -243,7 +243,7 @@ static int get_auth_dn(gnutls_x509_crt_t client_cert, char **buf) { return 0; } -int check_permissions(struct MHD_Connection *connection, int *code) { +int check_permissions(struct MHD_Connection *connection, int *code, char **hostname) { const union MHD_ConnectionInfo *ci; gnutls_session_t session; gnutls_x509_crt_t client_cert; @@ -282,6 +282,11 @@ int check_permissions(struct MHD_Connection *connection, int *code) { log_info("Connection from %s", buf); + if (hostname) { + *hostname = buf; + buf = NULL; + } + r = verify_cert_authorized(session); if (r < 0) { log_warning("Client is not authorized"); |