diff options
| -rw-r--r-- | include/libiphone/lockdown.h | 1 | ||||
| -rw-r--r-- | src/lockdown.c | 13 |
2 files changed, 12 insertions, 2 deletions
diff --git a/include/libiphone/lockdown.h b/include/libiphone/lockdown.h index 7fa5384..e80851b 100644 --- a/include/libiphone/lockdown.h +++ b/include/libiphone/lockdown.h | |||
| @@ -48,6 +48,7 @@ extern "C" { | |||
| 48 | #define LOCKDOWN_E_PASSWORD_PROTECTED -14 | 48 | #define LOCKDOWN_E_PASSWORD_PROTECTED -14 |
| 49 | #define LOCKDOWN_E_NO_RUNNING_SESSION -15 | 49 | #define LOCKDOWN_E_NO_RUNNING_SESSION -15 |
| 50 | #define LOCKDOWN_E_INVALID_HOST_ID -16 | 50 | #define LOCKDOWN_E_INVALID_HOST_ID -16 |
| 51 | #define LOCKDOWN_E_INVALID_SERVICE -17 | ||
| 51 | 52 | ||
| 52 | #define LOCKDOWN_E_UNKNOWN_ERROR -256 | 53 | #define LOCKDOWN_E_UNKNOWN_ERROR -256 |
| 53 | 54 | ||
diff --git a/src/lockdown.c b/src/lockdown.c index 1befb72..8f15b3f 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -1262,9 +1262,18 @@ lockdownd_error_t lockdownd_start_service(lockdownd_client_t client, const char | |||
| 1262 | if (port && ret == LOCKDOWN_E_SUCCESS) | 1262 | if (port && ret == LOCKDOWN_E_SUCCESS) |
| 1263 | *port = port_loc; | 1263 | *port = port_loc; |
| 1264 | } | 1264 | } |
| 1265 | } | 1265 | } else { |
| 1266 | else | ||
| 1267 | ret = LOCKDOWN_E_START_SERVICE_FAILED; | 1266 | ret = LOCKDOWN_E_START_SERVICE_FAILED; |
| 1267 | plist_t error_node = plist_dict_get_item(dict, "Error"); | ||
| 1268 | if (error_node && PLIST_STRING == plist_get_node_type(error_node)) { | ||
| 1269 | char *error = NULL; | ||
| 1270 | plist_get_string_val(error_node, &error); | ||
| 1271 | if (!strcmp(error, "InvalidService")) { | ||
| 1272 | ret = LOCKDOWN_E_INVALID_SERVICE; | ||
| 1273 | } | ||
| 1274 | free(error); | ||
| 1275 | } | ||
| 1276 | } | ||
| 1268 | 1277 | ||
| 1269 | plist_free(dict); | 1278 | plist_free(dict); |
| 1270 | dict = NULL; | 1279 | dict = NULL; |
