]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
This is (usually) creating the attributes, not finding them
authorNick Porter <nick@portercomputing.co.uk>
Wed, 14 Feb 2024 13:56:45 +0000 (13:56 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 15 Feb 2024 16:32:35 +0000 (16:32 +0000)
And if it fails, that is module failure rather than noop

src/modules/rlm_sqlcounter/rlm_sqlcounter.c

index 0962da7bc6f62710550efddda9fd08bbe53afb40..7225b06f1a7124c23e2acfbc2be6963098869bca 100644 (file)
@@ -281,15 +281,18 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize(rlm_rcode_t *p_result, mod
                RETURN_MODULE_NOOP;
        }
 
+       /*
+        *      Populate start and end attributes for use in query expansion
+        */
        if (tmpl_find_or_add_vp(&vp, request, inst->start_attr) < 0) {
-               RWDEBUG2("Couldn't find %s, doing nothing...", inst->start_attr->name);
-               RETURN_MODULE_NOOP;
+               REDEBUG("Couldn't create %s", inst->start_attr->name);
+               RETURN_MODULE_FAIL;
        }
        vp->vp_uint64 = fr_time_to_sec(inst->last_reset);
 
        if (tmpl_find_or_add_vp(&vp, request, inst->end_attr) < 0) {
-               RWDEBUG2("Couldn't find %s, doing nothing...", inst->end_attr->name);
-               RETURN_MODULE_NOOP;
+               REDEBUG2("Couldn't create %s", inst->end_attr->name);
+               RETURN_MODULE_FAIL;
        }
        vp->vp_uint64 = fr_time_to_sec(inst->reset_time);