[gvfs] archive: Set file executable bit from archive contents
- From: Ross Lagerwall <rossl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] archive: Set file executable bit from archive contents
- Date: Fri, 25 Oct 2013 08:32:01 +0000 (UTC)
commit 9299dacc3fd09d9a5c017a780a92a23702094159
Author: Ross Lagerwall <rosslagerwall gmail com>
Date: Sun Oct 6 11:46:36 2013 +0200
archive: Set file executable bit from archive contents
https://bugzilla.gnome.org/show_bug.cgi?id=634735
daemon/gvfsbackendarchive.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gvfsbackendarchive.c b/daemon/gvfsbackendarchive.c
index 141f8f1..48008d9 100644
--- a/daemon/gvfsbackendarchive.c
+++ b/daemon/gvfsbackendarchive.c
@@ -359,6 +359,7 @@ archive_file_set_info_from_entry (ArchiveFile * file,
{
GFileInfo *info = g_file_info_new ();
GFileType type;
+ mode_t mode;
file->info = info;
DEBUG ("setting up %s (%s)\n", archive_entry_pathname (entry), file->name);
@@ -413,10 +414,13 @@ archive_file_set_info_from_entry (ArchiveFile * file,
g_file_info_set_size (info,
archive_entry_size (entry));
+ mode = archive_entry_perm (entry);
g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_READ, TRUE);
g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, FALSE);
g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_DELETE, FALSE);
- g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE, type ==
G_FILE_TYPE_DIRECTORY);
+ g_file_info_set_attribute_boolean (info,
+ G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE,
+ type == G_FILE_TYPE_DIRECTORY || mode & S_IXUSR);
g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH, FALSE);
g_file_info_set_attribute_boolean (info, G_FILE_ATTRIBUTE_ACCESS_CAN_RENAME, FALSE);
@@ -436,7 +440,6 @@ const char *archive_entry_fflags_text(struct archive_entry *);
gid_t archive_entry_gid(struct archive_entry *);
const char *archive_entry_gname(struct archive_entry *);
const char *archive_entry_hardlink(struct archive_entry *);
-mode_t archive_entry_mode(struct archive_entry *);
unsigned int archive_entry_nlink(struct archive_entry *);
dev_t archive_entry_rdev(struct archive_entry *);
dev_t archive_entry_rdevmajor(struct archive_entry *);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]