X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal-remote%2Fmicrohttpd-util.c;h=53354938db392e77a6ae3b6f94c229aaf384c038;hb=4a0a6ac03864998c83918175609275df712a5a05;hp=d0466867b7768377a6404bc7699071bf082a3c0f;hpb=1e4e7b71e1938daa9b2b9718a9f54c69017a9ef5;p=elogind.git diff --git a/src/journal-remote/microhttpd-util.c b/src/journal-remote/microhttpd-util.c index d0466867b..53354938d 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");