Commit 89f2f2f1 authored by Antoine Cellerier's avatar Antoine Cellerier

Re-enable EXTVLCOPT: parsing in m3u playlists. You'll need to append the...

Re-enable EXTVLCOPT: parsing in m3u playlists. You'll need to append the --m3u-extvlcopt option to you command line if you want it.
parent 91694c93
...@@ -109,6 +109,7 @@ static int Demux( demux_t *p_demux ) ...@@ -109,6 +109,7 @@ static int Demux( demux_t *p_demux )
const char**ppsz_options = NULL; const char**ppsz_options = NULL;
int i_options = 0; int i_options = 0;
vlc_bool_t b_cleanup = VLC_FALSE; vlc_bool_t b_cleanup = VLC_FALSE;
vlc_bool_t b_enable_extvlcopt = config_GetInt( p_demux, "m3u-extvlcopt" );
input_item_t *p_input; input_item_t *p_input;
INIT_PLAYLIST_STUFF; INIT_PLAYLIST_STUFF;
...@@ -145,27 +146,26 @@ static int Demux( demux_t *p_demux ) ...@@ -145,27 +146,26 @@ static int Demux( demux_t *p_demux )
if( psz_artist ) if( psz_artist )
psz_artist = strdup( psz_artist ); psz_artist = strdup( psz_artist );
} }
#if 0
/* You're going to need a pretty strong explanation, why
* this is not a big security hole if you are to uncomment
* this piece of code. Potentially untrusted input file must
* not be allowed to specify options in an open-handed fashion.
* -- Courmisch
*/
else if( !strncasecmp( psz_parse, "EXTVLCOPT:", else if( !strncasecmp( psz_parse, "EXTVLCOPT:",
sizeof("EXTVLCOPT:") -1 ) ) sizeof("EXTVLCOPT:") -1 ) )
{ {
/* VLC Option */ if( b_enable_extvlcopt )
char *psz_option; {
psz_parse += sizeof("EXTVLCOPT:") -1; /* VLC Option */
if( !*psz_parse ) goto error; char *psz_option;
psz_parse += sizeof("EXTVLCOPT:") -1;
psz_option = MaybeFromLocaleDup( psz_parse ); if( !*psz_parse ) goto error;
if( psz_option )
INSERT_ELEM( ppsz_options, i_options, i_options, psz_option = MaybeFromLocaleDup( psz_parse );
psz_option ); if( psz_option )
INSERT_ELEM( ppsz_options, i_options, i_options,
psz_option );
}
else
{
msg_Err( p_demux, "m3u EXTVLCOPT parsing is disabled for security reasons. If you need it and trust the m3u playlist you are trying to open, please append --m3u-extvlcopt to you command line." );
}
} }
#endif
} }
else if( !strncasecmp( psz_parse, "RTSPtext", sizeof("RTSPtext") -1 ) ) else if( !strncasecmp( psz_parse, "RTSPtext", sizeof("RTSPtext") -1 ) )
{ {
......
...@@ -45,6 +45,11 @@ ...@@ -45,6 +45,11 @@
#define SKIP_ADS_LONGTEXT N_( "Use playlist options usually used to prevent " \ #define SKIP_ADS_LONGTEXT N_( "Use playlist options usually used to prevent " \
"ads skipping to detect ads and prevent adding them to the playlist." ) "ads skipping to detect ads and prevent adding them to the playlist." )
#define EXTVLCOPT_TEXT N_( "Enable parsing of EXTVLCOPT: options" )
#define EXTVLCOPT_LONGTEXT N_( "Enable parsing of EXTVLCOPT: options in m3u " \
"playlists. This option is default disabled to prevent untrusted sources " \
"using VLC options without the user's knowledge." )
vlc_module_begin(); vlc_module_begin();
add_shortcut( "playlist" ); add_shortcut( "playlist" );
set_category( CAT_INPUT ); set_category( CAT_INPUT );
...@@ -65,6 +70,9 @@ vlc_module_begin(); ...@@ -65,6 +70,9 @@ vlc_module_begin();
set_description( _("M3U playlist import") ); set_description( _("M3U playlist import") );
add_shortcut( "m3u-open" ); add_shortcut( "m3u-open" );
set_capability( "demux2", 10 ); set_capability( "demux2", 10 );
add_bool( "m3u-extvlcopt", VLC_FALSE, NULL,
EXTVLCOPT_TEXT, EXTVLCOPT_LONGTEXT, VLC_FALSE );
change_unsaveable();
set_callbacks( E_(Import_M3U), E_(Close_M3U) ); set_callbacks( E_(Import_M3U), E_(Close_M3U) );
add_submodule(); add_submodule();
set_description( _("PLS playlist import") ); set_description( _("PLS playlist import") );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment