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 332676 - symbolic links with spaces in their pathnames on ftp servers does not work
symbolic links with spaces in their pathnames on ftp servers does not work
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Module: ftp
2.13.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2006-02-26 21:37 UTC by Sebastien Bacher
Modified: 2008-01-03 12:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix incorrectly ftp symlink with space in it. (904 bytes, patch)
2007-10-20 15:43 UTC, Yann Rouillard
none Details | Review

Description Sebastien Bacher 2006-02-26 21:37:34 UTC
That bug has been opened on https://launchpad.net/distros/ubuntu/+source/gnome-vfs2/+bug/29485

"There are problems with ftp and symbolic links that contain spaces. To Illustrate I made the following directory:

[ kjetil ~ ]$ gnomevfs-ls file:///ftp/test/ | sort
1_without_Spaces (Directory, x-directory/normal) size 4096 mode 0755
2_without_Spaces_Link1 [link: /ftp/test/1_without_Spaces ] (Directory, x-directory/normal) size 4096 mode 0755
3 without Spaces Link2 [link: /ftp/test/1_without_Spaces ] (Directory, x-directory/normal) size 4096 mode 0755
4 with Spaces (Directory, x-directory/normal) size 4096 mode 0755
5_with_Spaces_Link1 [link: /ftp/test/4 with Spaces/ ] (Directory, x-directory/normal) size 4096 mode 0755
6 with Spaces Link2 [link: /ftp/test/4 with Spaces/ ] (Directory, x-directory/normal) size 4096 mode 0755
. (Directory, x-directory/normal) size 4096 mode 0755 .. (Directory, x-directory/normal) size 4096 mode 0775

When accessing the dir via ftp I get the following:

[ kjetil ~ ]$ gnomevfs-ls ftp://kjetil:****@localhost/test | sort 1_without_Spaces (Directory, x-directory/normal) size 4096 mode 0755
2_without_Spaces_Link1 [link: /test/1_without_Spaces ] (Directory, x-directory/normal) size 4096 mode 0755
3 [link: /test/1_without_Spaces ] (Directory, x-directory/normal) size 4096 mode 0755
4 with Spaces (Directory, x-directory/normal) size 4096 mode 0755
5_with_Spaces_Link1 [link: 4 ] (Symbolic Link, x-special/symlink) size 14 mode 0777
6 [link: 4 ] (Symbolic Link, x-special/symlink) size 14 mode 0777
. (Directory, x-directory/normal) size 4096 mode 0755 .. (Directory, x-directory/normal) size 4096 mode 0775

This makes the links numbered 3 and 6 (the ones with spaces in them) not work.

As you can the links can point to a file containing spaces, but cannot have spaces itself. The spaces need not be in the actual filename of the link, they can be anywhere in its path.
...
> What ftp server do you use?
...
I used to use pureftpd, but to eliminate the ftp server from the equation i switched to vsftpd, and the problem still exists.
...
>  could you describe a simple way (go on the server, create "One stuff", run ...) to get the issue on dapper?
...


Certainly:
[ kjetil /ftp/test ]$ touch foo
[ kjetil /ftp/test ]$ ln -s foo "bar baz"
[ kjetil /ftp/test ]$ gnomevfs-ls ftp://kjetil:******@localhost/test . (Directory, x-directory/normal) size 4096
.. (Directory, x-directory/normal) size 4096
bar [link: /test/foo ] (Regular, application/octet-stream) size 0 foo (Regular, application/octet-stream) size 0 [ kjetil /ftp/test ]$ ncftpls -l ftp://kjetil:******@localhost:/test/ lrwxrwxrwx 1 ftp ftp 3 Feb 26 19:22 bar baz -> foo -rw-r--r-- 1 ftp ftp 0 Feb 26 19:22 foo

OT: Does Malone allow pre or code tags to prevent code lines from wrapping?
"
Comment 1 Yann Rouillard 2007-10-20 15:43:40 UTC
Created attachment 97517 [details] [review]
Fix incorrectly ftp symlink with space in it.

I confirm this bug.

ftp ls output is incorrectly parsed in gnome_vfs_parse_ls_lga when there are space in symlink filenames.

The filename is extracted from the p_copy string, but this string was tokenized by vfs_split_text, each column being separated by '\0' char.
Hence, g_strndup only extract the first word. 

The same problem happen when the symlink target has spaces in it.

The attached patch solves this bug because it uses the original p_pristine string instead of p_copy.