lib/libdsa/dsalib_conf.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 980593ec606a5f4ec04c69a4b96ee15e95ffea49
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Aug 9 08:06:16 2011 -0700
Bug 724808 - startup CGIs write temp file to /
The startup CGI was attempting to use '/' as a temp area since it
was unable to fetch the 'nsslapd-tmpdir' value from dse.ldif. It
turns out that the dsalib function that fetches values from the
dse.ldif file was freeing the value before duplicating it. This
was causing an empty value to be used for the temp area, and was
likely causing other config values to be messed up as well.
The fix is to duplicate the value to be returned before freeing
the dse.ldif contents.
diff --git a/lib/libdsa/dsalib_conf.c b/lib/libdsa/dsalib_conf.c
index 4673e2f..d4428de 100644
--- a/lib/libdsa/dsalib_conf.c
+++ b/lib/libdsa/dsalib_conf.c
@@ -143,7 +143,7 @@ struct ds_cfg_info ds_cfg_info[] = {
DS_EXPORT_SYMBOL char *
ds_get_config_value( int option )
{
- char **all, *value;
+ char **all, *value, *retval;
int i;
char *attr = ds_get_var_name(option);
@@ -162,8 +162,9 @@ ds_get_config_value( int option )
++value;
}
if ( !strcasecmp( attr, all[ i ] )) {
+ retval = strdup(value);
ds_free_config(all);
- return strdup( value );
+ return retval;
}
}
ds_free_config(all);
Show replies by thread