I noticed this compile error: Warning 942: "../ldap/servers/slapd/modify.c", line 461 # Types 'ldapcontrol *' and 'int' are not assignment-compatible. pwpolicy_ctrl = slapi_control_present( controls, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The function slapi_control_present() returns 0 or 1, not an LDAPControl *. This function from LDAP SDK might do the trick (ldap-extension.h): LDAP_API(LDAPControl *) LDAP_CALL ldap_find_control( const char *oid, LDAPControl **ctrls );
I just submitted a fix for this, along with several other compiler warning fixes, to 389-devel
Aha, it was supposed to be an int flag, not the actual control structure, I misread the use of that pblock field.
commit f9db3ac14855eb07e49f2f5797cbb7d338bb614b Author: Rich Megginson <rmeggins> Date: Tue May 19 13:17:11 2009 -0600 Fix various compiler warnings 1) Make sure we use "const" consistently 2) Make sure we use "unsigned char" consistently for some reason (unsigned char)*p did not compare to '\xHH' literals unless the literal was also cast to (unsigned char) 3) added some missing function prototypes 4) removed some unused variables/functions, or commented out for use when de bugging 5) various other compiler warnings With all of these, the code compiles cleanly on RHEL5 x86_64 using gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44) and CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-prot ector --param=ssp-buffer-size=4 -m64 -mtune=generic" The only warning now is the spurious message about %llu or %lld having the w rong format argument. Reviewed by: nhosoi (Thanks!)