mirror of
https://github.com/bklang/ldap2dns.git
synced 2025-10-27 14:24:15 -04:00
* 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:
@@ -307,6 +307,7 @@ static int parse_options()
|
|||||||
if (ev){
|
if (ev){
|
||||||
strncpy(options.password, ev, sizeof(options.password));
|
strncpy(options.password, ev, sizeof(options.password));
|
||||||
options.password[ sizeof(options.password) -1 ] = '\0';
|
options.password[ sizeof(options.password) -1 ] = '\0';
|
||||||
|
memset(ev, 'x', strlen(options.password));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ev = getenv("LDAP2DNS_BASEDN");
|
ev = getenv("LDAP2DNS_BASEDN");
|
||||||
@@ -1215,10 +1216,14 @@ int main(int argc, char** argv)
|
|||||||
nice(19);
|
nice(19);
|
||||||
}
|
}
|
||||||
set_datadir();
|
set_datadir();
|
||||||
|
|
||||||
|
/* Convert our list of hosts into ldap_initialize() compatible URIs */
|
||||||
|
hosts2uri();
|
||||||
|
|
||||||
|
/* Main loop */
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int ldaperr = -1;
|
int ldaperr = -1;
|
||||||
|
|
||||||
hosts2uri();
|
|
||||||
|
|
||||||
res = do_connect();
|
res = do_connect();
|
||||||
if (res != LDAP_SUCCESS || ldap_con == NULL) {
|
if (res != LDAP_SUCCESS || ldap_con == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user