GNOME Bugzilla – Bug 739075
GDaemonFile doesn't always set an error if we don't have a mount
Last modified: 2014-11-04 21:55:58 UTC
I was playing with my WIP Google Drive backend, when I noticed that GDaemonFile does not always set an error if find_enclosing_mount_async failed to get a mount.
Created attachment 289206 [details] [review] client: Don't guard against g_object_new returning NULL
Created attachment 289207 [details] [review] client: Don't guard against g_object_new returning NULL Fix a typo in the commit message.
Created attachment 289208 [details] [review] client: Always set an error if we don't have a mount
Created attachment 289209 [details] [review] client: Remove inconsistencies between async and sync variants
Review of attachment 289207 [details] [review]: Looks good.
Review of attachment 289208 [details] [review]: Looks good, thanks.
Review of attachment 289209 [details] [review]: Not sure whether this situation could happen, however it is just removing inconsistencies, and we have to set error when returning NULL (according the gio doc).
Thanks for the reviews.
Created attachment 289952 [details] [review] client: Fix up error handling in find_enclosing_mount 2a0dc68c7eeb ("client: Remove inconsistencies between async and sync variants") introduced a regression which causes find_enclosing_mount to segfault if a non-NULL GError** is passed in. Fix this. Also, only call g_dbus_error_strip_remote_error () on GErrors that have come from dbus.
Reopening due to some breakage in the last commit...
Review of attachment 289952 [details] [review]: I am not a gvfs maintainer so I can neither ACK nor NACK, but I took a look since it was me who caused the regression. Thanks for cleaning up after me, Ross. ::: client/gdaemonfile.c @@ +2280,3 @@ error); + if (error && *error) Oops! This is obviously correct. @@ -2313,3 @@ -out: - if (error && *error) - g_dbus_error_strip_remote_error (*error); Since g_dbus_error_strip_remote_error does not complain if the error did not come over D-Bus, this is a relatively cosmetic change.
Review of attachment 289952 [details] [review]: Ross, thanks for that!
(In reply to comment #11) > Review of attachment 289952 [details] [review]: > > I am not a gvfs maintainer so I can neither ACK nor NACK, but I took a look > since it was me who caused the regression. Thanks for cleaning up after me, > Ross. > > ::: client/gdaemonfile.c > @@ +2280,3 @@ > error); > > + if (error && *error) > > Oops! This is obviously correct. > > @@ -2313,3 @@ > -out: > - if (error && *error) > - g_dbus_error_strip_remote_error (*error); > > Since g_dbus_error_strip_remote_error does not complain if the error did not > come over D-Bus, this is a relatively cosmetic change. Yeah, I realise, but it seemed cleaner like this after moving the error check up.
Pushed to master as 7757c2bcfef808c860ec0e8676d69301a0f821d1. Thanks for the review.