summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2011-06-09 23:44:43 +0200
committerGravatar Nikias Bassen2011-06-09 23:44:43 +0200
commitc90fc4c934ac7b024c1fc1813bb3cffb5333e18f (patch)
tree4dab48d126b5760cdce7ac69a1ae0c922a78e662 /src
parentf0487376671ffd6ac3fc121657f1fbd0acea3cb0 (diff)
downloadlibimobiledevice-c90fc4c934ac7b024c1fc1813bb3cffb5333e18f.tar.gz
libimobiledevice-c90fc4c934ac7b024c1fc1813bb3cffb5333e18f.tar.bz2
lockdown: move writing of device uuid to client struct inside lockdownd_client_new()
... instead of in lockdownd_client_new_with_handshake(). This way the device UUID is also available when only using a non-paired connection (e.g. when using the idevicepair tool).
Diffstat (limited to 'src')
-rw-r--r--src/lockdown.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index 15b3d69..327d9e5 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -630,7 +630,12 @@ lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *cli
client_loc->parent = plistclient;
client_loc->ssl_enabled = 0;
client_loc->session_id = NULL;
- client_loc->uuid = NULL;
+
+ if (idevice_get_uuid(device, &client_loc->uuid) != IDEVICE_E_SUCCESS) {
+ debug_info("failed to get device uuid.");
+ }
+ debug_info("device uuid: %s", client_loc->uuid);
+
client_loc->label = label ? strdup(label) : NULL;
*client = client_loc;
@@ -683,12 +688,6 @@ lockdownd_error_t lockdownd_client_new_with_handshake(idevice_t device, lockdown
free(type);
}
- ret = idevice_get_uuid(device, &client_loc->uuid);
- if (LOCKDOWN_E_SUCCESS != ret) {
- debug_info("failed to get device uuid.");
- }
- debug_info("device uuid: %s", client_loc->uuid);
-
userpref_get_host_id(&host_id);
if (LOCKDOWN_E_SUCCESS == ret && !host_id) {
ret = LOCKDOWN_E_INVALID_CONF;