chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix problem with allocating large buffers and log leftovers
[elogind.git]
/
src
/
journal-remote
/
microhttpd-util.c
diff --git
a/src/journal-remote/microhttpd-util.c
b/src/journal-remote/microhttpd-util.c
index d0466867b7768377a6404bc7699071bf082a3c0f..53354938db392e77a6ae3b6f94c229aaf384c038 100644
(file)
--- 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;
}
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;
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);
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");
r = verify_cert_authorized(session);
if (r < 0) {
log_warning("Client is not authorized");