diff options
author | Nikias Bassen | 2010-06-04 13:26:05 +0200 |
---|---|---|
committer | Nikias Bassen | 2010-06-04 13:26:05 +0200 |
commit | 837d5b0f5a401389802bddb468372a9bcbd418a0 (patch) | |
tree | d6a1398ed86e74a13f127dcffc0628e5b20aee02 /tools | |
parent | fadef8f4ee9e986eeb87de11d752a14c63974f3b (diff) | |
download | libimobiledevice-837d5b0f5a401389802bddb468372a9bcbd418a0.tar.gz libimobiledevice-837d5b0f5a401389802bddb468372a9bcbd418a0.tar.bz2 |
idevicebackup: verify Info.plist to ensure restoring to same device
Diffstat (limited to 'tools')
-rw-r--r-- | tools/idevicebackup.c | 12 |
1 files changed, 11 insertions, 1 deletions
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; |