diff options
author | wm4 <wm4@nowhere> | 2014-09-01 00:12:47 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-01 00:13:22 +0200 |
commit | 5ea84e17c03dc86222fbda5c60f2ff00152b8017 (patch) | |
tree | 61f15cc5aa0a22bb6177a4df3530cf53be97529a /stream/stream.h | |
parent | 129a7c056a524b33cc4c87c67d7919f8d5894ca3 (diff) | |
download | mpv-5ea84e17c03dc86222fbda5c60f2ff00152b8017.tar.bz2 mpv-5ea84e17c03dc86222fbda5c60f2ff00152b8017.tar.xz |
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.
Diffstat (limited to 'stream/stream.h')
-rw-r--r-- | stream/stream.h | 7 |
1 files changed, 5 insertions, 2 deletions
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; |