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 765828 - Open in Remote Terminal crash on a sftp folder with % character
Open in Remote Terminal crash on a sftp folder with % character
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-29 21:33 UTC by Okki
Modified: 2016-05-02 20:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix - don't unescape twice (923 bytes, patch)
2016-05-01 08:29 UTC, Egmont Koblinger
committed Details | Review

Description Okki 2016-04-29 21:33:18 UTC
hello,

With Nautilus, I can go to a remote directory that contains a % character. But when I open a remote terminal, it crash immediately. If I rename the folder to remove that character, the remote terminal doesn't crash anymore.

My folder :

Ben Folds & Nick Hornby - Lonely Avenue (flac - 100% log)

I tested on Ubuntu GNOME 16.04 (GNOME 3.18), Arch Linux (Nautilus 3.20.1 and GNOME Terminal 3.20.1) with French locales, and Fedora 24 Alpha (Nautilus 3.20.0 and GNOME Terminal 3.20.1) with English locales.
Comment 1 Christian Persch 2016-04-30 11:29:31 UTC
Does it really 'crash' or just close again immediately? If it does crash, please extract the stack trace from abrt/coredumpctl/... (whatever works on ubuntu).
Comment 2 Egmont Koblinger 2016-05-01 07:44:44 UTC
I can reproduce. The ssh connection closes, g-t does not crash.

Upon opening a Remote Terminal in a "normal" directory, the local ssh command is:

  ssh -t abc.xy cd '/full/path/to/directory' && exec $SHELL - 

With the % character in the directory name, the local ssh command is:

  ssh -t abc.xy cd (null) && exec $SHELL -
Comment 3 Egmont Koblinger 2016-05-01 08:01:39 UTC
This is quite suspicious:

terminal-nautilus.c

/* a very simple URI parsing routine from Launchpad #333462, until GLib supports URI parsing (GNOME #489862) */
#define SFTP_PREFIX "sftp://"
static void
parse_sftp_uri (GFile *file,
                [blahblah...]

Bug 489862 isn't resolved yet.
Comment 4 Egmont Koblinger 2016-05-01 08:26:49 UTC
Nope, there's actually no problem here.
Comment 5 Egmont Koblinger 2016-05-01 08:29:20 UTC
Created attachment 327105 [details] [review]
Fix - don't unescape twice

ssh_argv() first calls parse_sftp_uri() which already unescapes the URI encoding (e.g. turns "%25" into "%") and then ssh_argv() tried to unescape it once again.
Comment 6 Christian Persch 2016-05-02 16:27:09 UTC
Comment on attachment 327105 [details] [review]
Fix - don't unescape twice

Thanks! Ok for master and 3-20.
Comment 7 Egmont Koblinger 2016-05-02 20:52:30 UTC
Review of attachment 327105 [details] [review]:

Committed