ldap_parse_pwdpolicy_response()--Obtain the LDAP Password Policy Error or Warning Codes


  Syntax
 #include <ldap.h>
 
 int ldap_parse_pwdpolicy_response(
              LDAPControl **serverControls,
              int         *controlerr,
              int         *controlwarn,
              int         *controlres)

  Library Name/Service Program: QSYS/QGLDCLNT

  Default Public Authority: *USE

  Threadsafe: Yes

The ldap_parse_pwdpolicy_response() function is used to obtain the LDAP password policy error or warning codes from the password policy response control asociated with an LDAPMessage message. The two possible warnings are timebeforeexpiration and graceloginsremaining. For warnings, the function can also be used to obtain the LDAP password policy warning result code (the number of seconds value) associated with the warning code.


Authorities and Locks

No IBM® i authority is required. All authority checking is done by the LDAP server.


Parameters

serverControls
(Input) Specifies an array of LDAPCONTROL pointers returned by a previous call to ldap_parse_result(). See Controls for LDAP APIs for more information about server controls.

controlerr
(Input) Specifies a pointer to the result parameter that is filled in with the LDAP Password Policy error code. This can be used as input to ldap_pwdpolicy_err2string() to obtain a text description of the error. Possible controlerr values:
LDAP_PASSWORD_EXPIRED 0x03
LDAP_ACCOUNT_LOCKED 0x04
LDAP_CHANGE_AFTER_RESET 0x05
LDAP_TIME_BEFORE_EXPIRE 0x06
LDAP_NEED_OLD_PASSWORD 0x07
LDAP_INVALID_PASS_SYNTAX 0x08
LDAP_PASSWORD_TOO_SHORT 0x09
LDAP_PASSWORD_TOO_YOUNG 0x0A
LDAP_PASSWORD_IN_HISTORY 0x0B

controlwarn
(Input) Specifies a pointer to the result parameter that is filled in with the LDAP Password Policy warning code. This can be used as input to ldap_pwdpolicy_err2string() to obtain a text description of the warning. Possible controlwarn values:
LDAP_TIME_BEFORE_EXPIRE 0x01
LDAP_GRACE_LOGINS 0x02

controlres
(Input) Specifies a pointer to the result parameter that is filled in with the LDAP Password Policy warning result value.


Error Conditions

The ldap_parse_pwdpolicy_response() function returns an LDAP error code if it encounters an error parsing the result. See LDAP Client API Error Conditions for possible LDAP error code values. The error code indicates if the operation completed successfully.


Related Information



API introduced: V5R3

[ Back to top | LDAP APIs | APIs by category ]