char *usersfile;
fr_hash_table_t *users;
+
+ /* authenticate */
+ char *auth_usersfile;
+ fr_hash_table_t *auth_users;
+
/* preacct */
char *acctusersfile;
fr_hash_table_t *acctusers;
+#ifdef WITH_PROXY
/* pre-proxy */
char *preproxy_usersfile;
fr_hash_table_t *preproxy_users;
- /* authenticate */
- char *auth_usersfile;
- fr_hash_table_t *auth_users;
-
/* post-proxy */
char *postproxy_usersfile;
fr_hash_table_t *postproxy_users;
+#endif
/* post-authenticate */
char *postauth_usersfile;
offsetof(struct file_instance,usersfile), NULL, NULL },
{ "acctusersfile", PW_TYPE_FILENAME,
offsetof(struct file_instance,acctusersfile), NULL, NULL },
+#ifdef WITH_PROXY
{ "preproxy_usersfile", PW_TYPE_FILENAME,
offsetof(struct file_instance,preproxy_usersfile), NULL, NULL },
- { "auth_usersfile", PW_TYPE_FILENAME,
- offsetof(struct file_instance,auth_usersfile), NULL, NULL },
{ "postproxy_usersfile", PW_TYPE_FILENAME,
offsetof(struct file_instance,postproxy_usersfile), NULL, NULL },
+#endif
+ { "auth_usersfile", PW_TYPE_FILENAME,
+ offsetof(struct file_instance,auth_usersfile), NULL, NULL },
{ "postauth_usersfile", PW_TYPE_FILENAME,
offsetof(struct file_instance,postauth_usersfile), NULL, NULL },
{ "compat", PW_TYPE_STRING_PTR,
* or it's a wire protocol,
* ensure it has '=='.
*/
- if (((vp->attribute & ~0xffff) != 0) ||
+ if ((vp->vendor != 0) ||
(vp->attribute < 0x100)) {
if (!compat_mode) {
DEBUG("[%s]:%d WARNING! Changing '%s =' to '%s =='\n\tfor comparing RADIUS attribute in check item list for user %s",
* then bitch about it, giving a
* good warning message.
*/
- if (!(vp->attribute & ~0xffff) &&
+ if ((vp->vendor == 0) &&
(vp->attribute > 0xff) &&
(vp->attribute > 1000)) {
log_debug("[%s]:%d WARNING! Check item \"%s\"\n"
struct file_instance *inst = instance;
fr_hash_table_free(inst->users);
fr_hash_table_free(inst->acctusers);
+#ifdef WITH_PROXY
fr_hash_table_free(inst->preproxy_users);
- fr_hash_table_free(inst->auth_users);
fr_hash_table_free(inst->postproxy_users);
+#endif
+ fr_hash_table_free(inst->auth_users);
fr_hash_table_free(inst->postauth_users);
free(inst);
return 0;
return -1;
}
+#ifdef WITH_PROXY
/*
* Get the pre-proxy stuff
*/
return -1;
}
- rcode = getusersfile(inst->auth_usersfile, &inst->auth_users, inst->compat_mode);
+ rcode = getusersfile(inst->postproxy_usersfile, &inst->postproxy_users, inst->compat_mode);
if (rcode != 0) {
- radlog(L_ERR|L_CONS, "Errors reading %s", inst->auth_usersfile);
+ radlog(L_ERR|L_CONS, "Errors reading %s", inst->postproxy_usersfile);
file_detach(inst);
return -1;
}
+#endif
- rcode = getusersfile(inst->postproxy_usersfile, &inst->postproxy_users, inst->compat_mode);
+ rcode = getusersfile(inst->auth_usersfile, &inst->auth_users, inst->compat_mode);
if (rcode != 0) {
- radlog(L_ERR|L_CONS, "Errors reading %s", inst->postproxy_usersfile);
+ radlog(L_ERR|L_CONS, "Errors reading %s", inst->auth_usersfile);
file_detach(inst);
return -1;
}
request->packet->vps, &request->reply->vps);
}
+#ifdef WITH_PROXY
static int file_preproxy(void *instance, REQUEST *request)
{
struct file_instance *inst = instance;
inst->postproxy_users,
request->proxy_reply->vps, &request->reply->vps);
}
+#endif
static int file_authenticate(void *instance, REQUEST *request)
{
file_preacct, /* preaccounting */
NULL, /* accounting */
NULL, /* checksimul */
+#ifdef WITH_PROXY
file_preproxy, /* pre-proxy */
file_postproxy, /* post-proxy */
+#else
+ NULL, NULL,
+#endif
file_postauth /* post-auth */
},
};