Author: rmeggins
Update of /cvs/dirsec/adminutil/lib/libadmsslutil
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11511/adminutil/lib/libadmsslutil
Modified Files:
admsslutil.c
Log Message:
Resolves: bug 245396
Bug Description: adminutil: retrieveISIEs returns bogus data
Reviewed by: nkinder (Thanks!)
Fix Description: retrieveISIEs creates a list of id + DN pairs using
the ListNodePtr interface. Each node has a name (the id) and a value
(a char ** with the DN as the first char *) and forms a linked list of
all of the values. It then flattens the list into an array of name/value
pairs for returning. However, instead of passing val[0] to the
addSingleValueAttribute() function for the value, it was passing val cast
to a (char *), which is entirely bogus.
The fix is to pass in ((char**)node->val)[0] which is a char * value. Yet
another lesson in why void * is bad, and why you should not defeat the
compiler's type checker . . .
I also fixed another minor mem leak, and added @nss_inc@ to the list of include
directories - I guess it works because pkg-config mozldap[6] always returns the
nss include directory in its output . . .
Platforms tested: RHEL4
Flag day: Yes - autotool file changes
Index: admsslutil.c
===================================================================
RCS file: /cvs/dirsec/adminutil/lib/libadmsslutil/admsslutil.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- admsslutil.c 8 May 2007 19:13:26 -0000 1.8
+++ admsslutil.c 22 Jun 2007 21:06:45 -0000 1.9
@@ -166,6 +166,8 @@
PK11_ConfigurePKCS11(NULL,NULL,NULL,db_name,NULL, NULL,NULL,NULL,
/*minPwdLen=*/8, /*pwdRequired=*/1);
+ PL_strfree(db_name);
+ db_name = NULL;
/* init NSS */
if (NSS_Initialize(securitydir, NULL, NULL, SECMOD_DB, flags)) {