diff options
| -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) | |||
| 87 | plist_t result_node = plist_dict_get_item(dict, "Result"); | 87 | plist_t result_node = plist_dict_get_item(dict, "Result"); |
| 88 | if (!result_node) { | 88 | if (!result_node) { |
| 89 | /* iOS 5: the 'Result' key is not present anymore. | 89 | /* iOS 5: the 'Result' key is not present anymore. |
| 90 | Just assume success here */ | 90 | But we need to check for the 'Error' key. */ |
| 91 | plist_t err_node = plist_dict_get_item(dict, "Error"); | ||
| 92 | if (err_node) { | ||
| 93 | if (plist_get_node_type(err_node) == PLIST_STRING) { | ||
| 94 | char *err_value = NULL; | ||
| 95 | plist_get_string_val(err_node, &err_value); | ||
| 96 | if (err_value) { | ||
| 97 | debug_info("ERROR: %s", err_value); | ||
| 98 | free(err_value); | ||
| 99 | } else { | ||
| 100 | debug_info("ERROR: unknown error occured"); | ||
| 101 | } | ||
| 102 | } | ||
| 103 | return RESULT_FAILURE; | ||
| 104 | } | ||
| 91 | return RESULT_SUCCESS; | 105 | return RESULT_SUCCESS; |
| 92 | } | 106 | } |
| 93 | 107 | ||
