[gvfs] smb: Ignore read-only attribute for directories
- From: Tomas Bzatek <tbzatek src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] smb: Ignore read-only attribute for directories
- Date: Thu, 8 Sep 2011 14:35:30 +0000 (UTC)
commit d126be6f54cffb0d3270fd72d4a00e8ab618272e
Author: Andreas Heik <andreas heik hrz tu-chemnitz de>
Date: Thu Sep 8 16:26:03 2011 +0200
smb: Ignore read-only attribute for directories
According to Microsoft Knowledge Base article the read-only attribute
on a folder is being usually ignored by the system and applications.
Let's ignore it in gvfs to avoid compatibility issues.
http://support.microsoft.com/kb/326549/
https://bugzilla.gnome.org/show_bug.cgi?id=598206
daemon/gvfsbackendsmb.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index 1dbe8d8..27824ab 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -1528,8 +1528,9 @@ set_info_from_stat (GVfsBackendSmb *backend,
g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_UNIX_INODE, statbuf->st_ino);
/* If file is dos-readonly, libsmbclient doesn't set S_IWUSR, we use this to
- trigger ACCESS_WRITE = FALSE: */
- if (!(statbuf->st_mode & S_IWUSR))
+ 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);
g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_ACCESS, statbuf->st_atime);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]