[vlc-devel] [RFC] Option whitelisting policy
Laurent Aimar
fenrir at via.ecp.fr
Mon Sep 22 23:52:35 CEST 2008
Hi,
As a general remark, I would *really* prefer that we activate options that are
effectively requested and *only after* a review of their implementations.
Even if the option should be safe, we will have bugs in it. By whitelisting
a lot of options we are simply adding a lot of potential security at once.
Quick Review:
On Mon, Sep 22, 2008, Antoine Cellerier wrote:
> diff --git a/modules/access/bda/bda.c b/modules/access/bda/bda.c
> index 8773162..94f7cc3 100644
> --- a/modules/access/bda/bda.c
> +++ b/modules/access/bda/bda.c
> @@ -176,80 +176,108 @@ vlc_module_begin();
>
> add_integer( "dvb-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT,
> CACHING_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-frequency", 11954000, NULL, FREQ_TEXT, FREQ_LONGTEXT,
> false );
> + change_safe();
> # if defined(WIN32) || defined(WINCE)
> # else
> add_integer( "dvb-adapter", 0, NULL, ADAPTER_TEXT, ADAPTER_LONGTEXT,
> false );
> + change_safe();
> add_integer( "dvb-device", 0, NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
> true );
> + change_safe();
> add_bool( "dvb-probe", 1, NULL, PROBE_TEXT, PROBE_LONGTEXT, true );
> + change_safe();
> add_bool( "dvb-budget-mode", 0, NULL, BUDGET_TEXT, BUDGET_LONGTEXT,
> true );
> + change_safe();
> # endif
>
> /* DVB-S (satellite) */
> add_integer( "dvb-inversion", 2, NULL, INVERSION_TEXT,
> INVERSION_LONGTEXT, true );
> change_integer_list( i_inversion_list, ppsz_inversion_text, NULL );
> + change_safe();
> # if defined(WIN32) || defined(WINCE)
> add_string( "dvb-polarisation", NULL, NULL, POLARISATION_TEXT,
> POLARISATION_LONGTEXT, true );
> change_string_list( ppsz_polar_list, ppsz_polar_text, 0 );
> + change_safe();
> add_integer( "dvb-network-id", 0, NULL, NETID_TEXT, NETID_LONGTEXT,
> true );
> + change_safe();
> add_integer( "dvb-azimuth", 0, NULL, AZIMUTH_TEXT, AZIMUTH_LONGTEXT,
> true );
> + change_safe();
> add_integer( "dvb-elevation", 0, NULL, ELEVATION_TEXT,
> ELEVATION_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-longitude", 0, NULL, LONGITUDE_TEXT,
> LONGITUDE_LONGTEXT, true );
> /* Note: Polaristion H = voltage 18; V = voltage 13; */
> + change_safe();
> # else
> add_integer( "dvb-satno", 0, NULL, SATNO_TEXT, SATNO_LONGTEXT,
> true );
> + change_safe();
> add_integer( "dvb-voltage", 13, NULL, VOLTAGE_TEXT, VOLTAGE_LONGTEXT,
> true );
> + change_safe();
> add_bool( "dvb-high-voltage", 0, NULL, HIGH_VOLTAGE_TEXT,
> HIGH_VOLTAGE_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-tone", -1, NULL, TONE_TEXT, TONE_LONGTEXT,
> true );
> + change_safe();
> # endif
> add_integer( "dvb-lnb-lof1", 0, NULL, LNB_LOF1_TEXT,
> LNB_LOF1_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-lnb-lof2", 0, NULL, LNB_LOF2_TEXT,
> LNB_LOF2_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-lnb-slof", 0, NULL, LNB_SLOF_TEXT,
> LNB_SLOF_LONGTEXT, true );
> + change_safe();
>
> add_integer( "dvb-fec", 9, NULL, FEC_TEXT, FEC_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-srate", 27500000, NULL, SRATE_TEXT, SRATE_LONGTEXT,
> false );
> + change_safe();
>
> /* DVB-C (cable) */
> add_integer( "dvb-modulation", -1, NULL, MODULATION_TEXT,
> MODULATION_LONGTEXT, true );
> change_integer_list( i_qam_list, ppsz_qam_text, NULL );
> + change_safe();
>
> /* DVB-T (terrestrial) */
> add_integer( "dvb-code-rate-hp", -1, NULL, CODE_RATE_HP_TEXT,
> CODE_RATE_HP_LONGTEXT, true );
> change_integer_list( i_hp_fec_list, ppsz_hp_fec_text, NULL );
> + change_safe();
> add_integer( "dvb-code-rate-lp", -1, NULL, CODE_RATE_LP_TEXT,
> CODE_RATE_LP_LONGTEXT, true );
> change_integer_list( i_lp_fec_list, ppsz_lp_fec_text, NULL );
> + change_safe();
> add_integer( "dvb-bandwidth", 0, NULL, BANDWIDTH_TEXT, BANDWIDTH_LONGTEXT,
> true );
> change_integer_list( i_band_list, ppsz_band_text, NULL );
> + change_safe();
> add_integer( "dvb-guard", -1, NULL, GUARD_TEXT, GUARD_LONGTEXT, true );
> change_integer_list( i_guard_list, ppsz_guard_text, NULL );
> + change_safe();
> add_integer( "dvb-transmission", -1, NULL, TRANSMISSION_TEXT,
> TRANSMISSION_LONGTEXT, true );
> change_integer_list( i_transmission_list, ppsz_transmission_text, NULL );
> + change_safe();
> add_integer( "dvb-hierarchy", -1, NULL, HIERARCHY_TEXT, HIERARCHY_LONGTEXT,
> true );
> change_integer_list( i_hierarchy_list, ppsz_hierarchy_text, NULL );
> + change_safe();
> set_capability( "access", 0 );
> add_shortcut( "dvb" ); /* Generic name */
Useless, they can be set through the URL.
(example dvb://guard=xx)
> diff --git a/modules/access/cdda/cdda.c b/modules/access/cdda/cdda.c
> index 9bbcc29..b1f1bc3 100644
> --- a/modules/access/cdda/cdda.c
> +++ b/modules/access/cdda/cdda.c
> #ifdef HAVE_LIBCDDB
> @@ -177,27 +183,32 @@ vlc_module_begin();
> "Track %T. %t - %p %A", NULL,
> N_("Format to use in playlist \"title\" field when using CDDB"),
> CDDB_TITLE_FMT_LONGTEXT, true );
> + change_safe();
It should be safe, BUT I am not sure the implementation is.
> add_bool( MODULE_STRING "-cddb-enabled", true, CDDBEnabledCB,
> N_("CDDB lookups"),
> N_("If set, lookup CD-DA track information using the CDDB "
> "protocol"),
> false );
> + change_safe();
No, it allows accessing an external server.
> add_string( MODULE_STRING "-cddb-server", "freedb.freedb.org", NULL,
> N_("CDDB server"),
> N_( "Contact this CDDB server look up CD-DA information"),
> true );
> + change_safe();
>
> add_integer( MODULE_STRING "-cddb-port", 8880, NULL,
> N_("CDDB server port"),
> N_("CDDB server uses this port number to communicate on"),
> true );
> + change_safe();
>
> add_string( MODULE_STRING "-cddb-email", "me at home", NULL,
> N_("email address reported to CDDB server"),
> N_("email address reported to CDDB server"),
> true );
> + change_safe();
Same...
> add_bool( MODULE_STRING "-cddb-enable-cache", true, NULL,
> N_("Cache CDDB lookups?"),
> @@ -209,12 +220,14 @@ vlc_module_begin();
> N_("If set, the CDDB server gets information via the CDDB HTTP "
> "protocol"),
> true );
> + change_safe();
No it allows disk writes.
> add_integer( MODULE_STRING "-cddb-timeout", 10, NULL,
> N_("CDDB server timeout"),
> N_("Time (in seconds) to wait for a response from the "
> "CDDB server"),
> false );
> + change_safe();
Useless if no cbdb accessible.
>
> add_string( MODULE_STRING "-cddb-cachedir", "~/.cddbslave", NULL,
> N_("Directory to cache CDDB requests"),
> @@ -226,6 +239,7 @@ vlc_module_begin();
> N_("If set, CD-Text information will be preferred "
> "to CDDB information when both are available"),
> false );
> + change_safe();
Nope, I see the word directory ...
> diff --git a/modules/access/directory.c b/modules/access/directory.c
> index c625e1b..251f93e 100644
> --- a/modules/access/directory.c
> +++ b/modules/access/directory.c
> @@ -104,8 +104,10 @@ vlc_module_begin();
> add_string( "recursive", "expand" , NULL, RECURSIVE_TEXT,
> RECURSIVE_LONGTEXT, false );
> change_string_list( psz_recursive_list, psz_recursive_list_text, 0 );
> + change_safe();
I would prefer avoiding this one, it could lead to DOS.
> diff --git a/modules/access/dvb/access.c b/modules/access/dvb/access.c
> index a3e482a..58acb61 100644
> --- a/modules/access/dvb/access.c
> +++ b/modules/access/dvb/access.c
> @@ -196,50 +196,73 @@ vlc_module_begin();
>
> add_integer( "dvb-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT,
> CACHING_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-adapter", 0, NULL, ADAPTER_TEXT, ADAPTER_LONGTEXT,
> false );
> + change_safe();
> add_integer( "dvb-device", 0, NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
> true );
> + change_safe();
> add_integer( "dvb-frequency", 0, NULL, FREQ_TEXT, FREQ_LONGTEXT,
> false );
> + change_safe();
> add_integer( "dvb-inversion", 2, NULL, INVERSION_TEXT, INVERSION_LONGTEXT,
> true );
> + change_safe();
> add_bool( "dvb-probe", 1, NULL, PROBE_TEXT, PROBE_LONGTEXT, true );
> + change_safe();
> add_bool( "dvb-budget-mode", 0, NULL, BUDGET_TEXT, BUDGET_LONGTEXT,
> true );
> + change_safe();
> /* DVB-S (satellite) */
> add_integer( "dvb-satno", 0, NULL, SATNO_TEXT, SATNO_LONGTEXT,
> true );
> + change_safe();
> add_integer( "dvb-voltage", 13, NULL, VOLTAGE_TEXT, VOLTAGE_LONGTEXT,
> true );
> + change_safe();
> add_bool( "dvb-high-voltage", 0, NULL, HIGH_VOLTAGE_TEXT,
> HIGH_VOLTAGE_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-tone", -1, NULL, TONE_TEXT, TONE_LONGTEXT,
> true );
> + change_safe();
> add_integer( "dvb-fec", 9, NULL, FEC_TEXT, FEC_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-srate", 27500000, NULL, SRATE_TEXT, SRATE_LONGTEXT,
> false );
> + change_safe();
> add_integer( "dvb-lnb-lof1", 0, NULL, LNB_LOF1_TEXT,
> LNB_LOF1_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-lnb-lof2", 0, NULL, LNB_LOF2_TEXT,
> LNB_LOF2_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-lnb-slof", 0, NULL, LNB_SLOF_TEXT,
> LNB_SLOF_LONGTEXT, true );
> + change_safe();
> /* DVB-C (cable) */
> add_integer( "dvb-modulation", 0, NULL, MODULATION_TEXT,
> MODULATION_LONGTEXT, true );
> + change_safe();
> /* DVB-T (terrestrial) */
> add_integer( "dvb-code-rate-hp", 9, NULL, CODE_RATE_HP_TEXT,
> CODE_RATE_HP_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-code-rate-lp", 9, NULL, CODE_RATE_LP_TEXT,
> CODE_RATE_LP_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-bandwidth", 0, NULL, BANDWIDTH_TEXT, BANDWIDTH_LONGTEXT,
> true );
> + change_safe();
> add_integer( "dvb-guard", 0, NULL, GUARD_TEXT, GUARD_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-transmission", 0, NULL, TRANSMISSION_TEXT,
> TRANSMISSION_LONGTEXT, true );
> + change_safe();
> add_integer( "dvb-hierarchy", 0, NULL, HIERARCHY_TEXT, HIERARCHY_LONGTEXT,
> true );
> + change_safe();
Useless, they can be set by the URL (like bda).
> diff --git a/modules/access/ftp.c b/modules/access/ftp.c
> index 79cf667..52c183f 100644
> --- a/modules/access/ftp.c
> +++ b/modules/access/ftp.c
> @@ -76,12 +76,16 @@ vlc_module_begin();
> set_subcategory( SUBCAT_INPUT_ACCESS );
> add_integer( "ftp-caching", 2 * DEFAULT_PTS_DELAY / 1000, NULL,
> CACHING_TEXT, CACHING_LONGTEXT, true );
> + change_safe();
> add_string( "ftp-user", "anonymous", NULL, USER_TEXT, USER_LONGTEXT,
> false );
> + change_safe();
> add_string( "ftp-pwd", "anonymous at example.com", NULL, PASS_TEXT,
> PASS_LONGTEXT, false );
> + change_safe();
> add_string( "ftp-account", "anonymous", NULL, ACCOUNT_TEXT,
> ACCOUNT_LONGTEXT, false );
> + change_safe();
> add_shortcut( "ftp" );
> set_callbacks( InOpen, InClose );
They can be set by the URL (except caching).
> diff --git a/modules/access/http.c b/modules/access/http.c
> index 98d33b6..da0a59a 100644
> --- a/modules/access/http.c
> +++ b/modules/access/http.c
> @@ -104,16 +104,22 @@ vlc_module_begin();
>
> add_string( "http-proxy", NULL, NULL, PROXY_TEXT, PROXY_LONGTEXT,
> false );
> + change_safe();
> add_password( "http-proxy-pwd", NULL, NULL,
> PROXY_PASS_TEXT, PROXY_PASS_LONGTEXT, false );
> + change_safe();
Nope, unaccepted external server usage.
> add_integer( "http-caching", 4 * DEFAULT_PTS_DELAY / 1000, NULL,
> CACHING_TEXT, CACHING_LONGTEXT, true );
> + change_safe();
> add_string( "http-user-agent", COPYRIGHT_MESSAGE , NULL, AGENT_TEXT,
> AGENT_LONGTEXT, true );
> + change_safe();
I don't really like it but maybe...
> add_bool( "http-reconnect", 0, NULL, RECONNECT_TEXT,
> RECONNECT_LONGTEXT, true );
> + change_safe();
Nope, it may lead to DOS, no ?
> diff --git a/modules/access/mmap.c b/modules/access/mmap.c
> index e49c041..16d177f 100644
> --- a/modules/access/mmap.c
> +++ b/modules/access/mmap.c
> @@ -61,6 +61,7 @@ vlc_module_begin();
>
> add_bool ("file-mmap", true, NULL,
> FILE_MMAP_TEXT, FILE_MMAP_LONGTEXT, true);
> + change_safe();
Mmh, not sure. Wasn't there a security issue with file being truncated
and mmap ?
> diff --git a/modules/access/mms/mms.c b/modules/access/mms/mms.c
> index fca871e..a5e7515 100644
> --- a/modules/access/mms/mms.c
> +++ b/modules/access/mms/mms.c
> @@ -78,15 +78,20 @@ vlc_module_begin();
> add_string( "mmsh-proxy", NULL, NULL, PROXY_TEXT, PROXY_LONGTEXT,
> false );
> + change_safe();
Nope, unaccepted external server usage.
>
> add_shortcut( "mms" );
> add_shortcut( "mmsu" );
> diff --git a/modules/access/pvr.c b/modules/access/pvr.c
> index 1bd5447..bd9864d 100644
> --- a/modules/access/pvr.c
> +++ b/modules/access/pvr.c
> @@ -134,36 +134,52 @@ vlc_module_begin();
>
> add_integer( "pvr-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT,
> CACHING_LONGTEXT, true );
> + change_safe();
> add_string( "pvr-device", "/dev/video0", NULL, DEVICE_TEXT,
> DEVICE_LONGTEXT, false );
> + change_safe();
> add_string( "pvr-radio-device", "/dev/radio0", NULL, RADIO_DEVICE_TEXT,
> RADIO_DEVICE_LONGTEXT, false );
> + change_safe();
> add_integer( "pvr-norm", V4L2_STD_UNKNOWN , NULL, NORM_TEXT,
> NORM_LONGTEXT, false );
> - change_integer_list( i_norm_list, psz_norm_list_text, NULL );
> + change_integer_list( i_norm_list, psz_norm_list_text, NULL );
> + change_safe();
> add_integer( "pvr-width", -1, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, true );
> + change_safe();
> add_integer( "pvr-height", -1, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT,
> true );
> + change_safe();
> add_integer( "pvr-frequency", -1, NULL, FREQUENCY_TEXT, FREQUENCY_LONGTEXT,
> false );
> + change_safe();
> add_integer( "pvr-framerate", -1, NULL, FRAMERATE_TEXT, FRAMERATE_LONGTEXT,
> true );
> + change_safe();
> add_integer( "pvr-keyint", -1, NULL, KEYINT_TEXT, KEYINT_LONGTEXT,
> true );
> + change_safe();
> add_integer( "pvr-bframes", -1, NULL, FRAMERATE_TEXT, FRAMERATE_LONGTEXT,
> true );
> + change_safe();
> add_integer( "pvr-bitrate", -1, NULL, BITRATE_TEXT, BITRATE_LONGTEXT,
> false );
> + change_safe();
> add_integer( "pvr-bitrate-peak", -1, NULL, BITRATE_PEAK_TEXT,
> BITRATE_PEAK_LONGTEXT, true );
> + change_safe();
> add_integer( "pvr-bitrate-mode", -1, NULL, BITRATE_MODE_TEXT,
> BITRATE_MODE_LONGTEXT, true );
> change_integer_list( i_bitrates, psz_bitrates_list_text, NULL );
> + change_safe();
> add_integer( "pvr-audio-bitmask", -1, NULL, BITMASK_TEXT,
> BITMASK_LONGTEXT, true );
> + change_safe();
> add_integer( "pvr-audio-volume", -1, NULL, VOLUME_TEXT,
> VOLUME_LONGTEXT, true );
> + change_safe();
> add_integer( "pvr-channel", -1, NULL, CHAN_TEXT, CHAN_LONGTEXT, true );
> + change_safe();
Useless, can be set by the URL.
> diff --git a/modules/access/smb.c b/modules/access/smb.c
> index b5f518b..686dbbb 100644
> --- a/modules/access/smb.c
> +++ b/modules/access/smb.c
> @@ -83,12 +83,16 @@ vlc_module_begin();
> set_subcategory( SUBCAT_INPUT_ACCESS );
> add_integer( "smb-caching", 2 * DEFAULT_PTS_DELAY / 1000, NULL,
> CACHING_TEXT, CACHING_LONGTEXT, true );
> + change_safe();
> add_string( "smb-user", NULL, NULL, USER_TEXT, USER_LONGTEXT,
> false );
> + change_safe();
> add_string( "smb-pwd", NULL, NULL, PASS_TEXT,
> PASS_LONGTEXT, false );
> + change_safe();
> add_string( "smb-domain", NULL, NULL, DOMAIN_TEXT,
> DOMAIN_LONGTEXT, false );
> + change_safe();
Useless, can be set by the URL.
> diff --git a/modules/access/v4l.c b/modules/access/v4l.c
> index eaa73b0..fe81df1 100644
> --- a/modules/access/v4l.c
> +++ b/modules/access/v4l.c
> @@ -154,42 +154,63 @@ vlc_module_begin();
>
> add_integer( "v4l-caching", DEFAULT_PTS_DELAY / 1000, NULL,
> CACHING_TEXT, CACHING_LONGTEXT, true );
> + change_safe();
> add_string( "v4l-vdev", "/dev/video", 0, VDEV_TEXT, VDEV_LONGTEXT,
> false );
> + change_safe();
> add_string( "v4l-adev", "/dev/dsp", 0, ADEV_TEXT, ADEV_LONGTEXT,
> false );
> + change_safe();
> add_string( "v4l-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT,
> true );
> + change_safe();
> add_float( "v4l-fps", -1.0, NULL, FPS_TEXT, FPS_LONGTEXT, true );
> + change_safe();
> add_integer( "v4l-samplerate", 44100, NULL, SAMPLERATE_TEXT,
> SAMPLERATE_LONGTEXT, true );
> + change_safe();
> add_integer( "v4l-channel", 0, NULL, CHANNEL_TEXT, CHANNEL_LONGTEXT,
> true );
> + change_safe();
> add_integer( "v4l-tuner", -1, NULL, TUNER_TEXT, TUNER_LONGTEXT, true );
> + change_safe();
> add_integer( "v4l-norm", VIDEO_MODE_AUTO, NULL, NORM_TEXT, NORM_LONGTEXT,
> false );
> change_integer_list( i_norm_list, psz_norm_list_text, NULL );
> + change_safe();
> add_integer( "v4l-frequency", -1, NULL, FREQUENCY_TEXT, FREQUENCY_LONGTEXT,
> false );
> + change_safe();
> add_integer( "v4l-audio", -1, NULL, AUDIO_TEXT, AUDIO_LONGTEXT, true );
> + change_safe();
> add_bool( "v4l-stereo", true, NULL, STEREO_TEXT, STEREO_LONGTEXT,
> true );
> + change_safe();
> add_integer( "v4l-width", 0, NULL, WIDTH_TEXT, WIDTH_LONGTEXT, true );
> + change_safe();
> add_integer( "v4l-height", 0, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT,
> true );
> + change_safe();
> add_integer( "v4l-brightness", -1, NULL, BRIGHTNESS_TEXT,
> BRIGHTNESS_LONGTEXT, true );
> + change_safe();
> add_integer( "v4l-colour", -1, NULL, COLOUR_TEXT, COLOUR_LONGTEXT,
> true );
> + change_safe();
> add_integer( "v4l-hue", -1, NULL, HUE_TEXT, HUE_LONGTEXT, true );
> + change_safe();
> add_integer( "v4l-contrast", -1, NULL, CONTRAST_TEXT, CONTRAST_LONGTEXT,
> true );
> + change_safe();
> add_bool( "v4l-mjpeg", false, NULL, MJPEG_TEXT, MJPEG_LONGTEXT,
> true );
> + change_safe();
> add_integer( "v4l-decimation", 1, NULL, DECIMATION_TEXT,
> DECIMATION_LONGTEXT, true );
> + change_safe();
> add_integer( "v4l-quality", 100, NULL, QUALITY_TEXT, QUALITY_LONGTEXT,
> true );
> + change_safe();
>
Useless, can be set by the URL.
> diff --git a/modules/access/v4l2/v4l2.c b/modules/access/v4l2/v4l2.c
> index 058efd5..c2f8005 100644
> --- a/modules/access/v4l2/v4l2.c
> +++ b/modules/access/v4l2/v4l2.c
> @@ -280,98 +280,140 @@ vlc_module_begin();
> set_section( N_( "Video input" ), NULL );
> add_string( CFG_PREFIX "dev", "/dev/video0", 0, DEV_TEXT, DEV_LONGTEXT,
> false );
> + change_safe();
> add_integer( CFG_PREFIX "standard", 0, NULL, STANDARD_TEXT,
> STANDARD_LONGTEXT, false );
> change_integer_list( i_standards_list, psz_standards_list_text, NULL );
> + change_safe();
> add_string( CFG_PREFIX "chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT,
> true );
> + change_safe();
> add_integer( CFG_PREFIX "input", 0, NULL, INPUT_TEXT, INPUT_LONGTEXT,
> true );
> + change_safe();
> add_integer( CFG_PREFIX "audio-input", 0, NULL, AUDIO_INPUT_TEXT,
> AUDIO_INPUT_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "io", IO_METHOD_MMAP, NULL, IOMETHOD_TEXT,
> IOMETHOD_LONGTEXT, true );
> change_integer_list( i_iomethod_list, psz_iomethod_list_text, NULL );
> + change_safe();
> add_integer( CFG_PREFIX "width", 0, NULL, WIDTH_TEXT,
> WIDTH_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "height", 0, NULL, HEIGHT_TEXT,
> HEIGHT_LONGTEXT, true );
> + change_safe();
> add_float( CFG_PREFIX "fps", 0, NULL, FPS_TEXT, FPS_LONGTEXT, true );
> + change_safe();
>
> set_section( N_( "Audio input" ), NULL );
> add_string( CFG_PREFIX "adev", NULL, 0, ADEV_TEXT, ADEV_LONGTEXT,
> false );
> + change_safe();
> add_integer( CFG_PREFIX "audio-method", AUDIO_METHOD_OSS|AUDIO_METHOD_ALSA,
> NULL, AUDIO_METHOD_TEXT, AUDIO_METHOD_LONGTEXT, true );
> + change_safe();
> add_bool( CFG_PREFIX "stereo", true, NULL, STEREO_TEXT, STEREO_LONGTEXT,
> true );
> + change_safe();
> add_integer( CFG_PREFIX "samplerate", 48000, NULL, SAMPLERATE_TEXT,
> SAMPLERATE_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "caching", DEFAULT_PTS_DELAY / 1000, NULL,
> CACHING_TEXT, CACHING_LONGTEXT, true );
> + change_safe();
>
> set_section( N_( "Tuner" ), NULL );
> add_integer( CFG_PREFIX "tuner", 0, NULL, TUNER_TEXT, TUNER_LONGTEXT,
> true );
> + change_safe();
> add_integer( CFG_PREFIX "tuner-frequency", -1, NULL, FREQUENCY_TEXT,
> FREQUENCY_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "tuner-audio-mode", -1, NULL, TUNER_AUDIO_MODE_TEXT,
> TUNER_AUDIO_MODE_LONGTEXT, true );
> change_integer_list( i_tuner_audio_modes_list,
> psz_tuner_audio_modes_list_text, 0 );
> + change_safe();
>
> set_section( N_( "Controls" ),
> N_( "v4l2 driver controls, if supported by your v4l2 driver." ) );
> add_bool( CFG_PREFIX "controls-reset", false, NULL, CTRL_RESET_TEXT,
> CTRL_RESET_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "brightness", -1, NULL, BRIGHTNESS_TEXT,
> BRIGHTNESS_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "contrast", -1, NULL, CONTRAST_TEXT,
> CONTRAST_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "saturation", -1, NULL, SATURATION_TEXT,
> SATURATION_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "hue", -1, NULL, HUE_TEXT,
> HUE_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "black-level", -1, NULL, BLACKLEVEL_TEXT,
> BLACKLEVEL_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "auto-white-balance", -1, NULL,
> AUTOWHITEBALANCE_TEXT, AUTOWHITEBALANCE_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "do-white-balance", -1, NULL, DOWHITEBALANCE_TEXT,
> DOWHITEBALANCE_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "red-balance", -1, NULL, REDBALANCE_TEXT,
> REDBALANCE_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "blue-balance", -1, NULL, BLUEBALANCE_TEXT,
> BLUEBALANCE_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "gamma", -1, NULL, GAMMA_TEXT,
> GAMMA_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "exposure", -1, NULL, EXPOSURE_TEXT,
> EXPOSURE_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "autogain", -1, NULL, AUTOGAIN_TEXT,
> AUTOGAIN_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "gain", -1, NULL, GAIN_TEXT,
> GAIN_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "hflip", -1, NULL, HFLIP_TEXT,
> HFLIP_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "vflip", -1, NULL, VFLIP_TEXT,
> VFLIP_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "hcenter", -1, NULL, HCENTER_TEXT,
> HCENTER_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "vcenter", -1, NULL, VCENTER_TEXT,
> VCENTER_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "audio-volume", -1, NULL, AUDIO_VOLUME_TEXT,
> AUDIO_VOLUME_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "audio-balance", -1, NULL, AUDIO_BALANCE_TEXT,
> AUDIO_BALANCE_LONGTEXT, true );
> + change_safe();
> add_bool( CFG_PREFIX "audio-mute", false, NULL, AUDIO_MUTE_TEXT,
> AUDIO_MUTE_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "audio-bass", -1, NULL, AUDIO_BASS_TEXT,
> AUDIO_BASS_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "audio-treble", -1, NULL, AUDIO_TREBLE_TEXT,
> AUDIO_TREBLE_LONGTEXT, true );
> + change_safe();
> add_integer( CFG_PREFIX "audio-loudness", -1, NULL, AUDIO_LOUDNESS_TEXT,
> AUDIO_LOUDNESS_LONGTEXT, true );
> + change_safe();
> add_string( CFG_PREFIX "set-ctrls", NULL, NULL, S_CTRLS_TEXT,
> S_CTRLS_LONGTEXT, true );
> + change_safe();
>
Useless, can be set by the URL.
> add_string( MODULE_STRING "-author-format",
> "%v - %F disc %c of %C",
> NULL,
> N_("Format to use in the playlist's \"author\" field."),
> VCD_TITLE_FMT_LONGTEXT, true );
> + change_safe();
>
> add_string( MODULE_STRING "-title-format",
> "%I %N %L%S - %M %A %v - disc %c of %C %F",
> NULL,
> N_("Format to use in the playlist's \"title\" field."),
> VCD_TITLE_FMT_LONGTEXT, false );
> + change_safe();
I am not sure it is safe.
> >From 2c754bf57a3e3079b127bedd6875a5e26841eac7 Mon Sep 17 00:00:00 2001
> From: Antoine Cellerier <dionoea at videolan.org>
> Date: Mon, 22 Sep 2008 22:28:40 +0200
> Subject: [PATCH] Tag some demux options as safe.
> @@ -103,6 +105,7 @@ vlc_module_begin();
> set_callbacks( Import_Shoutcast, Close_Shoutcast );
> add_bool( "shoutcast-show-adult", false, NULL,
> SHOW_ADULT_TEXT, SHOW_ADULT_LONGTEXT, false );
> + change_safe();
Not sure about this one.
Could you resend your patch with all remarks (mine and other's ones) taken care of ?
--
fenrir
More information about the vlc-devel
mailing list