Bug 501405 - modify_internal_pb fails to insert pwp control into pb
modify_internal_pb fails to insert pwp control into pb
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Security - Password Policy (Show other bugs)
1.2.0
All All
low Severity medium
: ---
: ---
Assigned To: Rich Megginson
Viktor Ashirov
:
Depends On:
Blocks: 389_1.2.1 639035
  Show dependency treegraph
 
Reported: 2009-05-18 19:52 EDT by Ulf Weltman
Modified: 2015-12-07 12:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 12:12:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ulf Weltman 2009-05-18 19:52:08 EDT
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 );
Comment 1 Rich Megginson 2009-05-19 15:44:02 EDT
I just submitted a fix for this, along with several other compiler warning fixes, to 389-devel
Comment 2 Ulf Weltman 2009-05-19 15:54:40 EDT
Aha, it was supposed to be an int flag, not the actual control structure, I misread the use of that pblock field.
Comment 3 Rich Megginson 2009-05-19 16:15:36 EDT
commit f9db3ac14855eb07e49f2f5797cbb7d338bb614b
Author: Rich Megginson <rmeggins@redhat.com>
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!)

Note You need to log in before you can comment on or make changes to this bug.