summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2014-07-16 22:46:32 +0100
committerRoss Lagerwall <rosslagerwall@gmail.com>2014-08-20 19:13:52 +0100
commit2597c5bfa91b52921550142db6c58636ebc4f627 (patch)
treeaf47ad3c072f1d018ae25149c2037521ef74031f
parentbd294bc166c9b22b46fa97ab564bed50e4ad3365 (diff)
downloadgvfs-2597c5bfa91b52921550142db6c58636ebc4f627.tar.gz
ftp: Only send permission bits for SITE CHMOD
Some ftp servers give an error if more bits than just the permission bits are sent for SITE CHMOD so only send the permission bits. https://bugzilla.gnome.org/show_bug.cgi?id=733281
-rw-r--r--daemon/gvfsbackendftp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index c28bf84f..cdc93b30 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -29,6 +29,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
@@ -1142,7 +1145,7 @@ do_set_attribute (GVfsBackend *backend,
if (g_vfs_ftp_task_send (&task,
0,
"SITE CHMOD %04o %s",
- mode,
+ mode & (S_IRWXU | S_IRWXG | S_IRWXO),
g_vfs_ftp_file_get_ftp_path (file)))
{
g_vfs_ftp_dir_cache_purge_file (ftp->dir_cache, file);