Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:17624 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43862 invoked by uid 1010); 8 Aug 2005 20:00:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 43840 invoked from network); 8 Aug 2005 20:00:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Aug 2005 20:00:41 -0000 Received: from ([127.0.0.1:29071]) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with ECSTREAM id 8D/D7-04646-9E9B7F24 for ; Mon, 08 Aug 2005 16:00:41 -0400 X-Host-Fingerprint: 208.151.246.192 208-151-246-192.dq1sn.easystreet.com Linux 2.4/2.6 Received: from ([208.151.246.192:46054] helo=sound-o-mat.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 24/B3-04646-68DA7F24 for ; Mon, 08 Aug 2005 15:07:50 -0400 Received: from localhost (localhost [127.0.0.1]) by sound-o-mat.com (Postfix) with ESMTP id 45B2B11C4CB; Mon, 8 Aug 2005 12:07:41 -0700 (PDT) Received: from sound-o-mat.com ([127.0.0.1]) by localhost (cainan.sound-o-mat.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23316-08; Mon, 8 Aug 2005 12:07:24 -0700 (PDT) Received: from [192.168.1.3] (linksys [192.168.1.1]) by sound-o-mat.com (Postfix) with ESMTP id B85D111C491; Mon, 8 Aug 2005 12:07:24 -0700 (PDT) Message-ID: <42F7AD6C.8020003@pheedo.com> Date: Mon, 08 Aug 2005 12:07:24 -0700 Reply-To: rvaughn@pheedo.com Organization: Pheedo User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net Cc: Rob Vaughn X-Enigmail-Version: 0.91.0.0 Content-Type: multipart/mixed; boundary="------------090406030500090105050606" X-Virus-Scanned: amavisd-new at sound-o-mat.com Subject: Improvement to test script 'bug22414' From: rvaughn@pheedo.com (Rob Vaughn) --------------090406030500090105050606 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Attached is a universal 'diff' that adds a crc32() check to the 'passthru' test as well as an md5() test. This will help detect if there's a problem with md5() or crc32() unless both are failing, which indicates a problem with the 'mhash' functionality. Cheers, Rob --------------090406030500090105050606 Content-Type: text/x-patch; name="bug22414.phpt.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bug22414.phpt.diff" --- ext/standard/tests/file/bug22414.phpt 2004-09-24 14:57:19.000000000 -0700 +++ ext/standard/tests/file/bug22414.phpt.new 2005-08-08 12:03:00.000000000 -0700 @@ -1,36 +1,47 @@ --TEST-- Bug #22414: passthru() does not read data correctly --SKIPIF-- - + --INI-- safe_mode= output_handler= --FILE-- - '.$tmpfile ; - exec($cmd); + + @unlink ($pwd . '/passthru_test'); + $cmd = $php . ' -n -r \"readfile(' . $php . '); \"'; + $cmd = $php . ' -n -r \' passthru("'.$cmd.'"); \' > '. $tmpfile ; + exec ($cmd); + + $val1 = md5_file ($php); + $val2 = md5_file ($tmpfile); + $crc1 = crc32 (file_get_contents ($php)); + $crc2 = crc32 (file_get_contents ($tmpfile)); + + if ($crc1 == $crc2) { + echo "crc32() Check Passed.\n"; + } else { + echo "crc32() Check Failed. This may be a bug with passthru() or with the mhash routines that provide md5().\n"; + } if (md5_file($php) == md5_file($tmpfile)) { - echo "Works\n"; + echo "md5() Check Passed.\n"; } else { - echo "Does not work\n"; + echo "md5() Check Failed. This may be a bug with passthru() or with the mhash routines that provide md5().\n"; } @unlink($tmpfile); ?> --EXPECT-- HELLO -Works +crc32() Check Passed. +md5() Check Passed. --------------090406030500090105050606--