Changeset 6ee1e74f7983b2d929f6511b35ef6ca72fbea1f4

Show
Ignore:
Timestamp:
18/03/08 20:12:00 (7 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1205867520 +0200
git-parent:

[794a69356e450a617a4adde3775cfa50ae643a20]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1205867520 +0200
Message:

Remove the short-lived security-policy parameter.

In by far the overwhelming majority of cases, the user would not know
how to determine the correct answer to the security prompt (did you
ever compare SSL error handling in IE6 and IE7?). Since the trust value
is now determined programatically, this would seem to mostly help users
shoot themselves in the foot.

--security-policy is also broken when using --playlist-enqueue: imagine
you are running VLC with no security, and then your browser enqueues an
M3U from some nasty webserver... fireworks.

Wrappers around VLC really should NOT use M3U files if they need to
tweak certain options (e.g. --sout). Global options can simply be set
the normal way from the command line (e.g.: vlc --sout '#std{...}').
Per-item options can be set using the colon notation. Multiple items
should be expanded on the command line in the right order, rather than
written to a M3U file. Alternative, IPC interfaces could be used
(single instance + playlist enqueue, RC interface, DBus interface...)
or language bindings.

*** Important note ***
Web browser plugins are still in need of fixing. I suppose
libvlc-control should be extented to support playlist item trust.

Feel free to revert and do something else if you have a _better_ idea.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/libvlc-module.c

    rc1bf65a r6ee1e74  
    978978     "This option minimizes the number of threads needed to run VLC.") 
    979979 
    980 #define SECURITY_POLICY_TEXT N_("Policy for handling unsafe options.") 
    981 #define SECURITY_POLICY_LONGTEXT N_( \ 
    982      "This option dictates the default policy when processing options " \ 
    983      "which may be harmful when used in a malicious way.") 
    984  
    985 static int pi_secpolicy_values[] = { 0, 1, 2 }; 
    986 static const char *ppsz_secpolicy_descriptions[] = { N_("Block"), N_("Allow"), N_("Prompt") }; 
    987  
    988980#define PLUGIN_PATH_TEXT N_("Modules search path") 
    989981#define PLUGIN_PATH_LONGTEXT N_( \ 
     
    18081800    add_bool( "minimize-threads", 0, NULL, MINIMIZE_THREADS_TEXT, 
    18091801              MINIMIZE_THREADS_LONGTEXT, VLC_TRUE ); 
    1810         change_need_restart(); 
    1811  
    1812     set_section( N_("Security options"), NULL ); 
    1813     add_integer( "security-policy", 2, NULL, SECURITY_POLICY_TEXT, 
    1814               SECURITY_POLICY_LONGTEXT, VLC_TRUE ); 
    1815         change_integer_list( pi_secpolicy_values, ppsz_secpolicy_descriptions, 0 ); 
    1816         change_unsafe(); 
    18171802        change_need_restart(); 
    18181803 
  • src/misc/variables.c

    r709f415 r6ee1e74  
    10991099        if( !p_config->b_safe ) 
    11001100        { 
    1101             int policy = config_GetInt( p_obj, "security-policy" ); 
    1102             switch( policy ) 
    1103             { 
    1104                 case 0: /* block */ 
    1105                     msg_Err( p_obj, "option %s is unsafe and is blocked by security policy", psz_name ); 
    1106                     return; 
    1107                 case 1: /* allow */ 
    1108                     break; 
    1109                 case 2: /* prompt */ 
    1110                 { 
    1111                     char description[256]; 
    1112                     snprintf(description, sizeof(description), _("playlist item is making use of the following unsafe option '%s', which may be harmful if used in a malicious way, authorize it ?"), psz_name); 
    1113                     if( DIALOG_OK_YES != intf_UserYesNo( p_obj, _("WARNING: Unsafe Playlist"), description, _("Yes"), _("No"), NULL) ) 
    1114                     { 
    1115                         msg_Err( p_obj, "option %s is unsafe and is blocked by security policy", psz_name ); 
    1116                         goto cleanup; 
    1117                     } 
    1118                 } 
    1119                 default: 
    1120                     ; 
    1121             } 
     1101            msg_Err( p_obj, "unsafe option \"%s\" has been ignored for " 
     1102                            "security reasons", psz_name ); 
     1103            return; 
    11221104        } 
    11231105    }