[Mono-bugs] [Bug 510735] New: Location path is not verified to be a relative path

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Jun 6 04:26:32 EDT 2009


           Summary: Location path is not verified to be a relative path
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Web
        AssignedTo: mhabersack at novell.com
        ReportedBy: gert.driesen at pandora.be
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
Trident/4.0; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 1.0.3705; .NET CLR
3.0.04506.30; .NET CLR 3.0.04506.590; .NET CLR 3.0.04506.648; .NET CLR
3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

MS verifies whether the value of <location> path is a relative path. It rejects
paths that start with '/', '\', ' ' or '.'.

Reproducible: Always

Steps to Reproduce:
Compile the following code:

using System;
using System.Configuration;
using System.Globalization;
using System.IO;
using System.Web.Configuration;

class Program
    static string config_xml_template = 
        @"<?xml version='1.0' ?>
            <location path='/{0}' />

    static int Main (string [] args)
        if (args.Length != 1) {
            Console.WriteLine ("Please specify the locationPath to use.");
            return 1;

        return RunTest (args [0]);

    static int RunTest (string locationPath)
        string basedir = AppDomain.CurrentDomain.BaseDirectory;
            string.Format (config_xml_template, locationPath));

        try {
            WebConfigurationManager.GetSection ("location");
            Console.WriteLine ("FAILED");
            return 1;
        } catch (ConfigurationErrorsException ex) {
            Console.WriteLine ("SUCCESS: " + ex.ToString ());

        return 0;

and run it:

mono test.exe "/admin"
mono test.exe "\admin"
mono test.exe ".admin"
mono test.exe " admin"

Actual Results:  
Each execution should result in the output of "FAILED".

Expected Results:  
Each execution should result in the following (partial) output:

SUCCESS: System.Configuration.ConfigurationErrorsException: Configuration
 failed to initialize ---> System.Configuration.ConfigurationErrorsException:
ocation> path attribute must be a relative virtual path.  It cannot start with
ny of ' ' '.' '/' or '\'. (test.exe.config line 3)

Configure bugmail: http://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