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 11:56:14 +0200
commit98fb7cfbcb32cf0f1a41f88799f93cca097c216c (patch)
treed94b052cf647f78c1090df4340fea2d7b3f3dbdf
parent54658d0c811adbcbebe652316cd1a2cb7814648e (diff)
downloadgvfs-98fb7cfbcb32cf0f1a41f88799f93cca097c216c.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 545d1f43..5f52cf16 100644
--- a/monitor/afc/afcvolume.c
+++ b/monitor/afc/afcvolume.c
@@ -145,32 +145,20 @@ _g_vfs_afc_volume_update_metadata (GVfsAfcVolume *self)
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;
}