Ticket #2934: highlight OGV files as media.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Ticket #2913: CVE-2012-4463 mc-4.8.5: Does not sanitize MC_EXT_SELECTED variable properly

Paul Hartman reported the following (minor) security flaw into Gentoo's bugzilla:

https://bugs.gentoo.org/show_bug.cgi?id=436518

When multiple files are selected and F3 / Enter key is pressed on some of the files,
MC_EXT_SELECTED variable does not sanitize the whitespace characters properly
(leading into situation when first file is used as the actual value of MC_EXT_SELECTED
variable and the remaining files from the list are used as arguments passed to the
temporary script, created to handle F3 / Enter action on the first file).

A remote attacker could provide a specially-crafted archive and trick the local
Midnight Commander user into expanding and viewing it, which under certain
circumstances could lead to arbitrary code execution with the privileges of
the user running the mc executable.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
exec_get_export_variables(): reproduce bug in test

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Added tests for name_quote function.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Added parameter quotation

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Merge branch '2913_sanitize'

* 2913_sanitize:
  Added parameter quotation
  Added tests for name_quote function.
  exec_get_export_variables(): reproduce bug in test
  Ticket #2913: CVE-2012-4463 mc-4.8.5: Does not sanitize MC_EXT_SELECTED variable properly
Ticket #2924: attributes of existing directories are never preserved.

If superuser copies a directory tree (e.g. from a safe backup location
(with sane permission, owner, group, timestamp) over an existing tree,
any attributes are not preserved. All destination dirs retain all their
existing attributes instead of change attributes from source.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(copy_dir_dir): refactoring: get rid of goto dont_mkdir.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(copy_dir_dir): get rid of extra string duplication.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Merge branch '2924_preserve_dir_attributes'

* 2924_preserve_dir_attributes:
  (copy_dir_dir): get rid of extra string duplication.
  (copy_dir_dir): refactoring: get rid of goto dont_mkdir.
  Ticket #2924: attributes of existing directories are never preserved.
Ticket #2919: create WGroup widget.

WGroup is base widget for complex objects such as windows, dialog
windows, etc.

Initial step: use global counter to set widget ID.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dlg_widget_active): rename to widget_is_active()

...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dlg_replace_widget): rename to widget_replace()

...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dlg_overlap): rename to widget_overlaped()

...and move to lib/widget/widget-common.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dlg_default_repaint): make static. Use dlg_default_callback (MSG_DRAW) instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Use tty_draw_box instead of draw_box() to draw frame in widgets.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(draw_box): remove. Use tty_draw_box() instead to draw frame in dialog.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Move W_DISABLED option to new widget_state_t flags

...and rename to WIDGET_STATE_DISABLED.

  * Widget::state: new field.
  * Widget::set_state: new virtual method.
  * (widget_set_state): new function.
  * (widget_default_set_state_callback): new function.
  * (input_set_options_callback): rename to input_set_state_callback.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Move W_WANT_IDLE option to widget_state_t flags

...and rename to WIDGET_STATE_IDLE.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Remove WDialog::fullscreen field.

(widget_is_fullscreen): new function. Use instead of WDialog::fullscreen.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>