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 727007 - If set_display_name() fails, old file is returned
If set_display_name() fails, old file is returned
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: client module
git master
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2014-03-25 08:31 UTC by Ross Lagerwall
Modified: 2014-04-11 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
client: Return NULL if set_display_name() fails (1.17 KB, patch)
2014-03-25 08:33 UTC, Ross Lagerwall
committed Details | Review

Description Ross Lagerwall 2014-03-25 08:31:50 UTC
NULL should be returned instead.

E.g. instead of showing a permission denied error, this shows:
$ gvfs-rename smb://localhost/tmp/cat dog
Rename successful. New uri: smb://localhost/tmp/cat

(gvfs-rename:1385): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
Comment 1 Ross Lagerwall 2014-03-25 08:33:50 UTC
Created attachment 272830 [details] [review]
client: Return NULL if set_display_name() fails

Return NULL as per the documentation rather than returning the original
file.  This prevents errors like the following, where "Permission
Denied" should be displayed:
$ gvfs-rename smb://localhost/tmp/cat dog
Rename successful. New uri: smb://localhost/tmp/cat

(gvfs-rename:1385): GLib-GObject-CRITICAL **: g_object_unref: assertion
'G_IS_OBJECT (object)' failed
Comment 2 Ondrej Holy 2014-03-27 17:22:51 UTC
Review of attachment 272830 [details] [review]:

Looks good!
Comment 3 Ondrej Holy 2014-03-27 17:37:17 UTC
Comment on attachment 272830 [details] [review]
client: Return NULL if set_display_name() fails

Maybe would be better to commit it into the master after new branch will be created, because it could cause some bugs in other applications...
Comment 4 Ross Lagerwall 2014-03-27 19:30:45 UTC
Makes sense.  Are we waiting for 3.12.1 before we branch?
Comment 5 Ondrej Holy 2014-03-28 12:44:10 UTC
Probably yes, before that we will just commit only common bugfixes for master (and gnome-3-12)...
Comment 6 Ross Lagerwall 2014-04-11 16:54:56 UTC
Pushed to master as a3d3074363cd271c94dd10606d7a9953625632da.  Thanks!