Commit 3e930632 authored by Ondřej Kuzník's avatar Ondřej Kuzník
Browse files

ITS#9347 Retry with default if specified one is invalid/missing

parent 71a9103a
Pipeline #1716 failed with stage
in 8 minutes and 56 seconds
...@@ -879,6 +879,7 @@ ppolicy_get( Operation *op, Entry *e, PassPolicy *pp ) ...@@ -879,6 +879,7 @@ ppolicy_get( Operation *op, Entry *e, PassPolicy *pp )
/* /*
* entry has no password policy assigned - use default * entry has no password policy assigned - use default
*/ */
retry_default:
vals = &pi->def_policy; vals = &pi->def_policy;
if ( !vals->bv_val ) if ( !vals->bv_val )
goto defaultpol; goto defaultpol;
...@@ -1069,6 +1070,13 @@ defaultpol: ...@@ -1069,6 +1070,13 @@ defaultpol:
} }
if ( rc && !BER_BVISNULL( vals ) ) { if ( rc && !BER_BVISNULL( vals ) ) {
if ( vals != &pi->def_policy ) {
Debug( LDAP_DEBUG_ANY, "ppolicy_get: "
"policy subentry %s missing or invalid at '%s', "
"trying default\n",
vals->bv_val, ad ? ad->ad_cname.bv_val : "" );
goto retry_default;
}
Debug( LDAP_DEBUG_ANY, "ppolicy_get: " Debug( LDAP_DEBUG_ANY, "ppolicy_get: "
"policy subentry %s missing or invalid at '%s', " "policy subentry %s missing or invalid at '%s', "
"no policy will be applied!\n", "no policy will be applied!\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment