From 65ded8c69e2ecf60aa91de2ddc168e2dcd487a76 Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Wed, 27 Dec 2006 23:17:04 +0000 Subject: [PATCH] * Clear the password from the environment for security * Only convert the host list to URI at initialization git-svn-id: https://svn.alkaloid.net/gpl/ldap2dns/trunk@396 06cd67b6-e706-0410-b29e-9de616bca6e9 --- ldap2dns.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ldap2dns.c b/ldap2dns.c index cd3846b..911aa79 100644 --- a/ldap2dns.c +++ b/ldap2dns.c @@ -307,6 +307,7 @@ static int parse_options() if (ev){ strncpy(options.password, ev, sizeof(options.password)); options.password[ sizeof(options.password) -1 ] = '\0'; + memset(ev, 'x', strlen(options.password)); } } ev = getenv("LDAP2DNS_BASEDN"); @@ -1215,10 +1216,14 @@ int main(int argc, char** argv) nice(19); } set_datadir(); + + /* Convert our list of hosts into ldap_initialize() compatible URIs */ + hosts2uri(); + + /* Main loop */ for (;;) { int ldaperr = -1; - hosts2uri(); res = do_connect(); if (res != LDAP_SUCCESS || ldap_con == NULL) {