GNOME Bugzilla – Bug 565624
Add FTP CHMOD support
Last modified: 2013-11-15 20:50:50 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.
Created attachment 125305 [details] [review] merry xmas
Created attachment 125306 [details] [review] typo fix
*** Bug 539531 has been marked as a duplicate of this bug. ***
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.
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.
(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.
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.
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
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.
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
Updating patch status according to descriptions.
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.
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