diff options
author | Nikias Bassen | 2011-11-21 16:50:24 +0100 |
---|---|---|
committer | Nikias Bassen | 2011-11-21 16:50:24 +0100 |
commit | e855f246b3d869a60375207fde1294bbe761fe23 (patch) | |
tree | c9c658051e1deaa05d5be91feab35609f995a5c9 /src | |
parent | d2db9b97b0487e3e0c65cca0e0dd02a747a61113 (diff) | |
download | libimobiledevice-e855f246b3d869a60375207fde1294bbe761fe23.tar.gz libimobiledevice-e855f246b3d869a60375207fde1294bbe761fe23.tar.bz2 |
lockdown: iOS 5: handle 'Error' key in lockdown_check_result
Diffstat (limited to 'src')
-rw-r--r-- | 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; } |