summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2016-06-08 15:50:04 +0200
committerBastien Nocera <hadess@hadess.net>2016-06-09 12:51:02 +0200
commit423e57649c856e18d776aa80955db385f70df2bb (patch)
treecdaac9af078641ecc4b3306441cf7ed249051645
parentbcdec26fcd1ac6d1b899c8cb49ee56cdd1b9db3b (diff)
downloadgvfs-423e57649c856e18d776aa80955db385f70df2bb.tar.gz
afc: Fix volume init with a locked device
The first time we connect the device, we won't be able to create a lockdown client with a handshake, so the volume won't be created at all and will not show up in nautilus. Furthermore, we were checking the OS version with a paired lockdown client (which is not needed, an unpaired one will do just as well) and checking whether HouseArrest was supported even if the service was different. So, we never needed to have a paired lockdown client in the first place, and we only need to check for the OS version if HouseArrest is what was requested. https://bugzilla.gnome.org/show_bug.cgi?id=767399
-rw-r--r--monitor/afc/afcvolume.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/monitor/afc/afcvolume.c b/monitor/afc/afcvolume.c
index e1731ee7..11871bf2 100644
--- a/monitor/afc/afcvolume.c
+++ b/monitor/afc/afcvolume.c
@@ -142,32 +142,20 @@ _g_vfs_afc_volume_update_metadata (GVfsAfcVolume *self)
if (err != IDEVICE_E_SUCCESS)
return 0;
- if (self->service != NULL)
+ lerr = lockdownd_client_new (dev, &lockdown_cli, "gvfs-afc-volume-monitor");
+ if (lerr != LOCKDOWN_E_SUCCESS)
{
- if (lockdownd_client_new_with_handshake (dev, &lockdown_cli, "gvfs-afc-volume-monitor") != LOCKDOWN_E_SUCCESS)
- {
- idevice_free (dev);
- return 0;
- }
- if (!_g_vfs_afc_volume_check_house_arrest_version (lockdown_cli))
- {
- lockdownd_service_descriptor_free (lockdown_service);
- idevice_free (dev);
- return 0;
- }
- lerr = lockdownd_start_service(lockdown_cli, "com.apple.mobile.house_arrest", &lockdown_service);
- lockdownd_service_descriptor_free (lockdown_service);
- if (lerr != LOCKDOWN_E_SUCCESS)
- {
- g_warning ("Couldn't start com.apple.mobile.house_arrest for UUID %s: %d", self->uuid, lerr);
- idevice_free (dev);
- return 0;
- }
+ g_debug ("Failed to create a client with handshake (%d)\n", lerr);
+ idevice_free (dev);
+ return 0;
}
- else
+
+ if (g_strcmp0 (self->service, HOUSE_ARREST_SERVICE_PORT) == 0)
{
- if (lockdownd_client_new (dev, &lockdown_cli, "gvfs-afc-volume-monitor") != LOCKDOWN_E_SUCCESS)
+ if (!_g_vfs_afc_volume_check_house_arrest_version (lockdown_cli))
{
+ g_debug ("Failed to check HouseArrest version\n");
+ lockdownd_service_descriptor_free (lockdown_service);
idevice_free (dev);
return 0;
}