From: Sven Wegener Date: Mon, 9 Nov 2015 21:58:38 +0000 (+0100) Subject: http: drop ticket param from http_access_verify_channel() X-Git-Tag: v4.2.1~1545 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb9044c9cb295b22cead0e976ab27c0b81068acc;p=thirdparty%2Ftvheadend.git http: drop ticket param from http_access_verify_channel() With 85e1bbb we now accept ticket or credentials, so we don't need to hint whether tickets should be honored or not. If there is a ticket and it satisfies our security check, accept it. Signed-off-by: Sven Wegener --- diff --git a/src/http.c b/src/http.c index f17e7edab..d6d9c6a07 100644 --- a/src/http.c +++ b/src/http.c @@ -567,15 +567,13 @@ http_access_verify(http_connection_t *hc, int mask) */ int http_access_verify_channel(http_connection_t *hc, int mask, - struct channel *ch, int ticket) + struct channel *ch) { int res = -1; assert(ch); - if (ticket) - http_access_verify_ticket(hc); - + http_access_verify_ticket(hc); if (hc->hc_access) { res = access_verify2(hc->hc_access, mask); diff --git a/src/http.h b/src/http.h index 57b63f381..e66263e2c 100644 --- a/src/http.h +++ b/src/http.h @@ -237,7 +237,7 @@ void http_server_done(void); int http_access_verify(http_connection_t *hc, int mask); int http_access_verify_channel(http_connection_t *hc, int mask, - struct channel *ch, int ticket); + struct channel *ch); void http_deescape(char *s); diff --git a/src/webui/webui.c b/src/webui/webui.c index f7f7a82e1..43679bea2 100644 --- a/src/webui/webui.c +++ b/src/webui/webui.c @@ -543,7 +543,7 @@ http_channel_playlist(http_connection_t *hc, int pltype, channel_t *channel) char *profile, *hostpath; const char *name; - if (http_access_verify_channel(hc, ACCESS_STREAMING, channel, 1)) + if (http_access_verify_channel(hc, ACCESS_STREAMING, channel)) return HTTP_STATUS_UNAUTHORIZED; profile = profile_validate_name(http_arg_get(&hc->hc_req_args, "profile")); @@ -626,7 +626,7 @@ http_tag_playlist(http_connection_t *hc, int pltype, channel_tag_t *tag) htsbuf_qprintf(hq, "#NAME %s\n", tag->ct_name); for (idx = 0; idx < count; idx++) { ch = chlist[idx]; - if (http_access_verify_channel(hc, ACCESS_STREAMING, ch, 0)) + if (http_access_verify_channel(hc, ACCESS_STREAMING, ch)) continue; snprintf(buf, sizeof(buf), "/stream/channelid/%d", channel_get_id(ch)); name = channel_get_name(ch); @@ -788,7 +788,7 @@ http_channel_list_playlist(http_connection_t *hc, int pltype) for (idx = 0; idx < count; idx++) { ch = chlist[idx]; - if (http_access_verify_channel(hc, ACCESS_STREAMING, ch, 0)) + if (http_access_verify_channel(hc, ACCESS_STREAMING, ch)) continue; name = channel_get_name(ch); @@ -842,7 +842,7 @@ http_dvr_list_playlist(http_connection_t *hc, int pltype) continue; if (de->de_channel && - http_access_verify_channel(hc, ACCESS_RECORDER, de->de_channel, 0)) + http_access_verify_channel(hc, ACCESS_RECORDER, de->de_channel)) continue; durration = dvr_entry_get_stop_time(de) - dvr_entry_get_start_time(de); @@ -1194,7 +1194,7 @@ http_stream_channel(http_connection_t *hc, channel_t *ch, int weight) void *tcp_id; int res = HTTP_STATUS_SERVICE; - if (http_access_verify_channel(hc, ACCESS_STREAMING, ch, 1)) + if (http_access_verify_channel(hc, ACCESS_STREAMING, ch)) return HTTP_STATUS_UNAUTHORIZED; if(!(pro = profile_find_by_list(hc->hc_access->aa_profiles, diff --git a/src/webui/xmltv.c b/src/webui/xmltv.c index 7d172aaed..0be4028ed 100644 --- a/src/webui/xmltv.c +++ b/src/webui/xmltv.c @@ -122,7 +122,7 @@ http_xmltv_channel(http_connection_t *hc, channel_t *channel) { char *hostpath; - if (http_access_verify_channel(hc, ACCESS_STREAMING, channel, 1)) + if (http_access_verify_channel(hc, ACCESS_STREAMING, channel)) return HTTP_STATUS_UNAUTHORIZED; hostpath = http_get_hostpath(hc); @@ -154,13 +154,13 @@ http_xmltv_tag(http_connection_t *hc, channel_tag_t *tag) http_xmltv_begin(&hc->hc_reply); LIST_FOREACH(ilm, &tag->ct_ctms, ilm_in1_link) { ch = (channel_t *)ilm->ilm_in2; - if (http_access_verify_channel(hc, ACCESS_STREAMING, ch, 0)) + if (http_access_verify_channel(hc, ACCESS_STREAMING, ch)) continue; http_xmltv_channel_add(&hc->hc_reply, hostpath, ch); } LIST_FOREACH(ilm, &tag->ct_ctms, ilm_in1_link) { ch = (channel_t *)ilm->ilm_in2; - if (http_access_verify_channel(hc, ACCESS_STREAMING, ch, 0)) + if (http_access_verify_channel(hc, ACCESS_STREAMING, ch)) continue; http_xmltv_programme_add(&hc->hc_reply, hostpath, ch); } @@ -187,12 +187,12 @@ http_xmltv_channel_list(http_connection_t *hc) http_xmltv_begin(&hc->hc_reply); CHANNEL_FOREACH(ch) { - if (http_access_verify_channel(hc, ACCESS_STREAMING, ch, 0)) + if (http_access_verify_channel(hc, ACCESS_STREAMING, ch)) continue; http_xmltv_channel_add(&hc->hc_reply, hostpath, ch); } CHANNEL_FOREACH(ch) { - if (http_access_verify_channel(hc, ACCESS_STREAMING, ch, 0)) + if (http_access_verify_channel(hc, ACCESS_STREAMING, ch)) continue; http_xmltv_programme_add(&hc->hc_reply, hostpath, ch); }