tids_send_err_response(tids, orig_req, "RP Realm filter error");
return -1;
}
- /* Check that the rp_realm and target_realm are members of the community in the request */
+ /* Check that the rp_realm is a member of the community in the request */
if (NULL == (tr_find_comm_rp(cfg_comm, orig_req->rp_realm))) {
- fprintf(stderr, "tr_tids_req_hander: RP Realm (%s) not member of community (%s).\n", orig_req->rp_realm->buf, orig_req->comm->buf);
+ fprintf(stderr, "tr_tids_req_handler: RP Realm (%s) not member of community (%s).\n", orig_req->rp_realm->buf, orig_req->comm->buf);
tids_send_err_response(tids, orig_req, "RP COI membership error");
return -1;
}
- if (NULL == (tr_find_comm_idp(cfg_comm, orig_req->realm))) {
- fprintf(stderr, "tr_tids_req_hander: IDP Realm (%s) not member of APC (%s).\n", orig_req->realm->buf, orig_req->comm->buf);
- tids_send_err_response(tids, orig_req, "IDP COI membership error");
- return -1;
- }
/* Map the comm in the request from a COI to an APC, if needed */
if (TR_COMM_COI == cfg_comm->type) {
fwd_req->comm = apc;
fwd_req->orig_coi = orig_req->comm;
- /* Check that rp_realm and target_realm are members of this APC */
+ /* Check that rp_realm is a member of this APC */
if (NULL == (tr_find_comm_rp(cfg_apc, orig_req->rp_realm))) {
fprintf(stderr, "tr_tids_req_hander: RP Realm (%s) not member of community (%s).\n", orig_req->rp_realm->buf, orig_req->comm->buf);
tids_send_err_response(tids, orig_req, "RP APC membership error");
return -1;
}
- if (NULL == (tr_find_comm_idp(cfg_apc, orig_req->realm))) {
- fprintf(stderr, "tr_tids_req_hander: IDP Realm (%s) not member of APC (%s).\n", orig_req->realm->buf, orig_req->comm->buf);
- tids_send_err_response(tids, orig_req, "IDP APC membership error");
- return -1;
- }
}
/* Find the AAA server(s) for this request */
tids_send_err_response(tids, orig_req, "No path to AAA Server(s) for realm");
return -1;
}
+ } else {
+ /* if we aren't defaulting, check idp coi and apc membership */
+ if (NULL == (tr_find_comm_idp(cfg_comm, fwd_req->orig_coi))) {
+ fprintf(stderr, "tr_tids_req_hander: IDP Realm (%s) not member of APC (%s).\n", orig_req->realm->buf, orig_req->comm->buf);
+ tids_send_err_response(tids, orig_req, "IDP COI membership error");
+ return -1;
+ }
+ if (NULL == (tr_find_comm_idp(cfg_apc, fwd_req->comm))) {
+ fprintf(stderr, "tr_tids_req_hander: IDP Realm (%s) not member of APC (%s).\n", orig_req->realm->buf, orig_req->comm->buf);
+ tids_send_err_response(tids, orig_req, "IDP APC membership error");
+ return -1;
+ }
}
/* send a TID request to the AAA server(s), and get the answer(s) */
{
TR_INSTANCE *tr = NULL;
struct dirent **cfg_files = NULL;
- json_t *jcfg = NULL;
TR_CFG_RC rc = TR_CFG_SUCCESS; /* presume success */
int err = 0, n = 0;;
exit(1);
}
- if (TR_CFG_SUCCESS != tr_parse_config(tr, cfg_files)) {
+ if (TR_CFG_SUCCESS != tr_parse_config(tr, n, cfg_files)) {
fprintf (stderr, "Error decoding configuration information, exiting.\n");
exit(1);
}