From 55604c827caca69aeece680593a68ff288ab2668 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Tue, 27 Oct 2009 21:36:16 +0100 Subject: [PATCH] Do not log OTPs unless requested --- src/main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index d3c5f99..b5d8813 100644 --- a/src/main.c +++ b/src/main.c @@ -385,7 +385,8 @@ static int handle_request(void * priv, otp = MHD_lookup_connection_value(conn, MHD_GET_ARGUMENT_KIND, "otp"); h = MHD_lookup_connection_value(conn, MHD_GET_ARGUMENT_KIND, "h"); syslog(LOG_DEBUG, "Got new connection with parameters: " - "url=%s id=%s otp=, h=%s\n", url, id, h); + "url=%s id=%s otp=%s, h=%s\n", url, id, + (conf->log_otp ? otp : ""), h); /* Do query to grab shared secret, we need this later anyway */ if (get_shared_secret(id, &shared_secret, &shared_secret_len) < 0) { @@ -551,6 +552,10 @@ int parse_config(const char *file, struct ykc_config *c) c->port = strtol(value, NULL, 0); continue; } + if (strcmp(key, "log_otp") == 0) { + c->log_otp = strtol(value, NULL, 0); + continue; + } } return 0; } -- 2.39.5