#include <netinet/in.h>
#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-
#define NO_SUCH_CHILD_PID (child_pid_t) (0)
#ifndef NDEBUG
lrad_ipaddr_t ipaddr;
int prefix;
char *longname;
- u_char *secret;
+ char *secret;
char *shortname;
char *nastype;
char *login;
char acct_server[64];
lrad_ipaddr_t ipaddr; /* authentication */
lrad_ipaddr_t acct_ipaddr;
- u_char secret[32];
+ char secret[32];
time_t last_reply; /* last time we saw a packet */
int auth_port;
int acct_port;
RAD_COMPARE_FUNC func,
void *instance);
void paircompare_unregister(int attr, RAD_COMPARE_FUNC func);
-int paircmp(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check,
- VALUE_PAIR **reply);
+int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check,
+ VALUE_PAIR **reply);
int simplepaircmp(REQUEST *, VALUE_PAIR *, VALUE_PAIR *);
void pair_builtincompare_init(void);
void pairxlatmove(REQUEST *, VALUE_PAIR **to, VALUE_PAIR **from);
/*
* Compare 2 attributes. May call the attribute compare function.
*/
-static int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check,
+static int compare_pair(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check,
VALUE_PAIR *check_pairs, VALUE_PAIR **reply_pairs)
{
int ret = -2;
struct cmp *c;
/*
- * Sanity check.
- */
-#if 0
- if (request->attribute != check->attribute)
- return -2;
-#endif
-
- /*
* Check for =* and !* and return appropriately
*/
if( check->operator == T_OP_CMP_TRUE )
*
* Return 0 on match.
*/
-int paircmp(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR **reply)
+int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check, VALUE_PAIR **reply)
{
VALUE_PAIR *check_item;
VALUE_PAIR *auth_item;
/*
* OK it is present now compare them.
*/
- compare = paircompare(req, auth_item, check_item, check, reply);
+ compare = compare_pair(req, auth_item, check_item, check, reply);
switch (check_item->operator) {
case T_OP_EQ:
}
/*
- * Compare two attributes simply. Calls paircompare.
+ * Compare two attributes simply. Calls compare_pair.
*/
int simplepaircmp(REQUEST *req, VALUE_PAIR *first, VALUE_PAIR *second)
{
- return paircompare( req, first, second, NULL, NULL );
+ return compare_pair( req, first, second, NULL, NULL );
}
char buffer[sizeof(attr_vp->vp_strvalue)];
/*
- * Stolen from src/main/valuepair.c, paircmp()
+ * Stolen from src/main/valuepair.c, paircompare()
*/
/*
if ( parse_state == SMP_PATTERN ) { /* pattern line found */
DEBUG2("process pattern");
/* check pattern against request */
- if ( paircmp(NULL, request, vp, reply ) == 0 ) {
+ if ( paircompare(NULL, request, vp, reply ) == 0 ) {
DEBUG2("rlm_dbm: Pattern matched, look for request");
pairmove(&tmp_config, &vp);
pairfree(&vp);
*/
while((cur) && (!userfound)) {
if((strcmp(cur->name, username)==0) &&
- paircmp(request, request->packet->vps, cur->check, &request->reply->vps) == 0) {
+ paircompare(request, request->packet->vps, cur->check, &request->reply->vps) == 0) {
userfound = 1;
DEBUG2(" fastusers: Matched %s at %d", cur->name, cur->lineno);
} else {
curdefault = inst->defaults;
while(curdefault) {
- if(paircmp(request, request->packet->vps, curdefault->check,
+ if(paircompare(request, request->packet->vps, curdefault->check,
&request->reply->vps) == 0) {
DEBUG2(" fastusers: Matched %s at %d",
curdefault->name, curdefault->lineno);
if (strcmp(name, pl->name) && strcmp(pl->name, "DEFAULT"))
continue;
- if (paircmp(request, request_pairs, pl->check, &reply_pairs) == 0) {
+ if (paircompare(request, request_pairs, pl->check, &reply_pairs) == 0) {
DEBUG2(" acct_users: Matched %s at %d",
pl->name, pl->lineno);
found = 1;
* check pairs, then add the reply pairs from the
* entry to the current list of reply pairs.
*/
- if ((paircmp(request, request_pairs, pl->check, reply_pairs) == 0)) {
+ if ((paircompare(request, request_pairs, pl->check, reply_pairs) == 0)) {
DEBUG2(" users: Matched entry %s at line %d", pl->name, pl->lineno);
found = 1;
check_tmp = paircopy(pl->check);
if (strcmp(name, pl->name) && strcmp(pl->name, "DEFAULT"))
continue;
- if (paircmp(request, request_pairs, pl->check, reply_pairs) == 0) {
+ if (paircompare(request, request_pairs, pl->check, reply_pairs) == 0) {
DEBUG2(" acct_users: Matched entry %s at line %d",
pl->name, pl->lineno);
found = 1;
if (strcmp(name, pl->name) && strcmp(pl->name, "DEFAULT"))
continue;
- if (paircmp(request, request_pairs, pl->check, reply_pairs) == 0) {
+ if (paircompare(request, request_pairs, pl->check, reply_pairs) == 0) {
VALUE_PAIR *vp;
DEBUG2(" preproxy_users: Matched entry %s at line %d",
pairadd(reply_pairs,reply_tmp);
}
- if (inst->do_comp && paircmp(request,request->packet->vps,*check_pairs,reply_pairs) != 0){
+ if (inst->do_comp && paircompare(request,request->packet->vps,*check_pairs,reply_pairs) != 0){
#ifdef NOVELL
/* Don't perform eDirectory APC if RADIUS authorize fails */
int apc_attr;
tmp = check_item->next;
check_item->next = NULL;
- result = paircmp(req, request, check_item, NULL);
+ result = paircompare(req, request, check_item, NULL);
check_item->next = tmp;
check_item = check_item->next;
for (i = hints; i; i = i->next) {
/*
- * Use "paircmp", which is a little more general...
+ * Use "paircompare", which is a little more general...
*/
- if (paircmp(request, request_pairs, i->check, NULL) == 0) {
+ if (paircompare(request, request_pairs, i->check, NULL) == 0) {
DEBUG2(" hints: Matched %s at %d",
i->name, i->lineno);
break;
/*
* See if this entry matches.
*/
- if (paircmp(request, request_pairs, i->check, NULL) != 0)
+ if (paircompare(request, request_pairs, i->check, NULL) != 0)
continue;
/*
/*
* Only do this if *some* check pairs were returned
*/
- if (paircmp(request, request->packet->vps, check_tmp, &request->reply->vps) == 0) {
+ if (paircompare(request, request->packet->vps, check_tmp, &request->reply->vps) == 0) {
found = 1;
DEBUG2("rlm_sql (%s): User found in group %s",
inst->config->xlat_name, group_list_tmp->groupname);
/*
- * Now get the reply pairs since the paircmp matched
+ * Now get the reply pairs since the paircompare matched
*/
if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_reply_query, request, sql_escape_func)) {
radlog(L_ERR, "rlm_sql (%s): Error generating query; rejecting user",
DEBUG2("rlm_sql (%s): User found in group %s",
inst->config->xlat_name, group_list_tmp->groupname);
/*
- * Now get the reply pairs since the paircmp matched
+ * Now get the reply pairs since the paircompare matched
*/
if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_reply_query, request, sql_escape_func)) {
radlog(L_ERR, "rlm_sql (%s): Error generating query; rejecting user",
/*
* Only do this if *some* check pairs were returned
*/
- if (paircmp(request, request->packet->vps, check_tmp, &request->reply->vps) == 0) {
+ if (paircompare(request, request->packet->vps, check_tmp, &request->reply->vps) == 0) {
found = 1;
DEBUG2("rlm_sql (%s): User found in radcheck table", inst->config->xlat_name);
/*
- * Now get the reply pairs since the paircmp matched
+ * Now get the reply pairs since the paircompare matched
*/
if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_reply_query, request, sql_escape_func)) {
radlog(L_ERR, "rlm_sql (%s): Error generating query; rejecting user",