if ((!str) || (!wc_str))
return 0;
- fprintf(stderr, "tr_prefix_wildcard_match: str = %s, wc_str = %s\n", str, wc_str);
+ len = strlen(str);
+ if (0 == (wc_len = strlen(wc_str)))
+ return 0;
/* TBD -- skip leading white space? */
- if ('*' == wc_str[0])
+ if ('*' == wc_str[0]) {
wc_post = &(wc_str[1]);
+ wc_len--;
+ }
- len = strlen(str);
- wc_len = strlen(wc_post);
-
- if (!strcmp(&(str[len-wc_len]), wc_post)) {
+ if (wc_len > len)
+ return 0;
+
+ if (0 == strcmp(&(str[len-wc_len]), wc_post)) {
return 1;
}
else
return -1;
}
- if (!tr_prefix_wildcard_match(((TR_INSTANCE *)tr)->rp_gss->rp_match->buf,
- orig_req->rp_realm->buf)) {
+ if (!tr_prefix_wildcard_match(orig_req->rp_realm->buf, ((TR_INSTANCE *)tr)->rp_gss->rp_match->buf)) {
fprintf(stderr, "tr_tids_req_handler: RP realm (%s) does not match RP Realm filter for GSS name (%s)\n", orig_req->rp_realm->buf, ((TR_INSTANCE *)tr)->rp_gss->rp_match->buf);
tids_send_err_response(tids, orig_req, "RP Realm filter error");
return -1;
/* look up the RP client matching the GSS name */
if ((NULL == (rp = tr_rp_client_lookup(tr, gss_name)))) {
- fprintf(stderr, "tr_tids_gss_handler: Unknown GSS name %s", gss_name->buf);
+ fprintf(stderr, "tr_tids_gss_handler: Unknown GSS name %s\n", gss_name->buf);
return -1;
}