From: Alan T. DeKok Date: Wed, 19 Oct 2016 16:37:27 +0000 (-0400) Subject: return RLM_MODULE_NOTFOUND if nothing was found X-Git-Tag: release_3_0_13~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d21f129475ec592f243bc1ddf5593d1caae2303;p=thirdparty%2Ffreeradius-server.git return RLM_MODULE_NOTFOUND if nothing was found --- diff --git a/src/modules/rlm_passwd/rlm_passwd.c b/src/modules/rlm_passwd/rlm_passwd.c index e9957d23d3a..e8cd8afad2c 100644 --- a/src/modules/rlm_passwd/rlm_passwd.c +++ b/src/modules/rlm_passwd/rlm_passwd.c @@ -542,6 +542,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_passwd_map(void *instance, REQUEST *requ VALUE_PAIR *key, *i; struct mypasswd * pw, *last_found; vp_cursor_t cursor; + int found = 0; key = fr_pair_find_by_da(request->packet->vps, inst->keyattr, TAG_ANY); if (!key) { @@ -564,11 +565,15 @@ static rlm_rcode_t CC_HINT(nonnull) mod_passwd_map(void *instance, REQUEST *requ addresult(request->packet, inst, request, &request->packet->vps, pw, 2, "request_items"); } while ((pw = get_next(buffer, inst->ht, &last_found))); + found++; + if (!inst->allow_multiple) { break; } } + if (!found) return RLM_MODULE_NOTFOUND; + return RLM_MODULE_OK; #undef inst