From 2e37d6b71692508fa5d2764c1c80f3c7ca7c2894 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 26 Jun 2015 14:58:03 +0200 Subject: Send search requests on the same connection the explicit bind was done on, so the user's permissions regarding visibility of search results will be applied --- ldadp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ldadp.c') diff --git a/ldadp.c b/ldadp.c index 8d320a8..3b8d5f6 100644 --- a/ldadp.c +++ b/ldadp.c @@ -27,6 +27,7 @@ int main(int argc, char **argv) printf("Nö\n"); exit(1); } + setbuf(stdout, NULL); signal(SIGPIPE, SIG_IGN); if (strcmp(argv[1], "-n") == 0 && argc > 2) { isdaemon = FALSE; @@ -77,11 +78,10 @@ static void listen_callback(void *data, int haveIn, int haveOut, int doCleanup) uint16 port; int sock = socket_accept4(listen->fd, remote, &port); if (sock < 0) { - printf("Error accepting new connection.\n"); + printf("[Proxy] Error accepting new connection.\n"); return; } helper_nonblock(sock); - printf("Accepted connection.\n"); SSL *ssl = NULL; if (listen->sslContext != NULL) { ssl = ssl_new(sock, listen->sslContext); @@ -95,7 +95,7 @@ static void listen_callback(void *data, int haveIn, int haveOut, int doCleanup) client->callback = &client_callback; client->ssl = ssl; if (ssl != NULL && !ssl_acceptClient(client)) { - printf("SSL-Accepting client failed.\n"); + printf("[Proxy] SSL-Accepting client failed.\n"); SSL_free(ssl); close(sock); free(client); @@ -123,10 +123,10 @@ static int loadConfig_handler(void *stuff, const char *section, const char *key, server_setPassword(section, value); } else if (strcmp(key, "base") == 0) { server_setBase(section, value); - } else if (strcmp(key, "home") == 0 && *value != '\0') { - server_setHomeTemplate(section, value); - } else if (strcmp(key, "fingerprint") == 0 && *value != '\0') { - server_setFingerprint(section, value); + } else if (strcmp(key, "home") == 0) { + if (value[0] != '\0') server_setHomeTemplate(section, value); + } else if (strcmp(key, "fingerprint") == 0) { + if (value[0] != '\0') server_setFingerprint(section, value); } else if (strcmp(key, "port") == 0) { server_setPort(section, value); } else { -- cgit v1.2.3-55-g7522