From 7ba469cd9ad21b59c3c59316d5df2cf9ed9bbd14 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Mon, 20 Sep 2010 16:50:12 -0700 Subject: [PATCH] Security patch for MSA 2416728 --- .../Orchard.Azure.Web/Error.aspx | 27 +++++++++++++++++++ .../Orchard.Azure.Web.csproj | 1 + .../Orchard.Azure.Web/Web.config | 22 ++++++++++++++- src/Orchard.Specs/Orchard.Specs.csproj | 1 + src/Orchard.Web/Error.aspx | 27 +++++++++++++++++++ src/Orchard.Web/Orchard.Web.csproj | 1 + src/Orchard.Web/Web.config | 22 ++++++++++++++- src/Orchard/Mvc/Results/NotFoundResult.cs | 12 +++------ 8 files changed, 102 insertions(+), 11 deletions(-) create mode 100644 src/Orchard.Azure/Orchard.Azure.Web/Error.aspx create mode 100644 src/Orchard.Web/Error.aspx diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Error.aspx b/src/Orchard.Azure/Orchard.Azure.Web/Error.aspx new file mode 100644 index 000000000..452b1c914 --- /dev/null +++ b/src/Orchard.Azure/Orchard.Azure.Web/Error.aspx @@ -0,0 +1,27 @@ +<%@ Page Language="C#" AutoEventWireup="true" %> +<%@ Import Namespace="System.Security.Cryptography" %> +<%@ Import Namespace="System.Threading" %> + + + + + + Error + + +
+ An error occurred while processing your request. +
+ + diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj b/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj index 839984b42..9e3c0fbba 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj +++ b/src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj @@ -146,6 +146,7 @@ + diff --git a/src/Orchard.Azure/Orchard.Azure.Web/Web.config b/src/Orchard.Azure/Orchard.Azure.Web/Web.config index 20f62d942..4115babc6 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/Web.config +++ b/src/Orchard.Azure/Orchard.Azure.Web/Web.config @@ -87,7 +87,7 @@ it enables developers to configure html error pages to be displayed in place of a error stack trace. --> - + @@ -100,6 +100,16 @@ + + + + + + + + + + @@ -113,6 +123,16 @@ + + + + + + + + + + diff --git a/src/Orchard.Specs/Orchard.Specs.csproj b/src/Orchard.Specs/Orchard.Specs.csproj index 969840a8e..09e776726 100644 --- a/src/Orchard.Specs/Orchard.Specs.csproj +++ b/src/Orchard.Specs/Orchard.Specs.csproj @@ -182,6 +182,7 @@ Always + Designer Always diff --git a/src/Orchard.Web/Error.aspx b/src/Orchard.Web/Error.aspx new file mode 100644 index 000000000..452b1c914 --- /dev/null +++ b/src/Orchard.Web/Error.aspx @@ -0,0 +1,27 @@ +<%@ Page Language="C#" AutoEventWireup="true" %> +<%@ Import Namespace="System.Security.Cryptography" %> +<%@ Import Namespace="System.Threading" %> + + + + + + Error + + +
+ An error occurred while processing your request. +
+ + diff --git a/src/Orchard.Web/Orchard.Web.csproj b/src/Orchard.Web/Orchard.Web.csproj index 7a6026c30..0b1c07150 100644 --- a/src/Orchard.Web/Orchard.Web.csproj +++ b/src/Orchard.Web/Orchard.Web.csproj @@ -97,6 +97,7 @@
+ diff --git a/src/Orchard.Web/Web.config b/src/Orchard.Web/Web.config index 20f62d942..70630dc0f 100644 --- a/src/Orchard.Web/Web.config +++ b/src/Orchard.Web/Web.config @@ -87,7 +87,7 @@ it enables developers to configure html error pages to be displayed in place of a error stack trace. --> - + @@ -100,6 +100,16 @@ + + + + + + + + + + @@ -113,6 +123,16 @@ + + + + + + + + + + diff --git a/src/Orchard/Mvc/Results/NotFoundResult.cs b/src/Orchard/Mvc/Results/NotFoundResult.cs index a051aebc2..b3dd75778 100644 --- a/src/Orchard/Mvc/Results/NotFoundResult.cs +++ b/src/Orchard/Mvc/Results/NotFoundResult.cs @@ -1,17 +1,11 @@ +using System.Net; +using System.Web; using System.Web.Mvc; namespace Orchard.Mvc.Results { public class NotFoundResult : ViewResult { public override void ExecuteResult(ControllerContext context) { - ViewName = "NotFound"; - - ViewData = context.Controller.ViewData; - TempData = context.Controller.TempData; - - base.ExecuteResult(context); - - context.HttpContext.Response.StatusDescription = "File Not Found"; - context.HttpContext.Response.StatusCode = 404; + throw new HttpException((int)HttpStatusCode.NotFound, "Resource not found"); } } } \ No newline at end of file