summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2011-11-21 16:50:24 +0100
committerGravatar Martin Szulecki2012-03-22 18:51:30 +0100
commit3349235c49ad96bfe16dd9567ce0f50203f7a0c3 (patch)
tree52c08cfecd987f0bda095b3e24e7a9c934726562 /src
parentd7b96dcab3c1e5dcd24d69a34f8f5da186062f3d (diff)
downloadlibimobiledevice-3349235c49ad96bfe16dd9567ce0f50203f7a0c3.tar.gz
libimobiledevice-3349235c49ad96bfe16dd9567ce0f50203f7a0c3.tar.bz2
lockdown: iOS 5: handle 'Error' key in lockdown_check_result
Diffstat (limited to 'src')
-rw-r--r--src/lockdown.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index b4737ae..d3f3aab 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -82,7 +82,21 @@ static int lockdown_check_result(plist_t dict, const char *query_match)
plist_t result_node = plist_dict_get_item(dict, "Result");
if (!result_node) {
/* iOS 5: the 'Result' key is not present anymore.
- Just assume success here */
+ But we need to check for the 'Error' key. */
+ plist_t err_node = plist_dict_get_item(dict, "Error");
+ if (err_node) {
+ if (plist_get_node_type(err_node) == PLIST_STRING) {
+ char *err_value = NULL;
+ plist_get_string_val(err_node, &err_value);
+ if (err_value) {
+ debug_info("ERROR: %s", err_value);
+ free(err_value);
+ } else {
+ debug_info("ERROR: unknown error occured");
+ }
+ }
+ return RESULT_FAILURE;
+ }
return RESULT_SUCCESS;
}