25 RCSID(
"$Id: da81ac13280fc7cf691e28300bcbfb111470e597 $")
27 #include <freeradius-devel/radiusd.h>
28 #include <freeradius-devel/modules.h>
40 if (check_item != NULL) {
49 if (((time_t) check_item->vp_date) <= request->timestamp.tv_sec) {
51 REDEBUG(
"Account expired at '%s'", date);
57 RDEBUG(
"Account will expire at '%s'", date);
68 vp->vp_date = (uint32_t) (((time_t) check_item->vp_date) - request->timestamp.tv_sec);
69 }
else if (vp->vp_date > ((uint32_t) (((time_t) check_item->vp_date) - request->timestamp.tv_sec))) {
70 vp->vp_date = (uint32_t) (((time_t) check_item->vp_date) - request->timestamp.tv_sec);
87 now = (req) ? req->
timestamp.tv_sec : time(NULL);
89 if (now <= ((time_t) check->vp_date))
126 .name =
"expiration",
int paircompare_register(fr_dict_attr_t const *attribute, fr_dict_attr_t const *from, bool first_only, RAD_COMPARE_FUNC func, void *instance)
Register a function as compare function.
The module is OK, continue.
Metadata exported by the module.
7 methods index for postauth section.
VALUE_PAIR * radius_pair_create(TALLOC_CTX *ctx, VALUE_PAIR **vps, unsigned int attribute, unsigned int vendor)
Create a VALUE_PAIR and add it to a list of VALUE_PAIR s.
static rlm_rcode_t mod_authorize(void *instance, REQUEST *request)
Handle authorization requests using Couchbase document data.
#define RLM_TYPE_THREAD_SAFE
Module is threadsafe.
#define RDEBUG_ENABLED
True if request debug level 1 messages are enabled.
void size_t fr_pair_value_snprint(char *out, size_t outlen, VALUE_PAIR const *vp, char quote)
Print the value of an attribute to a string.
Reject the request (user is locked out).
static rlm_rcode_t CC_HINT(nonnull)
Stores an attribute, a value and various bits of other data.
enum rlm_rcodes rlm_rcode_t
Return codes indicating the result of the module call.
static int expirecmp(UNUSED void *instance, REQUEST *req, UNUSED VALUE_PAIR *request, VALUE_PAIR *check, UNUSED VALUE_PAIR *check_pairs, UNUSED VALUE_PAIR **reply_pairs)
Module succeeded without doing anything.
uint64_t magic
Used to validate module struct.
struct timeval timestamp
When we started processing the request.
VALUE_PAIR * fr_pair_find_by_num(VALUE_PAIR *head, unsigned int vendor, unsigned int attr, int8_t tag)
Find the pair with the matching attribute.
static int mod_instantiate(UNUSED CONF_SECTION *conf, void *instance)
fr_dict_attr_t const * fr_dict_attr_by_num(fr_dict_t *dict, unsigned int vendor, unsigned int attr)
Lookup a fr_dict_attr_t by its vendor and attribute numbers.
1 methods index for authorize section.