summaryrefslogtreecommitdiffstats
path: root/ldadp.c
diff options
context:
space:
mode:
authorSimon Rettberg2015-06-26 14:58:03 +0200
committerSimon Rettberg2015-06-26 14:58:03 +0200
commit2e37d6b71692508fa5d2764c1c80f3c7ca7c2894 (patch)
tree7a2e3240c380b9c532fc990dfefc1179eb3a1420 /ldadp.c
parentFix the fix of the fix of SSL (diff)
downloadldadp-2e37d6b71692508fa5d2764c1c80f3c7ca7c2894.tar.gz
ldadp-2e37d6b71692508fa5d2764c1c80f3c7ca7c2894.tar.xz
ldadp-2e37d6b71692508fa5d2764c1c80f3c7ca7c2894.zip
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
Diffstat (limited to 'ldadp.c')
-rw-r--r--ldadp.c14
1 files changed, 7 insertions, 7 deletions
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 {