{ NULL }
};
+fr_dict_attr_t const *attr_password;
fr_dict_attr_t const *attr_cleartext_password;
fr_dict_attr_t const *attr_crypt_password;
fr_dict_attr_t const *attr_ldap_userdn;
extern fr_dict_attr_autoload_t rlm_ldap_dict_attr[];
fr_dict_attr_autoload_t rlm_ldap_dict_attr[] = {
+ { .out = &attr_password, .name = "Password", .type = FR_TYPE_TLV, .dict = &dict_freeradius },
{ .out = &attr_cleartext_password, .name = "Password.Cleartext", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
{ .out = &attr_crypt_password, .name = "Password.Crypt", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
{ .out = &attr_ldap_userdn, .name = "LDAP-UserDN", .type = FR_TYPE_STRING, .dict = &dict_freeradius },
/*
* We already have a Password.Cleartext. Skip edir.
*/
- if (fr_pair_find_by_da(&request->control_pairs, NULL, attr_cleartext_password)) goto skip_edir;
+ if (fr_pair_find_by_da_nested(&request->control_pairs, NULL, attr_cleartext_password)) goto skip_edir;
/*
* Retrieve Universal Password if we use eDirectory
void rlm_ldap_check_reply(module_ctx_t const *mctx, request_t *request, fr_ldap_thread_trunk_t const *ttrunk)
{
rlm_ldap_t *inst = talloc_get_type_abort(mctx->inst->data, rlm_ldap_t);
+ fr_pair_t *parent;
- /*
+ /*
* More warning messages for people who can't be bothered to read the documentation.
*
* Expect_password is set when we process the mapping, and is only true if there was a mapping between
*/
if (!inst->expect_password || !RDEBUG_ENABLED2) return;
- if (!fr_pair_find_by_da(&request->control_pairs, NULL, attr_cleartext_password) &&
- !fr_pair_find_by_da(&request->control_pairs, NULL, attr_nt_password) &&
+ parent = fr_pair_find_by_da_nested(&request->control_pairs, NULL, attr_password);
+ if (!parent) parent = request->control_ctx;
+
+ if (!fr_pair_find_by_da_nested(&parent->vp_group, NULL, attr_cleartext_password) &&
+ !fr_pair_find_by_da_nested(&parent->vp_group, NULL, attr_nt_password) &&
!fr_pair_find_by_da(&request->control_pairs, NULL, attr_user_password) &&
- !fr_pair_find_by_da(&request->control_pairs, NULL, attr_password_with_header) &&
- !fr_pair_find_by_da(&request->control_pairs, NULL, attr_crypt_password)) {
+ !fr_pair_find_by_da_nested(&parent->vp_group, NULL, attr_password_with_header) &&
+ !fr_pair_find_by_da_nested(&parent->vp_group, NULL, attr_crypt_password)) {
switch (ttrunk->directory->type) {
case FR_LDAP_DIRECTORY_ACTIVE_DIRECTORY:
RWDEBUG2("!!! Found map between LDAP attribute and a FreeRADIUS password attribute");