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 350976 - Renaming a SMB file should give better error for illegal characters
Renaming a SMB file should give better error for illegal characters
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: smb backend
git master
Other All
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
: 741135 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-08-11 22:42 UTC by Federico Mena Quintero
Modified: 2018-09-21 16:15 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
nautilus-350976-rename-bad-parameters-message.diff (1.17 KB, patch)
2006-08-11 22:51 UTC, Federico Mena Quintero
none Details | Review
gvfs-bgo350976-translate-einval-to-invalid-filename.diff (9.50 KB, patch)
2009-03-10 21:52 UTC, Federico Mena Quintero
none Details | Review
gvfs-bgo350976-translate-einval-to-invalid-filename.diff (8.08 KB, patch)
2011-08-15 15:56 UTC, Tomas Bzatek
none Details | Review

Description Federico Mena Quintero 2006-08-11 22:42:03 UTC
When you rename a file in a SMB share to "hel\lo.txt" (note the backslash), Nautilus simply tells you that it couldn't rename the file.  It should give a better explanation.  The attached patch fixes this [we get EINVAL from libsmbclient, which gets translated to GNOME_VFS_ERROR_BAD_PARAMETERS].
Comment 1 Federico Mena Quintero 2006-08-11 22:51:04 UTC
Created attachment 70754 [details] [review]
nautilus-350976-rename-bad-parameters-message.diff
Comment 2 Cosimo Cecchi 2008-04-21 17:54:09 UTC
Confirming and modifying fields. I think this will require patching GVfs too, as we should get the G_IO_ERROR_INVALID_FILENAME error, not G_IO_ERROR_INVALID_ARGUMENT as it happens now.
Comment 3 Federico Mena Quintero 2009-02-26 00:55:41 UTC
This bug was assigned to Nautilus during the gnome-vfs days.  I'm reassigning this to gvfs now; I don't really know if the SMB backend works as described now.
Comment 4 Alexander Larsson 2009-03-10 15:22:15 UTC
We're not handing this right in gvfs ATM. I guess its EINVAL we need to convert to G_IO_ERROR_INVALID_FILENAME.
Comment 5 Federico Mena Quintero 2009-03-10 21:52:06 UTC
Created attachment 130435 [details] [review]
gvfs-bgo350976-translate-einval-to-invalid-filename.diff

Untested patch, but it handles all the calls to libsmbclient from the SMB backend that are related to filenames.  For those calls that are not filename-related (like smbc_read), we don't modify EINVAL.
Comment 6 Vincent Untz 2011-08-03 09:44:42 UTC
Ping? Any news on a review for this patch? :-)
Comment 7 Tomas Bzatek 2011-08-15 15:56:07 UTC
Created attachment 193879 [details] [review]
gvfs-bgo350976-translate-einval-to-invalid-filename.diff

Attaching rebased patch with minor compilation fixes.

Patch looks good to me, however my libsmbclient-3.5.8 is getting me ENOENT istead of EINVAL on file rename. This results in no change of error message in Nautilus.

I wonder if getting ENOENT is consistent across various libsmbclient versions. ENOENT is rather general error code and I would rather keep it specific to renaming. It's also hard to distinguish between bad source or target URI.
Comment 8 Ross Lagerwall 2013-11-05 18:00:09 UTC
Recent libsmbclient does seem to give ENOENT for an invalid filename so I guess the patch wouldn't make any difference.

Would it be possible to accurately map ENOENT to G_IO_ERROR_INVALID_FILENAME, at least for rename()?
Comment 9 Ross Lagerwall 2014-12-04 22:29:22 UTC
*** Bug 741135 has been marked as a duplicate of this bug. ***
Comment 10 GNOME Infrastructure Team 2018-09-21 16:15:44 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/27.