From be292b70b38536aed4e45bd4a0718ad9a0ac0029 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 6 Dec 2008 22:00:33 +0000 Subject: If the decrypted file is under 50 characters then something went wrong(TM). --- packages/autoconfigbackup/autoconfigbackup.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages') diff --git a/packages/autoconfigbackup/autoconfigbackup.php b/packages/autoconfigbackup/autoconfigbackup.php index 2a02bd82..cc3740ca 100644 --- a/packages/autoconfigbackup/autoconfigbackup.php +++ b/packages/autoconfigbackup/autoconfigbackup.php @@ -114,6 +114,8 @@ if($_REQUEST['newver'] != "") { $fd = fopen("/tmp/config_restore.xml", "w"); fwrite($fd, $data); fclose($fd); + if(count($data) < 50) + $input_errors[] = "The decrypted config.xml is under 50 characters, something went wrong. Aborting."; $ondisksha256 = trim(`/sbin/sha256 /tmp/config_restore.xml | awk '{ print $4 }'`); if($sha256 != "0" || $sha256 != "") // we might not have a sha256 on file for older backups if($ondisksha256 <> $sha256) -- cgit v1.2.3