Bug 229454 - Errors in /var/log/httpd/error_log
Errors in /var/log/httpd/error_log
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: squirrelmail (Show other bugs)
rawhide
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Martin Bacovsky
: Reopened
: 204211 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-21 04:01 EST by Nigel Horne
Modified: 2008-05-07 05:28 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-24 08:22:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Nigel Horne 2007-02-21 04:01:59 EST
Description of problem:


Version-Release number of selected component (if applicable):
squirrelmail-1.4.8-4.fc6

How reproducible:
100%

Steps to Reproduce:
1. cat /var/log/httpd/error_log
2.
3.
  
Actual results:
Gives lots of errors such as
[Tue Feb 20 16:57:15 2007] [error] [client 82.33.111.168] PHP Notice:  Undefined
variable: charset in /usr/share/squirrelmail/functions/mime.php on line 317,
referer: http://mail.ji-tu.com/webmail/src/right_main.php



Expected results:
Shouldn't give any errors


Additional info:
Comment 1 Tomas 2007-02-25 05:13:59 EST
Error comes from squirrelmail-1.4.8-IE-Japanese-download-ugly-hack.patch
---
+    if (!$charset_converted) {
+        if ($charset == 'iso-2022-jp' || $charset == 'shift_jis' || $charset ==
'euc-jp' ||
+           ($squirrelmail_language == 'ja_JP' &&
+           ($charset == 'utf-8' || $charset == '' || $charset == 'us-ascii'))) {
+           $body = $languages['ja_JP']['XTRA_CODE']('decode', $body);
+           $charset_converted = true;
+        }
+    }
---

$charset_converted variable is not initialized. You need '$charset_converted =
false;' before 'if (!$charset_converted) {'

---
+    $charset_converted = false;
+    if (charset == 'iso-2022-jp' || $charset == 'shift_jis' || $charset ==
'euc-$jp' ||
+       ($squirrelmail_language == 'ja_JP' &&
+       ($charset == 'utf-8' || $charset == '' || $charset == 'us-ascii'))) {
+       $body = $languages['ja_JP']['XTRA_CODE']('decode', $body);
+        $charset_converted = true;
+    }
---


$charset variable is not set and all $charset = 'some-charset' tests are
questionable.

($charset == 'iso-2022-jp'  - always false
|| $charset == 'shift_jis' - always false
|| $charset == 'euc-jp'  - always false
||
($squirrelmail_language == 'ja_JP' && - true in Japanese translation
($charset == 'utf-8' || $charset == '' || $charset == 'us-ascii') - always true
))

Is there some Fedora bug report proving that correctly formated mime messages
need more than $charset_converted and Japanese translation test? If patch wanted
to test $default_charset var, then it still does not explain why Japanese extra
code is applied to US English translation.

---
+    $charset_converted = false;
+    if ($squirrelmail_language == 'ja_JP') {
+       $body = $languages['ja_JP']['XTRA_CODE']('decode', $body);
+       $charset_converted = true;
+    }
---

Please note that SquirrelMail guidelines require coding in PHP error_reporting=
E_ALL, display_errors=on and register_globals=off environment. Fedora patches
should be tested in such PHP setups. First two settings allow to catch
programming mistakes, third setting eliminates use of unchecked globals. If you
use SquirrelMail 1.4.7 or later, register_globals = on setups might behave
differently only when SquirrelMail core functions are not loaded or they are
loaded in incorrect order.
Comment 2 Nicolas Mailhot 2007-04-12 01:58:20 EDT

*** This bug has been marked as a duplicate of 235560 ***
Comment 3 Martin Bacovsky 2007-04-17 13:22:29 EDT
This issue was fixed in RAWHIDE, but patch cuasing it looks somehow wierd. It
will need some more investigation.
Comment 4 Martin Bacovsky 2007-04-24 08:19:00 EDT
Fianlly I removed parts modifying formatBody function from the ugly-hack patch.
Error messages no longer appear in log so I regard this issue as fixed. Feel
free to reopen this bug if errors reappear.

Fixed version is squirrelmail-1.4.9a-2.fc7 in RAWHIDE.
Comment 5 Zing 2008-04-04 00:35:50 EDT
*** Bug 204211 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.