From 5ea84e17c03dc86222fbda5c60f2ff00152b8017 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 1 Sep 2014 00:12:47 +0200 Subject: player: don't allow remote playlists to load local files Because that might be a bad idea. Note that remote playlists still can use any protocol marked with is_safe and is_network, because the case of http-hosted playlists containing URLs using other streaming protocols is not unusual. --- stream/stream.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'stream/stream.h') diff --git a/stream/stream.h b/stream/stream.h index 94103962c9..20c2e03e6a 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -56,6 +56,7 @@ enum streamtype { // flags for stream_open_ext (this includes STREAM_READ and STREAM_WRITE) #define STREAM_NO_FILTERS 2 #define STREAM_SAFE_ONLY 4 +#define STREAM_NETWORK_ONLY 8 #define STREAM_UNSAFE -3 #define STREAM_NO_MATCH -2 @@ -142,8 +143,9 @@ typedef struct stream_info_st { const struct m_option *options; const char *const *url_options; bool stream_filter; - bool can_write; - bool is_safe; + bool can_write; // correctly checks for READ/WRITE modes + bool is_safe; // opening is no security issue, even with remote provided URLs + bool is_network; // used to restrict remote playlist entries to remote URLs } stream_info_t; typedef struct stream { @@ -181,6 +183,7 @@ typedef struct stream { bool seekable : 1; // presence of general byte seeking support bool fast_skip : 1; // consider stream fast enough to fw-seek by skipping bool safe_origin : 1; // used for playlists that can be opened safely + bool is_network : 1; // original stream_info_t.is_network flag bool allow_caching : 1; // stream cache makes sense struct mp_log *log; struct MPOpts *opts; -- cgit v1.2.3