c = rad_malloc(sizeof(struct cmp));
- if (compare_attr < 0)
+ if (compare_attr < 0)
compare_attr = attr;
c->compare = fun;
c->attribute = attr;
rcode = radius_xlat(buffer, sizeof(buffer),
check_item->strvalue,
req, NULL);
-
+
/*
* Parse the string into a new value.
*/
case T_OP_GT:
if (compare <= 0) result = -1;
break;
-
+
case T_OP_LE:
if (compare > 0) result = -1;
break;
return 0;
}
s = strtok(NULL, ",");
- }
+ }
return -1;
}
/*
* Compare prefix/suffix.
*
- * If they compare:
+ * If they compare:
* - if PW_STRIP_USER_NAME is present in check_pairs,
* strip the username of prefix/suffix.
* - if PW_STRIP_USER_NAME is not present in check_pairs,
char rest[MAX_STRING_LEN];
int len, namelen;
int ret = -1;
-
+
instance = instance;
reply_pairs = reply_pairs; /* shut the compiler up */
* and have one less system call to do.
*/
static int timecmp(void *instance,
- REQUEST *req UNUSED,
+ REQUEST *req UNUSED,
VALUE_PAIR *request, VALUE_PAIR *check,
VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs)
{
rcode = radius_xlat(buffer, sizeof(buffer),
i->strvalue,
req, NULL);
-
+
/*
* Parse the string into a new value.
*/
found = pairfind(*to, i->attribute);
switch (i->operator) {
-
+
/*
* If a similar attribute is found,
* delete it.
(strcmp((char *)found->strvalue,
(char *)i->strvalue) == 0)){
pairdelete(to, found->attribute);
-
+
/*
* 'tailto' may have been
* deleted...
tailfrom = i;
continue;
break;
-
+
/*
* Add it, if it's not already there.
*/
continue; /* with the loop */
}
break;
-
+
/*
* If a similar attribute is found,
* replace it with the new one. Otherwise,
continue;
}
break;
-
+
/*
* FIXME: Add support for <=, >=, <, >
*
* which will mean (for integers)
* 'make the attribute the smaller, etc'
*/
-
+
/*
* Add the new element to the list, even
* if similar ones already exist.
case T_OP_ADD: /* += */
break;
}
-
+
if (tailfrom)
tailfrom->next = next;
else
*from = next;
-
+
/*
* If ALL of the 'to' attributes have been deleted,
* then ensure that the 'tail' is updated to point