After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 724497 - Can't create compressed archives or raw disk images on SMB share.
Can't create compressed archives or raw disk images on SMB share.
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: smb backend
1.18.x
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks: 688714
 
 
Reported: 2014-02-16 19:22 UTC by rminkler
Modified: 2018-09-21 17:39 UTC
See Also:
GNOME target: ---
GNOME version: 3.9/3.10


Attachments
backtrace (58.27 KB, text/plain)
2014-02-27 15:54 UTC, Ondrej Holy
  Details
smb: Set always G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE for files (1.50 KB, patch)
2016-06-14 08:10 UTC, Ondrej Holy
committed Details | Review

Description rminkler 2014-02-16 19:22:07 UTC
I can't create compressed archives (using file-roller or the zip command) on an SMB share to which I have full read/write permissions. I also can't create disk images on the drive, using dd, ddrescue or palimpset. I can copy files to the drive, which works as expected. When I mount the share using "mount -t cifs..." everything works, so I believe the bug is in gvfs. I've observed the same symptoms on Fedora 20 and Arch, so I don't believe this is a distribution specific issue.

I don't think I'm the only one with this issue:

https://bugzilla.gnome.org/show_bug.cgi?id=688714

It also appears that the issue may effect FTP shares:

http://askubuntu.com/questions/213928/create-archive-on-ftp-in-ubuntu-12-10

File roller appears to be failing the following check:

"	if (! g_file_info_get_attribute_boolean (parent_info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE)) {
		dialog = _gtk_error_dialog_new (GTK_WINDOW (self),
						GTK_DIALOG_MODAL,
						NULL,
						_("Could not create the archive"),
						"%s",
						_("You don't have permission to create an archive in this folder"));
		gtk_dialog_run (GTK_DIALOG (dialog));

		gtk_widget_destroy (GTK_WIDGET (dialog));
		g_object_unref (parent_info);
		g_object_unref (file);

		return NULL;
	}"
Comment 1 Ondrej Holy 2014-02-27 14:34:53 UTC
The files in the /run/user/1000/gvfs/ directory (or .gvfs) are provided by FUSE as fallback and some functionality is missing. So that is the reason probably, why mount -t cifs... works and gvfs doesn't. However I am able to create archives using File Roller and zip command in the /run/user/1000/gvfs/smb-share... on Fedora 20. Do you see any errors when using e.g. zip command?

But it fails for me when using "Compress..." item from Nautilus...
Comment 2 Ondrej Holy 2014-02-27 15:19:57 UTC
I've just realized that file roller is using gio api. It is possible to create archive to the path /run/user/1000/gvfs/smb..., but it isn't work with uri smb://...
Comment 3 Ondrej Holy 2014-02-27 15:54:33 UTC
Created attachment 270489 [details]
backtrace

Problem is that G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE isn't set by majority of backends, so it fails on the check mentioned in the first comment. However when I set this flag, File roller fails by SIGABRT. Backtrace is attached...
Comment 4 Ondrej Holy 2016-06-14 08:10:58 UTC
Created attachment 329761 [details] [review]
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).
Comment 5 Ondrej Holy 2016-06-14 08:39:22 UTC
Actally this patch doesn't solve "You don't have permissions to create an archive in this folder" error, because the attribute is set only for files. There isn't any reliable way, how to determine whether directory is writable or not, see Bug 581368. So file roller code needs to be changed to not rely on this attribute...
Comment 6 Ondrej Holy 2016-06-14 10:06:51 UTC
Comment on attachment 329761 [details] [review]
smb: Set always G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE for files

Pushed as commit 2c6f2ff .

$ ls -l
total 0
---------- 1 oholy oholy    0 Jun 13 17:10 a
--w--w--w- 1 oholy oholy    0 Jun 13 17:10 b

$ gvfs-ls -l -a "access::can-write" smb://server/share/
a	0	(regular)	access::can-write=FALSE
b	0	(regular)	access::can-write=TRUE
Comment 7 Ondrej Holy 2016-06-14 11:00:43 UTC
(In reply to Ondrej Holy from comment #5)
> Actally this patch doesn't solve "You don't have permissions to create an
> archive in this folder" error, because the attribute is set only for files.
> There isn't any reliable way, how to determine whether directory is writable
> or not, see Bug 581368. So file roller code needs to be changed to not rely
> on this attribute...

I proposed patch for file-roller to not rely on the attribute. There isn't any other obvious gvfs-related problem, but let the bug open for now..
Comment 8 GNOME Infrastructure Team 2018-09-21 17:39:07 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/225.