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 565624 - Add FTP CHMOD support
Add FTP CHMOD support
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: ftp backend
git master
Other Linux
: Normal enhancement
: ---
Assigned To: gvfs-maint
gvfs-maint
: 539531 (view as bug list)
Depends on: 416221
Blocks:
 
 
Reported: 2008-12-25 15:07 UTC by A. Walton
Modified: 2013-11-15 20:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
merry xmas (3.99 KB, patch)
2008-12-25 15:09 UTC, A. Walton
none Details | Review
typo fix (3.98 KB, patch)
2008-12-25 15:11 UTC, A. Walton
needs-work Details | Review
needs to be fixed (5.98 KB, patch)
2009-02-13 16:42 UTC, Stancu Florin
needs-work Details | Review
needs to be fixed (5.98 KB, patch)
2009-02-13 19:33 UTC, Stancu Florin
none Details | Review
working patch (6.16 KB, patch)
2009-02-22 12:56 UTC, Stancu Florin
none Details | Review

Description A. Walton 2008-12-25 15:07:30 UTC
See above. Needs to be tested since I don't have access to an FTP server at the moment, and worked on some more probably. Follows what KIO does, disabling CHMOD support for the mount if we get the 500 return code.
Comment 1 A. Walton 2008-12-25 15:09:19 UTC
Created attachment 125305 [details] [review]
merry xmas
Comment 2 A. Walton 2008-12-25 15:11:38 UTC
Created attachment 125306 [details] [review]
typo fix
Comment 3 A. Walton 2008-12-25 16:15:15 UTC
*** Bug 539531 has been marked as a duplicate of this bug. ***
Comment 4 Benjamin Otte (Company) 2009-01-04 15:14:05 UTC
I'm gonna mark the patch "needs-work" after our IRC discussion:

It turns out Nautilus requires the backend to provide permissions before it attempts to set them. As the ftp backend currently doesn't parse permissions, we cannot provide them. So a first step necessary would be to modify (or replace?) the FTP directory parser so it does provide permission bits.
Comment 5 Tourneur Henry-Nicolas 2009-01-04 16:34:22 UTC
Hi Walton,

If you need testing I can provide you an account on an FTP server.
Anyway, you should also remember that nothing prevent you from installing a local FTP server and use it for testing.

For me, this feature is really a mandatory part of a complete ftp manager (think of webmasters that have to change perms for scripts and so on...).

I would be glad if we could have this features distributed along with gnome 2.26.

Comment 6 Andreas Henriksson 2009-01-22 15:20:31 UTC
(In reply to comment #4)
[...]
> It turns out Nautilus requires the backend to provide permissions before it
> attempts to set them. As the ftp backend currently doesn't parse permissions,

... which is bug #416221 - adding a dependency.
Comment 7 Stancu Florin 2009-02-13 16:42:53 UTC
Created attachment 128651 [details] [review]
needs to be fixed

I tried to make a patch for this bug/enhancement.
I started from A. Walton's modifications, and also modified ParseFTPList to return file permissions (implemented only for LSL format). 
The file permissions are showing correctly, but when I try to chmod a file, gvfs-ftp crashes. How can I debug it? (I'm a beginner).
BTW I tested it by modifying the gvfs 1.0.2-0ubuntu1 deb package.
Comment 8 Andreas Henriksson 2009-02-13 17:00:12 UTC
If you want to build on the latest source, you can just copy daemon/gvfsbackendftp.c from a svn checkout into your ubuntu package source.... (that's how I do it, since I don't want to update my entire gtk stack to be able to build all of gvfs from trunk).

A few debugging hints:
Run gvfsd in a terminal. You can do this by executing a "replace" command like "/usr/lib/gvfs/gvfsd -r" in a terminal and you'll see the debug output from the master daemon.

If you want to debug something which is after login I find it easiest to just trigger the connection then, when at the login prompt, switch to a terminal - list processes to find the gvfsd-ftp process and attach to it with "gdb -p $(pidof gvfsd-ftp)".

If you need to run something from the start (like valgrind), do:
cd /usr/lib/gvfs
mv gvfsd-ftp gvfsd-ftp.real
echo '#!/bin/sh
valgrind gvfsd-ftp.real $@" > gvfsd-ftp
chmod +x gvfsd-ftp

Also, for debugging.... make sure to build a debug version of the package:
DEB_BUILD_OPTIONS="nostrip debug noopt" dpkg-buildpackage -uc -us
Comment 9 Stancu Florin 2009-02-13 19:33:12 UTC
Created attachment 128674 [details] [review]
needs to be fixed

I tried to make a patch for this bug/enhancement.
I started from A. Walton's modifications, and also modified ParseFTPList to return file permissions (implemented only for LSL format). 
The file permissions are showing correctly, but when I try to chmod a file, gvfs-ftp crashes. How can I debug it? (I'm a beginner).
BTW I tested it by modifying the gvfs 1.0.2-0ubuntu1 deb package.
Comment 10 Stancu Florin 2009-02-13 19:35:17 UTC
oops, sorry I posted twice, I have a bad conenction... I clicked the submit button and went away and later returned and I got a HTTP error message, and I refreshed... sorry
Comment 11 Andreas Henriksson 2009-02-18 19:01:06 UTC
Updating patch status according to descriptions.
Comment 12 Stancu Florin 2009-02-22 12:56:40 UTC
Created attachment 129250 [details] [review]
working patch

Good news, I got it working (heuristically).
I just added a "conn->job=NULL" before the g_vfs_backend_ftp_push_connection() call. It seems that ftp_connection_pop_job() made it crash (I have no idea why, I don't fully understand GVFS's internals).
From what I've tested (CHMOD files/dirs/recursive, copy/paste and other basic FTP operations), it's working (for me).
I still haven't tested the patch against SVN, but it applies successfully.
Comment 13 Ross Lagerwall 2013-11-15 20:50:50 UTC
Chmod support has been implemented:

commit 7ad211bf67c3953f349e4adf911cce8c630e4890
Author:	Lawrence Rust <lvr@softsystem.co.uk>  Mon Jan 24 03:54:19 2011
Committer:	Benjamin Otte <otte@redhat.com>  Mon Jan 24 03:54:19 2011

ftp: Implement chmod

https://bugzilla.gnome.org/show_bug.cgi?id=416221