Author: rmeggins
Update of /cvs/dirsec/adminutil/lib/libadminutil
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11511/adminutil/lib/libadminutil
Modified Files:
srvutil.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: srvutil.c
===================================================================
RCS file: /cvs/dirsec/adminutil/lib/libadminutil/srvutil.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- srvutil.c 8 May 2007 19:13:25 -0000 1.4
+++ srvutil.c 22 Jun 2007 21:06:44 -0000 1.5
@@ -228,7 +228,7 @@
addSingleValueAttribute(resultList,
i++,
node->name,
- (char*)(node->val));
+ ((char**)node->val)[0]);
node = node->next;
}
}
Show replies by date