Issue 4741 - ppolicy.c improperly discards return value of check_password() function
Summary: ppolicy.c improperly discards return value of check_password() function
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-09 02:20 UTC by lsherida@nccs.nasa.gov
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description lsherida@nccs.nasa.gov 2006-11-09 02:20:04 UTC
Full_Name: Lee Sheridan
Version: 2.3.27
OS: Debian GNU/Linux (etch)
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (69.168.13.7)


In servers/slapd/overlays/ppolicy.c, check_password_quality function, at
line 530, the value of the 'ok' variable is discarded by unconditionally
assigning it the value LDAP_SUCCESS.

The variable is the return code of the user-defined check_password() function,
which is assigned at line 522.  The next if-then-else block is checking to
see if the module reported an error, at which point 'ok' would be assigned
LDAP_OTHER regardless of what check_password() returned.  A superfluous else
block appears after this check, assigning 'ok' to LDAP_SUCCESS.

It works fine for me if I remove the else block.

Thanks,

Comment 1 Howard Chu 2006-11-09 03:10:13 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 2 Quanah Gibson-Mount 2006-11-09 17:59:00 UTC

--On Thursday, November 09, 2006 2:20 AM +0000 lsherida@nccs.nasa.gov wrote:

> Full_Name: Lee Sheridan
> Version: 2.3.27
> OS: Debian GNU/Linux (etch)
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (69.168.13.7)
>
>
> In servers/slapd/overlays/ppolicy.c, check_password_quality function, at
> line 530, the value of the 'ok' variable is discarded by unconditionally
> assigning it the value LDAP_SUCCESS.
>
> The variable is the return code of the user-defined check_password()
> function, which is assigned at line 522.  The next if-then-else block is
> checking to see if the module reported an error, at which point 'ok'
> would be assigned LDAP_OTHER regardless of what check_password()
> returned.  A superfluous else block appears after this check, assigning
> 'ok' to LDAP_SUCCESS.
>
> It works fine for me if I remove the else block.

Howard checked in a fix to HEAD for this last night, please test.

--Quanah


--
Quanah Gibson-Mount
Principal Software Developer
ITS/Shared Application Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html

Comment 3 Howard Chu 2006-11-09 18:02:39 UTC
lsherida@nccs.nasa.gov wrote:
> Full_Name: Lee Sheridan
> Version: 2.3.27
> OS: Debian GNU/Linux (etch)
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (69.168.13.7)
> 
> 
> In servers/slapd/overlays/ppolicy.c, check_password_quality function, at
> line 530, the value of the 'ok' variable is discarded by unconditionally
> assigning it the value LDAP_SUCCESS.
> 
> The variable is the return code of the user-defined check_password() function,
> which is assigned at line 522.  The next if-then-else block is checking to
> see if the module reported an error, at which point 'ok' would be assigned
> LDAP_OTHER regardless of what check_password() returned.  A superfluous else
> block appears after this check, assigning 'ok' to LDAP_SUCCESS.
> 
> It works fine for me if I remove the else block.
> 
> Thanks,

A fix has been committed to CVS HEAD.

-- 
   -- Howard Chu
   Chief Architect, Symas Corp.  http://www.symas.com
   Director, Highland Sun        http://highlandsun.com/hyc
   OpenLDAP Core Team            http://www.openldap.org/project/

Comment 4 Howard Chu 2006-11-11 20:03:17 UTC
changed notes
Comment 5 Kurt Zeilenga 2006-11-14 20:50:08 UTC
changed state Test to Closed
Comment 6 Howard Chu 2009-02-17 05:20:13 UTC
moved from Software Bugs to Archive.Software Bugs
Comment 7 OpenLDAP project 2014-08-01 21:06:45 UTC
fixed in HEAD/RE23