Skip to content

Commit

Permalink
* Clear the password from the environment for security
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
bklang committed Dec 27, 2006
1 parent 1587217 commit 65ded8c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ldap2dns.c
Expand Up @@ -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");
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 65ded8c

Please sign in to comment.