summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2016-06-13 15:34:31 +0200
committerOndrej Holy <oholy@redhat.com>2016-06-14 12:04:42 +0200
commit2c6f2ff9201b11c49f198b5856e2913a9e21175d (patch)
treeee946d4179fae8e3167263da166c54e139d57f34 /daemon
parent69247aea7c4e27501abb10fd75a49b1429ce5e26 (diff)
downloadgvfs-2c6f2ff9201b11c49f198b5856e2913a9e21175d.tar.gz
smb: Set always G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE for files
G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE is set for regular files only when S_IWUSR is not set currently (i.e. FALSE only). It seems to me that it is reliable to set this to TRUE for regular files in other cases. Applications should not rely on those attributes, however it is crucial for some apps which rely on them still (e.g. File Roller). https://bugzilla.gnome.org/show_bug.cgi?id=724497
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gvfsbackendsmb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index 79c944c2..6e4bc419 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -1645,8 +1645,8 @@ set_info_from_stat (GVfsBackendSmb *backend,
/* If file is dos-readonly, libsmbclient doesn't set S_IWUSR, we use this to
trigger ACCESS_WRITE = FALSE. Only set for regular files, see
https://bugzilla.gnome.org/show_bug.cgi?id=598206 */
- if (!(statbuf->st_mode & S_IWUSR) && S_ISREG (statbuf->st_mode))
- g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, FALSE);
+ if (S_ISREG (statbuf->st_mode))
+ g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, statbuf->st_mode & S_IWUSR);
g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, FALSE);