libimobiledevice/0001-lockdown-iOS-5-handle-Error-key-in-lockdown_check_re.patch
2011-12-01 20:35:28 +01:00

40 lines
1.2 KiB
Diff

From e855f246b3d869a60375207fde1294bbe761fe23 Mon Sep 17 00:00:00 2001
From: Nikias Bassen <nikias@gmx.li>
Date: Mon, 21 Nov 2011 16:50:24 +0100
Subject: [PATCH] lockdown: iOS 5: handle 'Error' key in lockdown_check_result
---
src/lockdown.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/lockdown.c b/src/lockdown.c
index 327d9e5..1783df6 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -87,7 +87,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;
}
--
1.7.7.3