After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676275 - Fix launching applications with filename arguments
Fix launching applications with filename arguments
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-05-17 20:16 UTC by Holger Berndt
Modified: 2017-11-22 08:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix launching applications with filename arguments (4.12 KB, patch)
2012-05-17 20:16 UTC, Holger Berndt
reviewed Details | Review

Description Holger Berndt 2012-05-17 20:16:56 UTC
Since the switch from gdk_spawn API to nautilus_launch in b569d2cf
external bulk rename tool invokation is broken for files with
Umlaut (and possibly other non-ASCII) characters in their name or
encoded URI.

In fact, this seems to be a symptom of a more general problem.
Since the move to GAppInfo API, 
nautilus_launch_application_from_command* is more or less forwarded
to g_app_info_create_from_commandline(). That basically means that
the command and all parameters are treated as if they were taken
from a .desktop Exec key. However, the exec key has different
quoting rules than the shell.

In particular, the '%' character that often appears in URIs of files
with special characters in their names gets stripped if not properly
encoded.
Comment 1 Holger Berndt 2012-05-17 20:16:58 UTC
Created attachment 214278 [details] [review]
Fix launching applications with filename arguments

Since the move to GAppInfo APIs as launcher backends, not shell-quoting,
but fd.o .desktop Exec key quoting rules must be applied.

Failing to do so resulted in broken arguments for invokations
of external commands with filename arguments if those filenames
(or the corresponding encoded URIs) contained reserved characers.

This applies to invokations of Nautilus Scripts as well as bulk renamers.
Comment 2 Cosimo Cecchi 2012-07-14 05:27:49 UTC
Review of attachment 214278 [details] [review]:

Thanks for the patch!

::: libnautilus-private/nautilus-program-choosing.c
@@ +269,2 @@
 	while ((parameter = va_arg (ap, char *)) != NULL) {
+		quoted_parameter = desktop_exec_quote (parameter);

Are you sure this change is correct also when use_terminal is true?
Comment 3 Tobias Mueller 2013-04-20 21:12:04 UTC
Holger, ping
Comment 4 André Klapper 2014-12-15 18:02:01 UTC
Holger: Can you please answer comment 2?
Comment 5 Alexandre Franke 2015-11-24 11:46:40 UTC
Cosimo, is this patch still relevant? It seems Holger is never going to reply.
Comment 6 Cosimo Cecchi 2015-11-25 01:47:50 UTC
Alexandre, I am not sure off the top of my head.
I will try to find some time to recreate the situation mentioned in the original report and test the patch.
Comment 7 Carlos Soriano 2017-11-22 08:54:36 UTC
Thanks Holger for the patch, nowadays Nautilus has a bulk rename tool inside and the code to launch a different bulk renamer is gone.

Closing.