* 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
This commit is contained in:
Ben Klang
2006-12-27 23:17:04 +00:00
parent 1587217fb7
commit 65ded8c69e

View File

@@ -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) {