Fix gvfs-afc crashes due to new libimobiledevice (#951731)
Conflicts: gvfs.spec
This commit is contained in:
parent
ee412ce87b
commit
4aa8339032
228
0001-afc-Update-to-libimobiledevice-new-api.patch
Normal file
228
0001-afc-Update-to-libimobiledevice-new-api.patch
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
From d71c6108901460842de25012d5ece727a0c70d27 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ondrej Holy <oholy@redhat.com>
|
||||||
|
Date: Tue, 11 Jun 2013 13:33:23 +0200
|
||||||
|
Subject: [PATCH] afc: Update to libimobiledevice new api
|
||||||
|
|
||||||
|
https://bugzilla.redhat.com/show_bug.cgi?id=951731
|
||||||
|
https://bugzilla.gnome.org/show_bug.cgi?id=702577
|
||||||
|
---
|
||||||
|
configure.ac | 5 +----
|
||||||
|
daemon/gvfsbackendafc.c | 42 +++++++++++++++++++++---------------------
|
||||||
|
monitor/afc/afcvolume.c | 8 +++++---
|
||||||
|
monitor/afc/afcvolumemonitor.c | 5 -----
|
||||||
|
4 files changed, 27 insertions(+), 33 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index 12dbdcd..2846d82 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -372,14 +372,11 @@ AFC_LIBS=
|
||||||
|
AFC_CFLAGS=
|
||||||
|
|
||||||
|
if test "x$enable_afc" != "xno" ; then
|
||||||
|
- PKG_CHECK_EXISTS(libimobiledevice-1.0 >= 1.1.0 libplist >= 0.15, msg_afc=yes)
|
||||||
|
+ PKG_CHECK_EXISTS(libimobiledevice-1.0 >= 1.1.5 libplist >= 0.15, msg_afc=yes)
|
||||||
|
|
||||||
|
if test "x$msg_afc" = "xyes"; then
|
||||||
|
PKG_CHECK_MODULES(AFC, libimobiledevice-1.0 libplist)
|
||||||
|
AC_DEFINE(HAVE_AFC, 1, [Define to 1 if AFC is going to be built])
|
||||||
|
- PKG_CHECK_EXISTS(libimobiledevice-1.0 >= 1.1.2,
|
||||||
|
- [AC_DEFINE(HAVE_LIBIMOBILEDEVICE_1_1_2, 1,
|
||||||
|
- [Define to 1 if libimobiledevice-1.1.2 found])])
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
|
||||||
|
index ab4a9ce..6b0b64f 100644
|
||||||
|
--- a/daemon/gvfsbackendafc.c
|
||||||
|
+++ b/daemon/gvfsbackendafc.c
|
||||||
|
@@ -349,12 +349,7 @@ _idevice_event_cb (const idevice_event_t *event, void *user_data)
|
||||||
|
if (event->event != IDEVICE_DEVICE_REMOVE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
-#ifdef HAVE_LIBIMOBILEDEVICE_1_1_2
|
||||||
|
event_udid = event->udid;
|
||||||
|
-#else
|
||||||
|
- event_udid = event->uuid;
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
if (g_str_equal (event_udid, afc_backend->uuid) == FALSE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
@@ -401,7 +396,7 @@ g_vfs_backend_afc_mount (GVfsBackend *backend,
|
||||||
|
const char *str;
|
||||||
|
char *tmp;
|
||||||
|
char *display_name = NULL;
|
||||||
|
- guint16 port;
|
||||||
|
+ lockdownd_service_descriptor_t lockdown_service = NULL;
|
||||||
|
int virtual_port;
|
||||||
|
GMountSpec *real_spec;
|
||||||
|
GVfsBackendAfc *self;
|
||||||
|
@@ -414,6 +409,7 @@ g_vfs_backend_afc_mount (GVfsBackend *backend,
|
||||||
|
char **dcim_afcinfo;
|
||||||
|
plist_t value;
|
||||||
|
lockdownd_error_t lerr;
|
||||||
|
+ afc_error_t aerr;
|
||||||
|
const gchar *choices[] = {_("Try again"), _("Cancel"), NULL}; /* keep in sync with the enum above */
|
||||||
|
gboolean aborted = FALSE;
|
||||||
|
gchar *message = NULL;
|
||||||
|
@@ -649,41 +645,38 @@ g_vfs_backend_afc_mount (GVfsBackend *backend,
|
||||||
|
|
||||||
|
switch (self->mode) {
|
||||||
|
case ACCESS_MODE_AFC:
|
||||||
|
- lerr = lockdownd_start_service (lockdown_cli, self->service, &port);
|
||||||
|
+ lerr = lockdownd_start_service (lockdown_cli, self->service, &lockdown_service);
|
||||||
|
if (G_UNLIKELY(g_vfs_backend_lockdownd_check (lerr, G_VFS_JOB(job))))
|
||||||
|
{
|
||||||
|
goto out_destroy_lockdown;
|
||||||
|
}
|
||||||
|
- if (G_UNLIKELY(g_vfs_backend_afc_check (afc_client_new (self->dev,
|
||||||
|
- port, &self->afc_cli),
|
||||||
|
- G_VFS_JOB(job))))
|
||||||
|
+ aerr = afc_client_new (self->dev, lockdown_service, &self->afc_cli);
|
||||||
|
+ if (G_UNLIKELY(g_vfs_backend_afc_check (aerr, G_VFS_JOB(job))))
|
||||||
|
{
|
||||||
|
goto out_destroy_lockdown;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ACCESS_MODE_HOUSE_ARREST:
|
||||||
|
- lerr = lockdownd_start_service (lockdown_cli, "com.apple.mobile.installation_proxy", &port);
|
||||||
|
+ lerr = lockdownd_start_service (lockdown_cli, "com.apple.mobile.installation_proxy", &lockdown_service);
|
||||||
|
if (G_UNLIKELY(g_vfs_backend_lockdownd_check (lerr, G_VFS_JOB(job))))
|
||||||
|
{
|
||||||
|
g_warning ("couldn't start inst proxy");
|
||||||
|
goto out_destroy_lockdown;
|
||||||
|
}
|
||||||
|
- if (G_UNLIKELY(g_vfs_backend_inst_check (instproxy_client_new (self->dev,
|
||||||
|
- port, &self->inst),
|
||||||
|
- G_VFS_JOB(job))))
|
||||||
|
+ aerr = instproxy_client_new (self->dev, lockdown_service, &self->inst);
|
||||||
|
+ if (G_UNLIKELY(g_vfs_backend_inst_check (aerr, G_VFS_JOB(job))))
|
||||||
|
{
|
||||||
|
g_warning ("couldn't create inst proxy instance");
|
||||||
|
goto out_destroy_lockdown;
|
||||||
|
}
|
||||||
|
- lerr = lockdownd_start_service (lockdown_cli, "com.apple.springboardservices", &port);
|
||||||
|
+ lerr = lockdownd_start_service (lockdown_cli, "com.apple.springboardservices", &lockdown_service);
|
||||||
|
if (G_UNLIKELY(g_vfs_backend_lockdownd_check (lerr, G_VFS_JOB(job))))
|
||||||
|
{
|
||||||
|
g_warning ("couldn't start SBServices proxy");
|
||||||
|
goto out_destroy_lockdown;
|
||||||
|
}
|
||||||
|
- if (G_UNLIKELY(g_vfs_backend_sbs_check (sbservices_client_new (self->dev,
|
||||||
|
- port, &self->sbs),
|
||||||
|
- G_VFS_JOB(job))))
|
||||||
|
+ aerr = sbservices_client_new (self->dev, lockdown_service, &self->sbs);
|
||||||
|
+ if (G_UNLIKELY(g_vfs_backend_sbs_check (aerr, G_VFS_JOB(job))))
|
||||||
|
{
|
||||||
|
g_warning ("couldn't create SBServices proxy instance");
|
||||||
|
goto out_destroy_lockdown;
|
||||||
|
@@ -705,6 +698,7 @@ g_vfs_backend_afc_mount (GVfsBackend *backend,
|
||||||
|
|
||||||
|
/* lockdown connection is not needed anymore */
|
||||||
|
lockdownd_client_free (lockdown_cli);
|
||||||
|
+ lockdownd_service_descriptor_free (lockdown_service);
|
||||||
|
|
||||||
|
/* Add camera item if necessary */
|
||||||
|
if (self->mode == ACCESS_MODE_AFC)
|
||||||
|
@@ -723,6 +717,7 @@ g_vfs_backend_afc_mount (GVfsBackend *backend,
|
||||||
|
|
||||||
|
out_destroy_lockdown:
|
||||||
|
lockdownd_client_free (lockdown_cli);
|
||||||
|
+ lockdownd_service_descriptor_free (lockdown_service);
|
||||||
|
|
||||||
|
out_destroy_dev:
|
||||||
|
idevice_free (self->dev);
|
||||||
|
@@ -794,10 +789,11 @@ g_vfs_backend_setup_afc_for_app (GVfsBackendAfc *self,
|
||||||
|
{
|
||||||
|
AppInfo *info;
|
||||||
|
lockdownd_client_t lockdown_cli;
|
||||||
|
- guint16 port;
|
||||||
|
+ lockdownd_service_descriptor_t lockdown_service = NULL;
|
||||||
|
house_arrest_client_t house_arrest;
|
||||||
|
afc_client_t afc;
|
||||||
|
plist_t dict, error;
|
||||||
|
+ lockdownd_error_t lerr;
|
||||||
|
|
||||||
|
info = g_hash_table_lookup (self->apps, id);
|
||||||
|
|
||||||
|
@@ -812,7 +808,8 @@ g_vfs_backend_setup_afc_for_app (GVfsBackendAfc *self,
|
||||||
|
g_warning ("Failed to get a lockdown to start house arrest for app %s", info->id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
- if (lockdownd_start_service (lockdown_cli, "com.apple.mobile.house_arrest", &port) != LOCKDOWN_E_SUCCESS)
|
||||||
|
+ lerr = lockdownd_start_service (lockdown_cli, "com.apple.mobile.house_arrest", &lockdown_service);
|
||||||
|
+ if (lerr != LOCKDOWN_E_SUCCESS)
|
||||||
|
{
|
||||||
|
lockdownd_client_free (lockdown_cli);
|
||||||
|
g_warning ("Failed to start house arrest for app %s", info->id);
|
||||||
|
@@ -820,14 +817,17 @@ g_vfs_backend_setup_afc_for_app (GVfsBackendAfc *self,
|
||||||
|
}
|
||||||
|
|
||||||
|
house_arrest = NULL;
|
||||||
|
- house_arrest_client_new (self->dev, port, &house_arrest);
|
||||||
|
+ house_arrest_client_new (self->dev, lockdown_service, &house_arrest);
|
||||||
|
if (house_arrest == NULL)
|
||||||
|
{
|
||||||
|
g_warning ("Failed to start house arrest for app %s", info->id);
|
||||||
|
lockdownd_client_free (lockdown_cli);
|
||||||
|
+ lockdownd_service_descriptor_free (lockdown_service);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ lockdownd_service_descriptor_free (lockdown_service);
|
||||||
|
+
|
||||||
|
dict = NULL;
|
||||||
|
if (house_arrest_send_command (house_arrest, "VendContainer", info->id) != HOUSE_ARREST_E_SUCCESS ||
|
||||||
|
house_arrest_get_result (house_arrest, &dict) != HOUSE_ARREST_E_SUCCESS)
|
||||||
|
diff --git a/monitor/afc/afcvolume.c b/monitor/afc/afcvolume.c
|
||||||
|
index 9829077..b7284b0 100644
|
||||||
|
--- a/monitor/afc/afcvolume.c
|
||||||
|
+++ b/monitor/afc/afcvolume.c
|
||||||
|
@@ -80,6 +80,8 @@ _g_vfs_afc_volume_update_metadata (GVfsAfcVolume *self)
|
||||||
|
guint retries;
|
||||||
|
plist_t value;
|
||||||
|
char *model, *display_name;
|
||||||
|
+ lockdownd_service_descriptor_t lockdown_service = NULL;
|
||||||
|
+ lockdownd_error_t lerr;
|
||||||
|
|
||||||
|
retries = 0;
|
||||||
|
do {
|
||||||
|
@@ -94,14 +96,14 @@ _g_vfs_afc_volume_update_metadata (GVfsAfcVolume *self)
|
||||||
|
|
||||||
|
if (self->service != NULL)
|
||||||
|
{
|
||||||
|
- guint16 port;
|
||||||
|
-
|
||||||
|
if (lockdownd_client_new_with_handshake (dev, &lockdown_cli, "gvfs-afc-volume-monitor") != LOCKDOWN_E_SUCCESS)
|
||||||
|
{
|
||||||
|
idevice_free (dev);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
- if (lockdownd_start_service(lockdown_cli, "com.apple.mobile.house_arrest", &port) != LOCKDOWN_E_SUCCESS)
|
||||||
|
+ lerr = lockdownd_start_service (lockdown_cli, "com.apple.mobile.house_arrest", &lockdown_service);
|
||||||
|
+ lockdownd_service_descriptor_free (lockdown_service);
|
||||||
|
+ if (lerr != LOCKDOWN_E_SUCCESS)
|
||||||
|
{
|
||||||
|
idevice_free (dev);
|
||||||
|
return 0;
|
||||||
|
diff --git a/monitor/afc/afcvolumemonitor.c b/monitor/afc/afcvolumemonitor.c
|
||||||
|
index 3545bdf..995ef4d 100644
|
||||||
|
--- a/monitor/afc/afcvolumemonitor.c
|
||||||
|
+++ b/monitor/afc/afcvolumemonitor.c
|
||||||
|
@@ -89,12 +89,7 @@ g_vfs_afc_monitor_idevice_event (const idevice_event_t *event, void *user_data)
|
||||||
|
|
||||||
|
self = G_VFS_AFC_VOLUME_MONITOR(user_data);
|
||||||
|
|
||||||
|
-#ifdef HAVE_LIBIMOBILEDEVICE_1_1_2
|
||||||
|
event_udid = event->udid;
|
||||||
|
-#else
|
||||||
|
- event_udid = event->uuid;
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
if (event->event == IDEVICE_DEVICE_ADD)
|
||||||
|
g_vfs_afc_monitor_create_volume (self, event_udid);
|
||||||
|
else
|
||||||
|
--
|
||||||
|
1.8.2.1
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
Summary: Backends for the gio framework in GLib
|
Summary: Backends for the gio framework in GLib
|
||||||
Name: gvfs
|
Name: gvfs
|
||||||
Version: 1.17.2
|
Version: 1.17.2
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
License: GPLv3 and LGPLv2+
|
License: GPLv3 and LGPLv2+
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
URL: http://www.gtk.org
|
URL: http://www.gtk.org
|
||||||
@ -41,6 +41,9 @@ BuildRequires: libtool
|
|||||||
# http://bugzilla.gnome.org/show_bug.cgi?id=567235
|
# http://bugzilla.gnome.org/show_bug.cgi?id=567235
|
||||||
Patch0: gvfs-archive-integration.patch
|
Patch0: gvfs-archive-integration.patch
|
||||||
|
|
||||||
|
# https://bugzilla.gnome.org/show_bug.cgi?id=702577
|
||||||
|
Patch1: 0001-afc-Update-to-libimobiledevice-new-api.patch
|
||||||
|
|
||||||
Obsoletes: gnome-mount <= 0.8
|
Obsoletes: gnome-mount <= 0.8
|
||||||
Obsoletes: gnome-mount-nautilus-properties <= 0.8
|
Obsoletes: gnome-mount-nautilus-properties <= 0.8
|
||||||
|
|
||||||
@ -176,6 +179,7 @@ file services.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p1 -b .archive-integration
|
%patch0 -p1 -b .archive-integration
|
||||||
|
%patch1 -p1 -b .libimobiledevice
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Needed for gvfs-0.2.1-archive-integration.patch
|
# Needed for gvfs-0.2.1-archive-integration.patch
|
||||||
@ -377,6 +381,9 @@ update-desktop-database >&/dev/null || :
|
|||||||
%{_datadir}/gvfs/remote-volume-monitors/goa.monitor
|
%{_datadir}/gvfs/remote-volume-monitors/goa.monitor
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jun 20 2013 Bastien Nocera <bnocera@redhat.com> 1.17.2-2
|
||||||
|
- Fix gvfs-afc crashes due to new libimobiledevice (#951731)
|
||||||
|
|
||||||
* Fri Jun 14 2013 Kalev Lember <kalevlember@gmail.com> - 1.17.2-1
|
* Fri Jun 14 2013 Kalev Lember <kalevlember@gmail.com> - 1.17.2-1
|
||||||
- Update to 1.17.2
|
- Update to 1.17.2
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user