Changeset 658b4f830b832b19a6de708764f91e1398e501a1
- Timestamp:
- 01/16/08 20:30:12 (8 months ago)
- git-parent:
- Files:
-
- include/vlc_configuration.h (modified) (3 diffs)
- modules/access_filter/record.c (modified) (1 diff)
- modules/access_filter/timeshift.c (modified) (1 diff)
- modules/audio_output/file.c (modified) (1 diff)
- modules/demux/demuxdump.c (modified) (1 diff)
- modules/demux/ts.c (modified) (1 diff)
- modules/misc/logger.c (modified) (1 diff)
- modules/stream_out/es.c (modified) (1 diff)
- modules/stream_out/rtp.c (modified) (1 diff)
- modules/stream_out/standard.c (modified) (1 diff)
- src/config/chain.c (modified) (2 diffs)
- src/libvlc-module.c (modified) (3 diffs)
- src/misc/variables.c (modified) (2 diffs)
- src/modules/entry.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
include/vlc_configuration.h
r4f02842 r658b4f8 192 192 vlc_bool_t b_unsaveable; /* Config should be saved */ 193 193 194 vlc_bool_t b_ safe;194 vlc_bool_t b_unsafe; 195 195 }; 196 196 … … 283 283 /* former option name (args=const char *) */ 284 284 285 VLC_CONFIG_ SAFE,285 VLC_CONFIG_UNSAFE, 286 286 /* tag as modifiable by untrusted input item "sources" (args=none) */ 287 287 }; … … 473 473 vlc_config_set (p_config, VLC_CONFIG_VOLATILE) 474 474 475 #define change_ safe() \476 vlc_config_set (p_config, VLC_CONFIG_ SAFE)475 #define change_unsafe() \ 476 vlc_config_set (p_config, VLC_CONFIG_UNSAFE) 477 477 478 478 /**************************************************************************** modules/access_filter/record.c
r4f02842 r658b4f8 58 58 add_directory( "record-path", NULL, NULL, 59 59 RECORD_PATH_TXT, RECORD_PATH_LONGTXT, VLC_TRUE ); 60 change_unsafe(); 60 61 61 62 set_callbacks( Open, Close ); modules/access_filter/timeshift.c
r4f02842 r658b4f8 66 66 GRANULARITY_LONGTEXT, VLC_TRUE ); 67 67 add_directory( "timeshift-dir", 0, 0, DIR_TEXT, DIR_LONGTEXT, VLC_FALSE ); 68 change_unsafe(); 68 69 add_bool( "timeshift-force", VLC_FALSE, NULL, FORCE_TEXT, FORCE_LONGTEXT, 69 70 VLC_FALSE ); modules/audio_output/file.c
r4f02842 r658b4f8 117 117 add_file( "audiofile-file", "audiofile.wav", NULL, FILE_TEXT, 118 118 FILE_LONGTEXT, VLC_FALSE ); 119 change_unsafe(); 119 120 add_bool( "audiofile-wav", 1, NULL, WAV_TEXT, WAV_LONGTEXT, VLC_TRUE ); 120 121 modules/demux/demuxdump.c
r4f02842 r658b4f8 52 52 add_file( "demuxdump-file", "stream-demux.dump", NULL, FILE_TEXT, 53 53 FILE_LONGTEXT, VLC_FALSE ); 54 change_unsafe(); 54 55 add_bool( "demuxdump-append", 0, NULL, APPEND_TEXT, APPEND_LONGTEXT, 55 56 VLC_FALSE ); modules/demux/ts.c
r4f02842 r658b4f8 149 149 150 150 add_file( "ts-dump-file", NULL, NULL, TSDUMP_TEXT, TSDUMP_LONGTEXT, VLC_FALSE ); 151 change_unsafe(); 151 152 add_bool( "ts-dump-append", 0, NULL, APPEND_TEXT, APPEND_LONGTEXT, VLC_FALSE ); 152 153 add_integer( "ts-dump-size", 16384, NULL, DUMPSIZE_TEXT, modules/misc/logger.c
r5d7d4cf r658b4f8 136 136 add_file( "logfile", NULL, NULL, 137 137 N_("Log filename"), N_("Specify the log filename."), VLC_FALSE ); 138 change_unsafe(); 138 139 add_string( "logmode", "text", NULL, LOGMODE_TEXT, LOGMODE_LONGTEXT, 139 140 VLC_FALSE ); modules/stream_out/es.c
r6ee1e19 r658b4f8 94 94 add_string( SOUT_CFG_PREFIX "dst", "", NULL, DEST_TEXT, 95 95 DEST_LONGTEXT, VLC_TRUE ); 96 change_unsafe(); 96 97 add_string( SOUT_CFG_PREFIX "dst-audio", "", NULL, DESTA_TEXT, 97 98 DESTA_LONGTEXT, VLC_TRUE ); 99 change_unsafe(); 98 100 add_string( SOUT_CFG_PREFIX "dst-video", "", NULL, DESTV_TEXT, 99 101 DESTV_LONGTEXT, VLC_TRUE ); 102 change_unsafe(); 100 103 101 104 set_callbacks( Open, Close ); modules/stream_out/rtp.c
r14fae49 r658b4f8 148 148 add_string( SOUT_CFG_PREFIX "dst", "", NULL, DST_TEXT, 149 149 DST_LONGTEXT, VLC_TRUE ); 150 change_unsafe(); 150 151 add_string( SOUT_CFG_PREFIX "sdp", "", NULL, SDP_TEXT, 151 152 SDP_LONGTEXT, VLC_TRUE ); modules/stream_out/standard.c
r17d26df r658b4f8 96 96 add_string( SOUT_CFG_PREFIX "dst", "", NULL, DST_TEXT, 97 97 DST_LONGTEXT, VLC_FALSE ); 98 change_unsafe(); 98 99 99 100 add_bool( SOUT_CFG_PREFIX "sap", VLC_FALSE, NULL, SAP_TEXT, SAP_LONGTEXT, src/config/chain.c
r3655c1c r658b4f8 31 31 #include "libvlc.h" 32 32 33 #include "vlc_interface.h" 34 33 35 /***************************************************************************** 34 36 * Local prototypes … … 315 317 name, psz_name ); 316 318 } 319 if( p_conf->b_unsafe ) 320 { 321 int policy = config_GetInt( p_this, "security-policy" ); 322 switch( policy ) 323 { 324 case 0: /* block */ 325 msg_Err( p_this, "option %s is unsafe and is blocked by security policy", psz_name ); 326 return; 327 case 1: /* allow */ 328 break; 329 case 2: /* prompt */ 330 { 331 char description[256]; 332 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); 333 if( DIALOG_OK_YES != intf_UserYesNo( p_this, _("WARNING: Unsafe Playlist"), description, _("Yes"), _("No"), NULL) ) 334 { 335 msg_Err( p_this, "option %s is unsafe and is blocked by security policy", psz_name ); 336 return; 337 } 338 } 339 default: 340 ; 341 } 342 } 317 343 } 318 344 /* </Check if the option is deprecated> */ src/libvlc-module.c
r4f02842 r658b4f8 977 977 #define MINIMIZE_THREADS_LONGTEXT N_( \ 978 978 "This option minimizes the number of threads needed to run VLC.") 979 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") }; 979 987 980 988 #define PLUGIN_PATH_TEXT N_("Modules search path") … … 1482 1490 add_directory( "snapshot-path", NULL, NULL, SNAP_PATH_TEXT, 1483 1491 SNAP_PATH_LONGTEXT, VLC_FALSE ); 1492 change_unsafe(); 1484 1493 add_string( "snapshot-prefix", "vlcsnap-", NULL, SNAP_PREFIX_TEXT, 1485 1494 SNAP_PREFIX_LONGTEXT, VLC_FALSE ); … … 1787 1796 PLUGIN_PATH_LONGTEXT, VLC_TRUE ); 1788 1797 change_need_restart(); 1798 change_unsafe(); 1789 1799 1790 1800 set_section( N_("Performance options"), NULL ); 1791 1801 add_bool( "minimize-threads", 0, NULL, MINIMIZE_THREADS_TEXT, 1792 1802 MINIMIZE_THREADS_LONGTEXT, VLC_TRUE ); 1803 change_need_restart(); 1804 1805 set_section( N_("Security options"), NULL ); 1806 add_integer( "security-policy", 2, NULL, SECURITY_POLICY_TEXT, 1807 SECURITY_POLICY_LONGTEXT, VLC_TRUE ); 1808 change_integer_list( pi_secpolicy_values, ppsz_secpolicy_descriptions, 0 ); 1809 change_unsafe(); 1793 1810 change_need_restart(); 1794 1811 src/misc/variables.c
re387114 r658b4f8 30 30 #include "libvlc.h" 31 31 32 #include "vlc_interface.h" 33 32 34 /***************************************************************************** 33 35 * Private types … … 1091 1093 ( !psz_value || !*psz_value ) ) goto cleanup; /* Invalid value */ 1092 1094 1095 /* check if option is unsafe */ 1096 { 1097 module_config_t *p_config = config_FindConfig( p_obj, psz_name ); 1098 if( p_config->b_unsafe ) 1099 { 1100 int policy = config_GetInt( p_obj, "security-policy" ); 1101 switch( policy ) 1102 { 1103 case 0: /* block */ 1104 msg_Err( p_obj, "option %s is unsafe and is blocked by security policy", psz_name ); 1105 return; 1106 case 1: /* allow */ 1107 break; 1108 case 2: /* prompt */ 1109 { 1110 char description[256]; 1111 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); 1112 if( DIALOG_OK_YES != intf_UserYesNo( p_obj, _("WARNING: Unsafe Playlist"), description, _("Yes"), _("No"), NULL) ) 1113 { 1114 msg_Err( p_obj, "option %s is unsafe and is blocked by security policy", psz_name ); 1115 return; 1116 } 1117 } 1118 default: 1119 ; 1120 } 1121 } 1122 } 1123 1093 1124 /* Create the variable in the input object. 1094 1125 * Children of the input object will be able to retreive this value src/modules/entry.c
r3ddbf4b r658b4f8 408 408 } 409 409 410 case VLC_CONFIG_ SAFE:411 item->b_ safe = VLC_TRUE;410 case VLC_CONFIG_UNSAFE: 411 item->b_unsafe = VLC_TRUE; 412 412 ret = 0; 413 413 break;
