summaryrefslogtreecommitdiffstats
path: root/tools/idevicebackup.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicebackup.c')
-rw-r--r--tools/idevicebackup.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c
index 152721e..eefaa6f 100644
--- a/tools/idevicebackup.c
+++ b/tools/idevicebackup.c
@@ -9,15 +9,15 @@
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version. 11 * version 2.1 of the License, or (at your option) any later version.
12 * 12 *
13 * This library is distributed in the hope that it will be useful, 13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details. 16 * Lesser General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU Lesser General Public 18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software 19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */ 21 */
22 22
23#ifdef HAVE_CONFIG_H 23#ifdef HAVE_CONFIG_H
@@ -511,13 +511,13 @@ static int mobilebackup_check_file_integrity(const char *backup_directory, const
511 511
512 char *version = NULL; 512 char *version = NULL;
513 node = plist_dict_get_item(metadata, "Version"); 513 node = plist_dict_get_item(metadata, "Version");
514 if (node && (plist_get_node_type(node) == PLIST_STRING)) { 514 if (node && (plist_get_node_type(node) == PLIST_STRING)) {
515 plist_get_string_val(node, &version); 515 plist_get_string_val(node, &version);
516 } 516 }
517 517
518 char *destpath = NULL; 518 char *destpath = NULL;
519 node = plist_dict_get_item(metadata, "Path"); 519 node = plist_dict_get_item(metadata, "Path");
520 if (node && (plist_get_node_type(node) == PLIST_STRING)) { 520 if (node && (plist_get_node_type(node) == PLIST_STRING)) {
521 plist_get_string_val(node, &destpath); 521 plist_get_string_val(node, &destpath);
522 } 522 }
523 523
@@ -529,7 +529,7 @@ static int mobilebackup_check_file_integrity(const char *backup_directory, const
529 529
530 char *domain = NULL; 530 char *domain = NULL;
531 node = plist_dict_get_item(metadata, "Domain"); 531 node = plist_dict_get_item(metadata, "Domain");
532 if (node && (plist_get_node_type(node) == PLIST_STRING)) { 532 if (node && (plist_get_node_type(node) == PLIST_STRING)) {
533 plist_get_string_val(node, &domain); 533 plist_get_string_val(node, &domain);
534 } 534 }
535 535
@@ -547,7 +547,7 @@ static int mobilebackup_check_file_integrity(const char *backup_directory, const
547 snprintf (p, 3, "%02x", (unsigned char)fnhash[i] ); 547 snprintf (p, 3, "%02x", (unsigned char)fnhash[i] );
548 } 548 }
549 if (strcmp(fnamehash, hash)) { 549 if (strcmp(fnamehash, hash)) {
550 printf("\r\n"); 550 printf("\r\n");
551 printf("WARNING: filename hash does not match for entry '%s'\n", hash); 551 printf("WARNING: filename hash does not match for entry '%s'\n", hash);
552 } 552 }
553 553
@@ -940,7 +940,7 @@ int main(int argc, char *argv[])
940 case CMD_BACKUP: 940 case CMD_BACKUP:
941 printf("Starting backup...\n"); 941 printf("Starting backup...\n");
942 /* TODO: check domain com.apple.mobile.backup key RequiresEncrypt and WillEncrypt with lockdown */ 942 /* TODO: check domain com.apple.mobile.backup key RequiresEncrypt and WillEncrypt with lockdown */
943 /* TODO: verify battery on AC enough battery remaining */ 943 /* TODO: verify battery on AC enough battery remaining */
944 944
945 /* read the last Manifest.plist */ 945 /* read the last Manifest.plist */
946 if (!is_full_backup) { 946 if (!is_full_backup) {
@@ -1026,7 +1026,7 @@ int main(int argc, char *argv[])
1026 sleep(2); 1026 sleep(2);
1027 goto files_out; 1027 goto files_out;
1028 } 1028 }
1029 1029
1030 node = plist_array_get_item(message, 0); 1030 node = plist_array_get_item(message, 0);
1031 1031
1032 /* get out if we don't get a DLSendFile */ 1032 /* get out if we don't get a DLSendFile */
@@ -1287,7 +1287,7 @@ files_out:
1287 } 1287 }
1288 free(auth_sig); 1288 free(auth_sig);
1289 } else if (auth_ver) { 1289 } else if (auth_ver) {
1290 printf("Unknown AuthVersion '%s', cannot verify AuthSignature\n", auth_ver); 1290 printf("Unknown AuthVersion '%s', cannot verify AuthSignature\n", auth_ver);
1291 } 1291 }
1292 plist_from_bin(bin, (uint32_t)binsize, &backup_data); 1292 plist_from_bin(bin, (uint32_t)binsize, &backup_data);
1293 free(bin); 1293 free(bin);
@@ -1434,7 +1434,7 @@ files_out:
1434 file_status = DEVICE_LINK_FILE_STATUS_LAST_HUNK; 1434 file_status = DEVICE_LINK_FILE_STATUS_LAST_HUNK;
1435 else 1435 else
1436 file_status = DEVICE_LINK_FILE_STATUS_HUNK; 1436 file_status = DEVICE_LINK_FILE_STATUS_HUNK;
1437 1437
1438 plist_dict_remove_item(file_info, "DLFileOffsetKey"); 1438 plist_dict_remove_item(file_info, "DLFileOffsetKey");
1439 plist_dict_set_item(file_info, "DLFileOffsetKey", plist_new_uint(file_offset)); 1439 plist_dict_set_item(file_info, "DLFileOffsetKey", plist_new_uint(file_offset));
1440 1440
@@ -1469,7 +1469,7 @@ files_out:
1469 printf("DONE\n"); 1469 printf("DONE\n");
1470 1470
1471 plist_free(send_file_node); 1471 plist_free(send_file_node);
1472 1472
1473 if (file_status == DEVICE_LINK_FILE_STATUS_NONE) 1473 if (file_status == DEVICE_LINK_FILE_STATUS_NONE)
1474 break; 1474 break;
1475 1475