[Mono-bugs] [Bug 678473] New: HttpResponse.WriteFile maps files to absolute path

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Mar 10 06:05:54 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=678473

https://bugzilla.novell.com/show_bug.cgi?id=678473#c0


           Summary: HttpResponse.WriteFile maps files to absolute path
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.10.x
          Platform: x86-64
        OS/Version: openSUSE 11.3
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: max.karavaev at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.13
(KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13

HttpResponse.WriteFile(string) method maps files path to absolute path.
For example I have file "style.css" in root directory of my website.

In MS ASP.Net and in mono 2.6.x and older this part of code works just fine:
string filePath = Server.MapPath("/style.css");
// filePath = /srv/www/vhosts/mysite.com/style.css
Response.WriteFile(filePath);

But in Mono 2.10.1 this part of code returns error:
Could not find file
"/srv/www/vhosts/mysite.com/srv/www/vhosts/mysite.com/style.css".

Description: HTTP 500. Error processing request.

Stack Trace:

System.IO.FileNotFoundException: Could not find file
"/srv/www/vhosts/mysite.com/srv/www/vhosts/mysite.com/style.css".
File name: '/srv/www/vhosts/mysite.com/srv/www/vhosts/mysite.com/style.css'
  at System.IO.FileInfo.get_Length () [0x00038] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/corlib/System.IO/FileInfo.cs:154 
  at (wrapper remoting-invoke-with-check) System.IO.FileInfo:get_Length ()
  at System.Web.HttpResponse.WriteFile (System.String filename, Boolean
readIntoMemory) [0x00053] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.Web/System.Web/HttpResponse.cs:1145 
  at System.Web.HttpResponse.WriteFile (System.String filename) [0x00000] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.Web/System.Web/HttpResponse.cs:1131 
  at ASP.portadmin_tinymce3_tiny_mce_gzip_aspx.__RenderTree
(System.Web.UI.HtmlTextWriter __output, System.Web.UI.Control
parameterContainer) [0x00000] in <filename unknown>:0 
  at System.Web.UI.Control.RenderChildren (System.Web.UI.HtmlTextWriter writer)
[0x0000b] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.Web/System.Web.UI/Control.cs:1333 
  at System.Web.UI.Control.Render (System.Web.UI.HtmlTextWriter writer)
[0x00000] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.Web/System.Web.UI/Control.cs:1327 
  at System.Web.UI.Page.Render (System.Web.UI.HtmlTextWriter writer) [0x00172]
in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.Web/System.Web.UI/Page.cs:1065 
  at System.Web.UI.Control.RenderControl (System.Web.UI.HtmlTextWriter writer)
[0x0005f] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.Web/System.Web.UI/Control.cs:1498 
  at System.Web.UI.Page.RenderPage () [0x00032] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.Web/System.Web.UI/Page.cs:1548 
  at System.Web.UI.Page.InternalProcessRequest () [0x001d7] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.Web/System.Web.UI/Page.cs:1443 
  at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context)
[0x0005b] in
/usr/src/packages/BUILD/mono-2.10.1/mcs/class/System.Web/System.Web.UI/Page.cs:1260 

Reproducible: Always

Steps to Reproduce:
1.
2.
3.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list