You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/03/25 20:49:00 UTC

DO NOT REPLY [Bug 39105] New: - ssi set var value non latin1 characters makes include virtual cgi to fail

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39105>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39105

           Summary: ssi set var value non latin1 characters makes include
                    virtual cgi to fail
           Product: Apache httpd-2
           Version: 2.0.55
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_include
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: unr303@mail.ru


------------------ cut here: test.cgi
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "in cgi"
------------------ cut here: static.html
in static
------------------ cut here: doesnt_works.html
<!--#set var="xxx" value="&#1078;&#1086;&#1087;&#1072;" -->
variable content: <!--#echo var="xxx" -->
<hr>
trying to include cgi:
<!--#include virtual="/cgi-bin/test.cgi" -->
<hr>
trying to include static:
<!--#include virtual="static.html" -->
------------------ cut here: works.html
<!--#set var="xxx" value="jopa" -->
variable content: <!--#echo var="xxx" -->
<hr>
trying to include cgi:
<!--#include virtual="/cgi-bin/test.cgi" -->
<hr>
trying to include static:
<!--#include virtual="static.html" -->
------------------ cut here: result with doesnt_works.html
variable content: &#1078;&#1086;&#1087;&#1072; 
trying to include cgi: [an error occurred while processing this directive] 
trying to include static: in static
------------------ cut here: result with works.html
variable content: jopa 
trying to include cgi: in cgi 
trying to include static: in static
------------------
As you can see difference is only non-latin1 characters in value of variable.
That is pretty bizzare.
Please dont tell me that using bash or cgi is bad/illegal/crazy/etc.
Please dont tell me that legacy codepages sux because it sux to write russian
language website for russians in &$XYZ;
This problem i observed on all apache 2 versions i saw.
------------------ cut here: error_log
(22)Invalid argument: utf8 to ucs2 conversion failed on this string:
xxx=\xe6\xee\xef\xe0
(22)Invalid argument: couldn't create child process: 22: test.cgi, referer:
doesnt_works.html
(22)Invalid argument: couldn't spawn child process: D:/WWW/cgi/test.cgi,
referer: doesnt_works.html
mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter
removed, referer: doesnt_works.html
unable to include "/cgi-bin/test.cgi" in parsed file
D:/WWW/bug/doesnt_works.html, referer: doesnt_works.html
------------------ cut here: apache -V
Server version: Apache/2.0.55
Server built:   Oct  9 2005 19:16:56
Server's Module Magic Number: 20020903:11
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/winnt"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/apache"
 -D SUEXEC_BIN="/apache/bin/suexec"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error.log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39105] - ssi set var value non latin1 characters makes include virtual cgi to fail

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39105>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39105


wrowe@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|bugs@httpd.apache.org       |bugs@apr.apache.org
             Status|NEEDINFO                    |NEW




------- Additional Comments From wrowe@apache.org  2006-09-19 19:54 -------
Mass reassign the 44 open apr-bugs to apr bug list

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39105] - ssi set var value non latin1 characters makes include virtual cgi to fail

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39105>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39105


nick@webthing.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From nick@webthing.com  2006-03-25 21:11 -------
Erm, your example uses /bin/bash, and looks unlikely to be tied to any 
operating system.  Why did you mark it "windows 2000"?  Are you using cygwin 
or other *X layer? 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39105] - ssi set var value non latin1 characters makes include virtual cgi to fail

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39105>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39105





------- Additional Comments From unr303@mail.ru  2006-03-26 13:30 -------
Created an attachment (id=17984)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=17984&action=view)
test case in utf8

Writing file in unicode solves problem but one cant mix unicode and other
1-byte charsets in file. And koi8-r and cp1251 are main charsets for russian
internet while uniode in uncommon.
There is nothing in
http://httpd.apache.org/docs/2.0/env.html
http://httpd.apache.org/docs/2.0/howto/ssi.html
http://httpd.apache.org/docs/2.0/mod/mod_include.html
about utf8.
Even if we close eyes on charsets and so then there is still strange behaviour
of apache:
- why httpd can include static html files while there are non latin1 symbols in
non utf8 in variables?
- why httpd can successfully assign and print these variables?
- why httpd talks about "mod_include: Options +Includes (or IncludesNoExec)
wasn't set, INCLUDES filter removed, referer: doesnt_works.html" in log file?
does it removes filter when it find attempt to include cgi while there are non
latin1 characters in non utf8 in enviroment variables?
- why this happens in windows only? :) (at least in linux it does works with
variables in any charset)

