From: Sam Hartman Date: Tue, 7 Oct 2014 09:57:51 +0000 (-0400) Subject: tr_req_handler: Handle non-defaulted case X-Git-Tag: 1.4.1~3 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=commitdiff_plain;h=c5911ddf38128cf7e2b5eeac5432bf667f4185d1 tr_req_handler: Handle non-defaulted case In 1.4, we broke forwarding requests that were not defaulted. We looked up the community as a member of the community rather than the realm. Fix this logic error. Also, update error messages to be more accurate and to fibx a spelling error. --- diff --git a/tr/tr_main.c b/tr/tr_main.c index 659f899..8777354 100644 --- a/tr/tr_main.c +++ b/tr/tr_main.c @@ -168,13 +168,13 @@ static int tr_tids_req_handler (TIDS_INSTANCE *tids, } } 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"); + if (NULL == (tr_find_comm_idp(cfg_comm, fwd_req->realm))) { + fprintf(stderr, "tr_tids_req_handler: IDP Realm (%s) not member of community (%s).\n", orig_req->realm->buf, orig_req->comm->buf); + tids_send_err_response(tids, orig_req, "IDP community 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); + if ( cfg_apc && (NULL == (tr_find_comm_idp(cfg_apc, fwd_req->realm)))) { + fprintf(stderr, "tr_tids_req_handler: 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; }