From 837d5b0f5a401389802bddb468372a9bcbd418a0 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 4 Jun 2010 13:26:05 +0200 Subject: idevicebackup: verify Info.plist to ensure restoring to same device --- tools/idevicebackup.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tools/idevicebackup.c') diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c index 04e633e..2018bc6 100644 --- a/tools/idevicebackup.c +++ b/tools/idevicebackup.c @@ -602,9 +602,19 @@ int main(int argc, char *argv[]) printf("Aborting backup. Backup is not compatible with the current device.\n"); cmd = CMD_LEAVE; } + } else if (info_plist && (cmd == CMD_RESTORE)) { + if (!mobilebackup_info_is_current_device(info_plist)) { + printf("Aborting restore. Backup data is not compatible with the current device.\n"); + cmd = CMD_LEAVE; + } } } else { - is_full_backup = 1; + if (cmd == CMD_RESTORE) { + printf("Aborting restore. Info.plist is missing.\n"); + cmd = CMD_LEAVE; + } else { + is_full_backup = 1; + } } uint64_t lockfile = 0; -- cgit v1.1-32-gdbae