PS: it is nothing related to bash, same problem is with python also. httpd
doesnt even start cgi - that you can see by creating some file in that cgi so
you will see that no file will be created.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39105] - ssi set var value non latin1 characters makes include virtual cgi to fail

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39105>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39105





------- Additional Comments From rpluem@apache.org  2006-03-26 15:55 -------
(In reply to comment #5)
> Created an attachment (id=17984)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=17984&action=view) [edit]
> test case in utf8
> 
> Writing file in unicode solves problem but one cant mix unicode and other

Ok. At least my thoughs have been correct.

> 1-byte charsets in file. And koi8-r and cp1251 are main charsets for russian
> internet while uniode in uncommon.
> There is nothing in
> http://httpd.apache.org/docs/2.0/env.html
> http://httpd.apache.org/docs/2.0/howto/ssi.html
> http://httpd.apache.org/docs/2.0/mod/mod_include.html
> about utf8.

Actually it would have to be in the documentation of mod_cgi. But I admit that
it is not mentioned there.

> Even if we close eyes on charsets and so then there is still strange behaviour
> of apache:
> - why httpd can include static html files while there are non latin1 symbols in
> non utf8 in variables?
> - why httpd can successfully assign and print these variables?
> - why httpd talks about "mod_include: Options +Includes (or IncludesNoExec)
> wasn't set, INCLUDES filter removed, referer: doesnt_works.html" in log file?
> does it removes filter when it find attempt to include cgi while there are non
> latin1 characters in non utf8 in enviroment variables?
> - why this happens in windows only? :) (at least in linux it does works with
> variables in any charset)

This is because you try to execute an cgi script. The variables set via
mod_include get exported to the environment of the cgi script to be run by
mod_cgi. On Windows the values of these environment variables are expected to be
UTF-8 encoded and they will be reencoded to UCS2 before executing the script. As
this fails several error messages get written to the log file. I admit that they
are confusing. The only relevant one is the first:

(22)Invalid argument: utf8 to ucs2 conversion failed on this string:
xxx=\xe6\xee\xef\xe0

The others get created up in the call stack, because apr_conv_utf8_to_ucs2
called by apr_proc_create failed to convert the environment variables. This
causes apr_proc_create to fail and so on.

> 
> PS: it is nothing related to bash, same problem is with python also. httpd
> doesnt even start cgi - that you can see by creating some file in that cgi so
> you will see that no file will be created.

Absolutely


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39105] - ssi set var value non latin1 characters makes include virtual cgi to fail

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39105>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39105





------- Additional Comments From rpluem@apache.org  2006-03-26 12:12 -------
(In reply to comment #3)

> expects the environment variables UTF-8 encoded. Using the windows notepad might

This was not exact: On Windows httpd expects the environment variables to be
UTF-8 encoded.
So please save your attached file via notepad as UTF-8 file an try again.



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39105] - ssi set var value non latin1 characters makes include virtual cgi to fail

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39105>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39105





------- Additional Comments From unr303@mail.ru  2006-03-25 19:52 -------
Created an attachment (id=17981)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=17981&action=view)
test case with original letters (non &#XYZ;)


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39105] - ssi set var value non latin1 characters makes include virtual cgi to fail

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39105>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39105





------- Additional Comments From nick@webthing.com  2006-03-26 16:22 -------
(In reply to comment #5) 
 
> PS: it is nothing related to bash, same problem is with python also. httpd 
> doesnt even start cgi - that you can see by creating some file in that cgi 
so 
> you will see that no file will be created. 
 
Yes, my question was because you'd said windows, but using bash under that 
seemed incongruous. 
 
This could be fixed by making failure to encode a CGI variable a nonfatal 
error.  Not sure how best to do that: it may have security implications 
that'll need thinking through. 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39105] - ssi set var value non latin1 characters makes include virtual cgi to fail

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39105>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39105


rpluem@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|mod_include                 |APR
            Product|Apache httpd-2              |APR
            Version|2.0.55                      |0.9.7




------- Additional Comments From rpluem@apache.org  2006-03-26 18:39 -------
Changing product to APR since this is a problem of apr_proc_create on Windows

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 39105] - ssi set var value non latin1 characters makes include virtual cgi to fail

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39105>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39105





------- Additional Comments From rpluem@apache.org  2006-03-26 12:08 -------
You guess you must encode your russian special characters as UTF-8 as httpd
expects the environment variables UTF-8 encoded. Using the windows notepad might
be an option as you can save files that you created in your local encoding as
UTF8 files.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org