summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-12-07 16:37:47 +0100
committerGravatar Matt Colyer2009-12-07 19:46:42 -0800
commit62c23c1ccafedab1bf8bed2fb0e511462b8ab4cc (patch)
tree10d0bbe8af419cf7ce67d82b8b82c19e3f9812f7
parentea45a41a7987ab1d05e2160ce831d2fcff695077 (diff)
downloadlibimobiledevice-62c23c1ccafedab1bf8bed2fb0e511462b8ab4cc.tar.gz
libimobiledevice-62c23c1ccafedab1bf8bed2fb0e511462b8ab4cc.tar.bz2
fix lockdownd_pair returning success on error
This fixes a bug where lockdown_check_result() might return -1 and lockdownd_pair() still returns success. Thanks to dborca for spotting this.
-rw-r--r--src/lockdown.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index 6bf4c84..02b0024 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -755,8 +755,8 @@ lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *uuid, char *ho
if (ret != LOCKDOWN_E_SUCCESS)
return ret;
- if (lockdown_check_result(dict, "Pair") == RESULT_SUCCESS) {
- ret = LOCKDOWN_E_SUCCESS;
+ if (lockdown_check_result(dict, "Pair") != RESULT_SUCCESS) {
+ ret = LOCKDOWN_E_PAIRING_FAILED;
}
plist_free(dict);
dict = NULL;
@@ -767,7 +767,6 @@ lockdownd_error_t lockdownd_pair(lockdownd_client_t client, char *uuid, char *ho
userpref_set_device_public_key(uuid, public_key);
} else {
log_dbg_msg(DBGMASK_LOCKDOWND, "%s: pair failure\n", __func__);
- ret = LOCKDOWN_E_PAIRING_FAILED;
}
free(public_key.data);
return ret;