From 8c9f071238cf1924bee447dc4ee9a6bf66b9ca32 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 20 Mar 2006 11:57:16 +0000 Subject: [PATCH] duplicate string from environment, as it may be overridden by the user (ITS#4436) --- libraries/libldap/init.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c index e128ddac18..bdca52823c 100644 --- a/libraries/libldap/init.c +++ b/libraries/libldap/init.c @@ -417,6 +417,12 @@ ldap_int_destroy_global_options(void) ldap_int_hostname = NULL; } #endif +#ifdef HAVE_CYRUS_SASL + if ( gopts->ldo_def_sasl_authcid ) { + LDAP_FREE( gopts->ldo_def_sasl_authcid ); + gopts->ldo_def_sasl_authcid = NULL; + } +#endif } /* @@ -567,7 +573,7 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl ) if( user == NULL ) user = getenv("LOGNAME"); if( user != NULL ) { - gopts->ldo_def_sasl_authcid = user; + gopts->ldo_def_sasl_authcid = LDAP_STRDUP( user ); } } #endif -- 2.39.5