← Back to team overview

cairo-dock-team team mailing list archive

Re: [Bug 526138] [NEW] GMenu does not handle desktop file exec strings properly

 

Hi,
thanks for the information.
Do you know what %c, %i and %m are for ?
When we click on the menu entry, shouldn't we expect the program to just
launch itself, without taking any argument ?

2010/2/23 Tristan Moody <tmoody@xxxxxx>

> Public bug reported:
>
> Using GMenu plugin on cairo-dock-2.1.2.4 on Fedora 12:
>
> Applications in the main menu whose .desktop file exec string contains
> quotes (single or double) don't get launched.
>
> Example: Launching the application Kst from GMenu
> exec=kst -caption "%c" %i %m
>
> cairo-dock -l debug output:
> debug   :  (cairo-dock-callbacks.c:cairo_dock_launch_command_full:955)
>  cairo_dock_launch_command_full (kst -caption " , (null))
> sh: -c: line 0: unexpected EOF while looking for matching `"'
> sh: -c: line 1: syntax error: unexpected end of file
>
> by the time the exec string gets to cairo_dock_launch_command_full, any
> text appearing after quotes is truncated, causing the program to fail to
> launch.
>
> workaround: modify .desktop files to remove quotes from exec strings
>
> suggestion: GMenu/applet-utils.c:89 --> change g_key_file_get_string to
> g_key_file_get_value
>
> Thoughts?  Does this open up any security issues?
>
> Reasoning:
> g_key_file_parse_value_as_string, as called by g_key_file_get_string takes
> the result of g_key_file_get_value and processes some escape sequences.
>  However, it does not, for some reason, handle escapes such as \' and \",
> which mangles the exec string, causing the program not to launch.
>
> ** Affects: cairo-dock-core
>     Importance: Undecided
>         Status: New
>
> --
> GMenu does not handle desktop file exec strings properly
> https://bugs.launchpad.net/bugs/526138
> You received this bug notification because you are a member of Cairo-
> Dock Team, which is subscribed to Cairo-Dock Core.
>
> Status in Cairo-Dock : Core: New
>
> Bug description:
> Using GMenu plugin on cairo-dock-2.1.2.4 on Fedora 12:
>
> Applications in the main menu whose .desktop file exec string contains
> quotes (single or double) don't get launched.
>
> Example: Launching the application Kst from GMenu
> exec=kst -caption "%c" %i %m
>
> cairo-dock -l debug output:
> debug   :  (cairo-dock-callbacks.c:cairo_dock_launch_command_full:955)
>  cairo_dock_launch_command_full (kst -caption " , (null))
> sh: -c: line 0: unexpected EOF while looking for matching `"'
> sh: -c: line 1: syntax error: unexpected end of file
>
> by the time the exec string gets to cairo_dock_launch_command_full, any
> text appearing after quotes is truncated, causing the program to fail to
> launch.
>
> workaround: modify .desktop files to remove quotes from exec strings
>
> suggestion: GMenu/applet-utils.c:89 --> change g_key_file_get_string to
> g_key_file_get_value
>
> Thoughts?  Does this open up any security issues?
>
> Reasoning:
> g_key_file_parse_value_as_string, as called by g_key_file_get_string takes
> the result of g_key_file_get_value and processes some escape sequences.
>  However, it does not, for some reason, handle escapes such as \' and \",
> which mangles the exec string, causing the program not to launch.
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~cairo-dock-team<https://launchpad.net/%7Ecairo-dock-team>
> Post to     : cairo-dock-team@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~cairo-dock-team<https://launchpad.net/%7Ecairo-dock-team>
> More help   : https://help.launchpad.net/ListHelp
>

-- 
GMenu does not handle desktop file exec strings properly
https://bugs.launchpad.net/bugs/526138
You received this bug notification because you are a member of Cairo-
Dock Team, which is subscribed to Cairo-Dock Core.

Status in Cairo-Dock : Core: New

Bug description:
Using GMenu plugin on cairo-dock-2.1.2.4 on Fedora 12:

Applications in the main menu whose .desktop file exec string contains quotes (single or double) don't get launched.

Example: Launching the application Kst from GMenu
exec=kst -caption "%c" %i %m

cairo-dock -l debug output:
debug   :  (cairo-dock-callbacks.c:cairo_dock_launch_command_full:955)  
  cairo_dock_launch_command_full (kst -caption " , (null))
sh: -c: line 0: unexpected EOF while looking for matching `"'
sh: -c: line 1: syntax error: unexpected end of file

by the time the exec string gets to cairo_dock_launch_command_full, any text appearing after quotes is truncated, causing the program to fail to launch.

workaround: modify .desktop files to remove quotes from exec strings

suggestion: GMenu/applet-utils.c:89 --> change g_key_file_get_string to g_key_file_get_value

Thoughts?  Does this open up any security issues? 

Reasoning:
g_key_file_parse_value_as_string, as called by g_key_file_get_string takes the result of g_key_file_get_value and processes some escape sequences.  However, it does not, for some reason, handle escapes such as \' and \", which mangles the exec string, causing the program not to launch.





References