Re: [MapServer-users] CGI variable "map" fails to validate

2024-03-06 Thread Lernout, Matthew via MapServer-users
I think I've stumbled into what is causing my issue.

I was making requests to the endpoint /cgi-bin/mapserv.exe? (which is what I 
used in 7.6.2)

When I change request to the endpoint /cgi-bin/? (no mapserv.exe) my requests 
work and validate as expected.

I'm not sure why this is the case - if I swap my FastCGI back to point to the 
7.6.2 module it serves requests at /mapserv.exe, but with 8.0.1 including the 
executable as part of the path causes issues with map validation.

In any case, I can work around this by updating all the web apps to point to 
the new path (maybe also add in a URL Rewrite).

Thanks,
Matt

-Original Message-
From: MapServer-users  On Behalf Of 
Lernout, Matthew via MapServer-users
Sent: Wednesday, March 6, 2024 5:29 PM
To: mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] CGI variable "map" fails to validate

So, still banging my head against this a month later after eliminating HTTPS as 
the bogeyman.

Using FastCGI and MapServer with the simplest config and what should be an 
"allow everything" test expression:

CONFIG
  ENV
   MS_MAP_PATTERN "."
  END
END

And all requests return:
msLoadMap(): Regular expression error. Filename validation failed.

BONUS: If I strip out the map variable from my request, I'd expect the error 
"CGI variable "map" is not set." but I still get "msLoadMap(): Regular 
expression error. Filename validation failed." even without providing a map! 
This is following IISRESET, and I know the config is being loaded (if I remove 
it, I get "msLoadConfig(): Unable to access file")

If I'm not supplying a map parameter in my request and it's not throwing an 
error that it's missing, what is being used for map value against the 
expression? (And how do I get it to read my variable in the request?)

Thanks for any direction,
Matt

-Original Message-
From: MapServer-users  On Behalf Of 
Lernout, Matthew via MapServer-users
Sent: Wednesday, February 7, 2024 3:32 PM
To: mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] CGI variable "map" fails to validate

Hi,

After scratching my head for a while, realized all my testing was over HTTPS. 
Made a localhost connection over HTTP and the map variable was then valid.
I was looking in the wrong place - the error reports a failed validation, but 
that's due to failed certificate trust from what I can see.
Thanks for helping me steer into the real issue - I now have a direction to 
move in!

Matt

-Original Message-
From: Rahkonen Jukka 
Sent: Wednesday, February 7, 2024 1:05 PM
To: Lernout, Matthew ; mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from jukka.rahko...@maanmittauslaitos.fi. Learn why 
this is important at https://aka.ms/LearnAboutSenderIdentification ]

Hi,

"." works for me.

I have a Windows env set first as
set MAPSERVER_CONFIG_FILE=\ms4w\ms4w.conf
These are the meaningful lines in the "ms4w.conf" file.
CONFIG
  ENV
   MS_MAP_PATTERN "."
  END
END

Test proves that validation is successful

http://localhost:8060/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map
msLoadMap(): Unable to access file. (f:\IMS_Maps\Client\projectarea.map)

-Jukka Rahkonen-


-Alkuperäinen viesti-
Lähettäjä: MapServer-users  Puolesta 
Lernout, Matthew via MapServer-users
Lähetetty: keskiviikko 7. helmikuuta 2024 19.01
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: Re: [MapServer-users] CGI variable "map" fails to validate

I've ensured I am restarting the mapserv process with each config change - a 
quick test of commenting out the MS_MAP_PATTERN variable confirmed that is 
enough to refresh the config via error.

Here's a snippet of a sample request. It works with my running instance of 
Mapserver 7.6.2 but doesn't pass validation (pattern '.') in MapServer 8.0.1.

/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map

Matt

-Original Message-----
From: Seth G 
Sent: Wednesday, February 7, 2024 11:48 AM
To: Lernout, Matthew ; MapServer Users 

Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from se...@geographika.co.uk. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

Hi Matthew,

The CONFIG file I think is only reloaded when IIS or the Application Pool is 
restarted, so some changes to the regex may have been ignored.
Do you have a sample request with the = parameter? Is there anything in a 
web.config file that could be stripping these out or modifying them?

Seth

--
web:https://geographika.net/ & https://mapserverstudio.net/
twitter: @geographika

On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote:
> MS_MAP_PATTERN '.' also results in the same failed validation error,
> which is what make

Re: [MapServer-users] CGI variable "map" fails to validate

2024-03-06 Thread Jan Hartmann via MapServer-users

Shouldn't it be ".*' ?

On 06/03/2024 23:29, Lernout, Matthew via MapServer-users wrote:

So, still banging my head against this a month later after eliminating HTTPS as 
the bogeyman.

Using FastCGI and MapServer with the simplest config and what should be an "allow 
everything" test expression:

CONFIG
   ENV
MS_MAP_PATTERN "."
   END
END

And all requests return:
msLoadMap(): Regular expression error. Filename validation failed.

BONUS: If I strip out the map variable from my request, I'd expect the error "CGI variable "map" is not 
set." but I still get "msLoadMap(): Regular expression error. Filename validation failed." even without 
providing a map! This is following IISRESET, and I know the config is being loaded (if I remove it, I get 
"msLoadConfig(): Unable to access file")

If I'm not supplying a map parameter in my request and it's not throwing an 
error that it's missing, what is being used for map value against the 
expression? (And how do I get it to read my variable in the request?)

Thanks for any direction,
Matt

-Original Message-
From: MapServer-users  On Behalf Of 
Lernout, Matthew via MapServer-users
Sent: Wednesday, February 7, 2024 3:32 PM
To: mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] CGI variable "map" fails to validate

Hi,

After scratching my head for a while, realized all my testing was over HTTPS. 
Made a localhost connection over HTTP and the map variable was then valid.
I was looking in the wrong place - the error reports a failed validation, but 
that's due to failed certificate trust from what I can see.
Thanks for helping me steer into the real issue - I now have a direction to 
move in!

Matt

-Original Message-
From: Rahkonen Jukka 
Sent: Wednesday, February 7, 2024 1:05 PM
To: Lernout, Matthew ; mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from jukka.rahko...@maanmittauslaitos.fi. Learn why 
this is important at https://aka.ms/LearnAboutSenderIdentification ]

Hi,

"." works for me.

I have a Windows env set first as
set MAPSERVER_CONFIG_FILE=\ms4w\ms4w.conf
These are the meaningful lines in the "ms4w.conf" file.
CONFIG
   ENV
MS_MAP_PATTERN "."
   END
END

Test proves that validation is successful

http://localhost:8060/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map
msLoadMap(): Unable to access file. (f:\IMS_Maps\Client\projectarea.map)

-Jukka Rahkonen-


-Alkuperäinen viesti-
Lähettäjä: MapServer-users  Puolesta 
Lernout, Matthew via MapServer-users
Lähetetty: keskiviikko 7. helmikuuta 2024 19.01
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: Re: [MapServer-users] CGI variable "map" fails to validate

I've ensured I am restarting the mapserv process with each config change - a 
quick test of commenting out the MS_MAP_PATTERN variable confirmed that is 
enough to refresh the config via error.

Here's a snippet of a sample request. It works with my running instance of 
Mapserver 7.6.2 but doesn't pass validation (pattern '.') in MapServer 8.0.1.

/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map

Matt

-Original Message-----
From: Seth G 
Sent: Wednesday, February 7, 2024 11:48 AM
To: Lernout, Matthew ; MapServer Users 

Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from se...@geographika.co.uk. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

Hi Matthew,

The CONFIG file I think is only reloaded when IIS or the Application Pool is 
restarted, so some changes to the regex may have been ignored.
Do you have a sample request with the = parameter? Is there anything in a 
web.config file that could be stripping these out or modifying them?

Seth

--
web:https://geographika.net/ & https://mapserverstudio.net/
twitter: @geographika

On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote:

MS_MAP_PATTERN '.' also results in the same failed validation error,
which is what makes me think the issue may be with another config
setting. '.' should match any input, right?

Just to make sure my config file was being loaded, I commented out the
MS_MAP_PATTERN entry entirely, and got the error "msCGILoadMap(): Web
application error. Required configuration value MS_MAP_PATTERN not set."

Matt

-Original Message-
From: MapServer-users  On
Behalf Of Jörg Thomsen (WhereGroup) via MapServer-users
Sent: Wednesday, February 7, 2024 3:24 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from mapserver-users@lists.osgeo.org. Learn
why this is important at https://aka.ms/LearnAboutSenderIdentification
]

Hi,

I'm not sure whether the pattern is correct. Shouldn't

Re: [MapServer-users] CGI variable "map" fails to validate

2024-03-06 Thread Lernout, Matthew via MapServer-users
So, still banging my head against this a month later after eliminating HTTPS as 
the bogeyman.

Using FastCGI and MapServer with the simplest config and what should be an 
"allow everything" test expression:

CONFIG
  ENV
   MS_MAP_PATTERN "."
  END
END

And all requests return:
msLoadMap(): Regular expression error. Filename validation failed.

BONUS: If I strip out the map variable from my request, I'd expect the error 
"CGI variable "map" is not set." but I still get "msLoadMap(): Regular 
expression error. Filename validation failed." even without providing a map! 
This is following IISRESET, and I know the config is being loaded (if I remove 
it, I get "msLoadConfig(): Unable to access file")

If I'm not supplying a map parameter in my request and it's not throwing an 
error that it's missing, what is being used for map value against the 
expression? (And how do I get it to read my variable in the request?)

Thanks for any direction,
Matt

-Original Message-
From: MapServer-users  On Behalf Of 
Lernout, Matthew via MapServer-users
Sent: Wednesday, February 7, 2024 3:32 PM
To: mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] CGI variable "map" fails to validate

Hi,

After scratching my head for a while, realized all my testing was over HTTPS. 
Made a localhost connection over HTTP and the map variable was then valid.
I was looking in the wrong place - the error reports a failed validation, but 
that's due to failed certificate trust from what I can see.
Thanks for helping me steer into the real issue - I now have a direction to 
move in!

Matt

-Original Message-
From: Rahkonen Jukka 
Sent: Wednesday, February 7, 2024 1:05 PM
To: Lernout, Matthew ; mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from jukka.rahko...@maanmittauslaitos.fi. Learn why 
this is important at https://aka.ms/LearnAboutSenderIdentification ]

Hi,

"." works for me.

I have a Windows env set first as
set MAPSERVER_CONFIG_FILE=\ms4w\ms4w.conf
These are the meaningful lines in the "ms4w.conf" file.
CONFIG
  ENV
   MS_MAP_PATTERN "."
  END
END

Test proves that validation is successful

http://localhost:8060/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map
msLoadMap(): Unable to access file. (f:\IMS_Maps\Client\projectarea.map)

-Jukka Rahkonen-


-Alkuperäinen viesti-
Lähettäjä: MapServer-users  Puolesta 
Lernout, Matthew via MapServer-users
Lähetetty: keskiviikko 7. helmikuuta 2024 19.01
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: Re: [MapServer-users] CGI variable "map" fails to validate

I've ensured I am restarting the mapserv process with each config change - a 
quick test of commenting out the MS_MAP_PATTERN variable confirmed that is 
enough to refresh the config via error.

Here's a snippet of a sample request. It works with my running instance of 
Mapserver 7.6.2 but doesn't pass validation (pattern '.') in MapServer 8.0.1.

/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map

Matt

-Original Message-
From: Seth G 
Sent: Wednesday, February 7, 2024 11:48 AM
To: Lernout, Matthew ; MapServer Users 

Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from se...@geographika.co.uk. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

Hi Matthew,

The CONFIG file I think is only reloaded when IIS or the Application Pool is 
restarted, so some changes to the regex may have been ignored.
Do you have a sample request with the = parameter? Is there anything in a 
web.config file that could be stripping these out or modifying them?

Seth

--
web:https://geographika.net/ & https://mapserverstudio.net/
twitter: @geographika

On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote:
> MS_MAP_PATTERN '.' also results in the same failed validation error,
> which is what makes me think the issue may be with another config
> setting. '.' should match any input, right?
>
> Just to make sure my config file was being loaded, I commented out the
> MS_MAP_PATTERN entry entirely, and got the error "msCGILoadMap(): Web
> application error. Required configuration value MS_MAP_PATTERN not set."
>
> Matt
>
> -Original Message-
> From: MapServer-users  On
> Behalf Of Jörg Thomsen (WhereGroup) via MapServer-users
> Sent: Wednesday, February 7, 2024 3:24 AM
> To: mapserver-users@lists.osgeo.org
> Subject: Re: [MapServer-users] CGI variable "map" fails to validate
>
> [You don't often get email from mapserver-users@lists.osgeo.org. Learn
> why this is important at https://aka.ms/LearnAboutSenderIdentification
> ]
>
> Hi,
>
> I'm not sure whether the pattern is corr

Re: [MapServer-users] CGI variable "map" fails to validate

2024-02-07 Thread Lernout, Matthew via MapServer-users
Hi,

After scratching my head for a while, realized all my testing was over HTTPS. 
Made a localhost connection over HTTP and the map variable was then valid.
I was looking in the wrong place - the error reports a failed validation, but 
that's due to failed certificate trust from what I can see.
Thanks for helping me steer into the real issue - I now have a direction to 
move in!

Matt

-Original Message-
From: Rahkonen Jukka 
Sent: Wednesday, February 7, 2024 1:05 PM
To: Lernout, Matthew ; mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from jukka.rahko...@maanmittauslaitos.fi. Learn why 
this is important at https://aka.ms/LearnAboutSenderIdentification ]

Hi,

"." works for me.

I have a Windows env set first as
set MAPSERVER_CONFIG_FILE=\ms4w\ms4w.conf
These are the meaningful lines in the "ms4w.conf" file.
CONFIG
  ENV
   MS_MAP_PATTERN "."
  END
END

Test proves that validation is successful

http://localhost:8060/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map
msLoadMap(): Unable to access file. (f:\IMS_Maps\Client\projectarea.map)

-Jukka Rahkonen-


-Alkuperäinen viesti-
Lähettäjä: MapServer-users  Puolesta 
Lernout, Matthew via MapServer-users
Lähetetty: keskiviikko 7. helmikuuta 2024 19.01
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: Re: [MapServer-users] CGI variable "map" fails to validate

I've ensured I am restarting the mapserv process with each config change - a 
quick test of commenting out the MS_MAP_PATTERN variable confirmed that is 
enough to refresh the config via error.

Here's a snippet of a sample request. It works with my running instance of 
Mapserver 7.6.2 but doesn't pass validation (pattern '.') in MapServer 8.0.1.

/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map

Matt

-Original Message-
From: Seth G 
Sent: Wednesday, February 7, 2024 11:48 AM
To: Lernout, Matthew ; MapServer Users 

Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from se...@geographika.co.uk. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

Hi Matthew,

The CONFIG file I think is only reloaded when IIS or the Application Pool is 
restarted, so some changes to the regex may have been ignored.
Do you have a sample request with the = parameter? Is there anything in a 
web.config file that could be stripping these out or modifying them?

Seth

--
web:https://geographika.net/ & https://mapserverstudio.net/
twitter: @geographika

On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote:
> MS_MAP_PATTERN '.' also results in the same failed validation error,
> which is what makes me think the issue may be with another config
> setting. '.' should match any input, right?
>
> Just to make sure my config file was being loaded, I commented out the
> MS_MAP_PATTERN entry entirely, and got the error "msCGILoadMap(): Web
> application error. Required configuration value MS_MAP_PATTERN not set."
>
> Matt
>
> -Original Message-
> From: MapServer-users  On
> Behalf Of Jörg Thomsen (WhereGroup) via MapServer-users
> Sent: Wednesday, February 7, 2024 3:24 AM
> To: mapserver-users@lists.osgeo.org
> Subject: Re: [MapServer-users] CGI variable "map" fails to validate
>
> [You don't often get email from mapserver-users@lists.osgeo.org. Learn
> why this is important at https://aka.ms/LearnAboutSenderIdentification
> ]
>
> Hi,
>
> I'm not sure whether the pattern is correct. Shouldn't ist start with ^?
>
> Have yout tried
> MS_MAP_PATTERN '.'? (not for production, just as a test)
>
> Jörg
>
> Am 06.02.24 um 20:12 schrieb Lernout, Matthew via MapServer-users:
>> Hi,
>>
>> Having trouble making requests since updating to 8.0.1 from 7.6.2.
>> Mapserver is running in IIS using FastCGI and the configuration steps
>> from:
>> https://maps/
>> erver.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40sta
>> n
>> tec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b4
>> d
>> 80281e7%7C0%7C0%7C638428910243090792%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
>> M
>> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7
>> C
>> =dh%2BpgGwk5996f0GEMeX7O8rcv5J81TnPzeFNZ9XoVLs%3D=0
>> <https://map/
>> server.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40st
>> a
>> ntec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b
>> 4
>> d80281e7%7C0%7C0%7C638428910243098246%7CUnknown%7CTWFpbGZsb3d8eyJWIjo
>> i
>> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%
>> 7
>> C=OIoWHSlKZJrXWspqwVfY5jhX4lzBcQuI%2Bw5IeOVtX

Re: [MapServer-users] CGI variable "map" fails to validate

2024-02-07 Thread Rahkonen Jukka via MapServer-users
Hi,

"." works for me.

I have a Windows env set first as
set MAPSERVER_CONFIG_FILE=\ms4w\ms4w.conf
These are the meaningful lines in the "ms4w.conf" file.
CONFIG
  ENV
   MS_MAP_PATTERN "."
  END
END

Test proves that validation is successful

http://localhost:8060/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map
msLoadMap(): Unable to access file. (f:\IMS_Maps\Client\projectarea.map)

-Jukka Rahkonen-


-Alkuperäinen viesti-
Lähettäjä: MapServer-users  Puolesta 
Lernout, Matthew via MapServer-users
Lähetetty: keskiviikko 7. helmikuuta 2024 19.01
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: Re: [MapServer-users] CGI variable "map" fails to validate

I've ensured I am restarting the mapserv process with each config change - a 
quick test of commenting out the MS_MAP_PATTERN variable confirmed that is 
enough to refresh the config via error.

Here's a snippet of a sample request. It works with my running instance of 
Mapserver 7.6.2 but doesn't pass validation (pattern '.') in MapServer 8.0.1.

/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map

Matt

-Original Message-
From: Seth G 
Sent: Wednesday, February 7, 2024 11:48 AM
To: Lernout, Matthew ; MapServer Users 

Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from se...@geographika.co.uk. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

Hi Matthew,

The CONFIG file I think is only reloaded when IIS or the Application Pool is 
restarted, so some changes to the regex may have been ignored.
Do you have a sample request with the = parameter? Is there anything in a 
web.config file that could be stripping these out or modifying them?

Seth

--
web:https://geographika.net/ & https://mapserverstudio.net/
twitter: @geographika

On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote:
> MS_MAP_PATTERN '.' also results in the same failed validation error,
> which is what makes me think the issue may be with another config
> setting. '.' should match any input, right?
>
> Just to make sure my config file was being loaded, I commented out the
> MS_MAP_PATTERN entry entirely, and got the error "msCGILoadMap(): Web
> application error. Required configuration value MS_MAP_PATTERN not set."
>
> Matt
>
> -Original Message-
> From: MapServer-users  On
> Behalf Of Jörg Thomsen (WhereGroup) via MapServer-users
> Sent: Wednesday, February 7, 2024 3:24 AM
> To: mapserver-users@lists.osgeo.org
> Subject: Re: [MapServer-users] CGI variable "map" fails to validate
>
> [You don't often get email from mapserver-users@lists.osgeo.org. Learn
> why this is important at https://aka.ms/LearnAboutSenderIdentification
> ]
>
> Hi,
>
> I'm not sure whether the pattern is correct. Shouldn't ist start with ^?
>
> Have yout tried
> MS_MAP_PATTERN '.'? (not for production, just as a test)
>
> Jörg
>
> Am 06.02.24 um 20:12 schrieb Lernout, Matthew via MapServer-users:
>> Hi,
>>
>> Having trouble making requests since updating to 8.0.1 from 7.6.2.
>> Mapserver is running in IIS using FastCGI and the configuration steps
>> from:
>> https://maps/
>> erver.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40sta
>> n
>> tec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b4
>> d
>> 80281e7%7C0%7C0%7C638428910243090792%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
>> M
>> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7
>> C
>> =dh%2BpgGwk5996f0GEMeX7O8rcv5J81TnPzeFNZ9XoVLs%3D=0
>> <https://map/
>> server.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40st
>> a
>> ntec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b
>> 4
>> d80281e7%7C0%7C0%7C638428910243098246%7CUnknown%7CTWFpbGZsb3d8eyJWIjo
>> i
>> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%
>> 7
>> C=OIoWHSlKZJrXWspqwVfY5jhX4lzBcQuI%2Bw5IeOVtXBA%3D=0>
>>
>> A new config file was added to the filesystem and server Environment
>> variables as per documented requirements added since 7.6.3, but
>> having trouble validating any map arguments. All requests return the
>> error "CGI variable "map" fails to validate" even though regexp
>> should pass based on expression tests.
>>
>> Here is the full config file in use:
>>
>> CONFIG
>>ENV
>>  MS_MAP_PATTERN "\.map$"
>>  PROJ_LIB "F:/MapServer/bin/proj7/SHARE"
>>  CURL_CA_BUNDLE "F:\MapServer\bin\curl\curl-ca-bundle.crt"
>>END
>>
>>
>>PLUGINS
>>  "mssql" &qu

Re: [MapServer-users] CGI variable "map" fails to validate

2024-02-07 Thread Lernout, Matthew via MapServer-users
I've ensured I am restarting the mapserv process with each config change - a 
quick test of commenting out the MS_MAP_PATTERN variable confirmed that is 
enough to refresh the config via error.

Here's a snippet of a sample request. It works with my running instance of 
Mapserver 7.6.2 but doesn't pass validation (pattern '.') in MapServer 8.0.1.

/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map

Matt

-Original Message-
From: Seth G 
Sent: Wednesday, February 7, 2024 11:48 AM
To: Lernout, Matthew ; MapServer Users 

Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from se...@geographika.co.uk. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

Hi Matthew,

The CONFIG file I think is only reloaded when IIS or the Application Pool is 
restarted, so some changes to the regex may have been ignored.
Do you have a sample request with the = parameter? Is there anything in a 
web.config file that could be stripping these out or modifying them?

Seth

--
web:https://geographika.net/ & https://mapserverstudio.net/
twitter: @geographika

On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote:
> MS_MAP_PATTERN '.' also results in the same failed validation error,
> which is what makes me think the issue may be with another config
> setting. '.' should match any input, right?
>
> Just to make sure my config file was being loaded, I commented out the
> MS_MAP_PATTERN entry entirely, and got the error "msCGILoadMap(): Web
> application error. Required configuration value MS_MAP_PATTERN not set."
>
> Matt
>
> -Original Message-
> From: MapServer-users  On
> Behalf Of Jörg Thomsen (WhereGroup) via MapServer-users
> Sent: Wednesday, February 7, 2024 3:24 AM
> To: mapserver-users@lists.osgeo.org
> Subject: Re: [MapServer-users] CGI variable "map" fails to validate
>
> [You don't often get email from mapserver-users@lists.osgeo.org. Learn
> why this is important at https://aka.ms/LearnAboutSenderIdentification
> ]
>
> Hi,
>
> I'm not sure whether the pattern is correct. Shouldn't ist start with ^?
>
> Have yout tried
> MS_MAP_PATTERN '.'? (not for production, just as a test)
>
> Jörg
>
> Am 06.02.24 um 20:12 schrieb Lernout, Matthew via MapServer-users:
>> Hi,
>>
>> Having trouble making requests since updating to 8.0.1 from 7.6.2.
>> Mapserver is running in IIS using FastCGI and the configuration steps
>> from:
>> https://maps/
>> erver.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40sta
>> n
>> tec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b4
>> d
>> 80281e7%7C0%7C0%7C638428910243090792%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
>> M
>> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7
>> C
>> =dh%2BpgGwk5996f0GEMeX7O8rcv5J81TnPzeFNZ9XoVLs%3D=0
>> <https://map/
>> server.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40st
>> a
>> ntec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b
>> 4
>> d80281e7%7C0%7C0%7C638428910243098246%7CUnknown%7CTWFpbGZsb3d8eyJWIjo
>> i
>> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%
>> 7
>> C=OIoWHSlKZJrXWspqwVfY5jhX4lzBcQuI%2Bw5IeOVtXBA%3D=0>
>>
>> A new config file was added to the filesystem and server Environment
>> variables as per documented requirements added since 7.6.3, but
>> having trouble validating any map arguments. All requests return the
>> error "CGI variable "map" fails to validate" even though regexp
>> should pass based on expression tests.
>>
>> Here is the full config file in use:
>>
>> CONFIG
>>ENV
>>  MS_MAP_PATTERN "\.map$"
>>  PROJ_LIB "F:/MapServer/bin/proj7/SHARE"
>>  CURL_CA_BUNDLE "F:\MapServer\bin\curl\curl-ca-bundle.crt"
>>END
>>
>>
>>PLUGINS
>>  "mssql" "F:/MapServer/bin/ms/plugins/mssql2008/msplugin_mssql2008.dll"
>>  "oci" "F:/MapServer/bin/ms/plugins/oci/msplugin_oracle.dll"
>>END
>> END
>>
>> The current MS_MAP_PATTERN is just a simplified test to confirm 8.0.1
>> working before I update to the real regexp, and my understanding is
>> it should map anything that ends in .map? But every map argument I
>> throw in (including verified working arguments for 7.6.2) result in a
>> failure to validate. Are there other crucial configurations missing
>> that are necessary to pass validation?
>>
>> Thanks,
>>
>> Matt
>>
>>
>> ___

Re: [MapServer-users] CGI variable "map" fails to validate

2024-02-07 Thread Seth G via MapServer-users
Hi Matthew,

The CONFIG file I think is only reloaded when IIS or the Application Pool is 
restarted, so some changes to the regex may have been ignored. 
Do you have a sample request with the = parameter? Is there anything in a 
web.config file that could be stripping these out or modifying them?

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote:
> MS_MAP_PATTERN '.' also results in the same failed validation error, 
> which is what makes me think the issue may be with another config 
> setting. '.' should match any input, right?
>
> Just to make sure my config file was being loaded, I commented out the 
> MS_MAP_PATTERN entry entirely, and got the error "msCGILoadMap(): Web 
> application error. Required configuration value MS_MAP_PATTERN not set."
>
> Matt
>
> -Original Message-
> From: MapServer-users  On 
> Behalf Of Jörg Thomsen (WhereGroup) via MapServer-users
> Sent: Wednesday, February 7, 2024 3:24 AM
> To: mapserver-users@lists.osgeo.org
> Subject: Re: [MapServer-users] CGI variable "map" fails to validate
>
> [You don't often get email from mapserver-users@lists.osgeo.org. Learn 
> why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Hi,
>
> I'm not sure whether the pattern is correct. Shouldn't ist start with ^?
>
> Have yout tried
> MS_MAP_PATTERN '.'? (not for production, just as a test)
>
> Jörg
>
> Am 06.02.24 um 20:12 schrieb Lernout, Matthew via MapServer-users:
>> Hi,
>>
>> Having trouble making requests since updating to 8.0.1 from 7.6.2.
>> Mapserver is running in IIS using FastCGI and the configuration steps
>> from:
>> https://maps/
>> erver.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40stan
>> tec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b4d
>> 80281e7%7C0%7C0%7C638428910243090792%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiM
>> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C
>> =dh%2BpgGwk5996f0GEMeX7O8rcv5J81TnPzeFNZ9XoVLs%3D=0
>> <https://map/
>> server.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40sta
>> ntec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b4
>> d80281e7%7C0%7C0%7C638428910243098246%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
>> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7
>> C=OIoWHSlKZJrXWspqwVfY5jhX4lzBcQuI%2Bw5IeOVtXBA%3D=0>
>>
>> A new config file was added to the filesystem and server Environment
>> variables as per documented requirements added since 7.6.3, but having
>> trouble validating any map arguments. All requests return the error
>> "CGI variable "map" fails to validate" even though regexp should pass
>> based on expression tests.
>>
>> Here is the full config file in use:
>>
>> CONFIG
>>ENV
>>  MS_MAP_PATTERN "\.map$"
>>  PROJ_LIB "F:/MapServer/bin/proj7/SHARE"
>>  CURL_CA_BUNDLE "F:\MapServer\bin\curl\curl-ca-bundle.crt"
>>END
>>
>>
>>PLUGINS
>>  "mssql" "F:/MapServer/bin/ms/plugins/mssql2008/msplugin_mssql2008.dll"
>>  "oci" "F:/MapServer/bin/ms/plugins/oci/msplugin_oracle.dll"
>>END
>> END
>>
>> The current MS_MAP_PATTERN is just a simplified test to confirm 8.0.1
>> working before I update to the real regexp, and my understanding is it
>> should map anything that ends in .map? But every map argument I throw
>> in (including verified working arguments for 7.6.2) result in a
>> failure to validate. Are there other crucial configurations missing
>> that are necessary to pass validation?
>>
>> Thanks,
>>
>> Matt
>>
>>
>> ___
>> MapServer-users mailing list
>> MapServer-users@lists.osgeo.org
>> https://list/
>> s.osgeo.org%2Fmailman%2Flistinfo%2Fmapserver-users=05%7C02%7Cmatt
>> .lernout%40stantec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c21
>> 9a469297d3f2b4d80281e7%7C0%7C0%7C638428910243105153%7CUnknown%7CTWFpbG
>> Zsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%
>> 3D%7C0%7C%7C%7C=c%2BjBl2NTy%2BIZxCYZmp0CLwa2ujlD%2BC%2BfzzIQgXKw
>> lyI%3D=0
>
> --
> Viele Grüße,
> Jörg Thomsen
>
> **
> Aufwind durch Wissen!
> Web-Seminare und Online-Schulungen
> bei der http://www.foss-academy.com/
> **
>
>
> Jörg Thomsen
> WhereGroup GmbH
> Bundesal

Re: [MapServer-users] CGI variable "map" fails to validate

2024-02-07 Thread Lernout, Matthew via MapServer-users
MS_MAP_PATTERN '.' also results in the same failed validation error, which is 
what makes me think the issue may be with another config setting. '.' should 
match any input, right?

Just to make sure my config file was being loaded, I commented out the 
MS_MAP_PATTERN entry entirely, and got the error "msCGILoadMap(): Web 
application error. Required configuration value MS_MAP_PATTERN not set."

Matt

-Original Message-
From: MapServer-users  On Behalf Of 
Jörg Thomsen (WhereGroup) via MapServer-users
Sent: Wednesday, February 7, 2024 3:24 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [MapServer-users] CGI variable "map" fails to validate

[You don't often get email from mapserver-users@lists.osgeo.org. Learn why this 
is important at https://aka.ms/LearnAboutSenderIdentification ]

Hi,

I'm not sure whether the pattern is correct. Shouldn't ist start with ^?

Have yout tried
MS_MAP_PATTERN '.'? (not for production, just as a test)

Jörg

Am 06.02.24 um 20:12 schrieb Lernout, Matthew via MapServer-users:
> Hi,
>
> Having trouble making requests since updating to 8.0.1 from 7.6.2.
> Mapserver is running in IIS using FastCGI and the configuration steps
> from:
> https://maps/
> erver.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40stan
> tec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b4d
> 80281e7%7C0%7C0%7C638428910243090792%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiM
> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C
> =dh%2BpgGwk5996f0GEMeX7O8rcv5J81TnPzeFNZ9XoVLs%3D=0
> <https://map/
> server.org%2Finstallation%2Fiis.html=05%7C02%7Cmatt.lernout%40sta
> ntec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c219a469297d3f2b4
> d80281e7%7C0%7C0%7C638428910243098246%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
> MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7
> C=OIoWHSlKZJrXWspqwVfY5jhX4lzBcQuI%2Bw5IeOVtXBA%3D=0>
>
> A new config file was added to the filesystem and server Environment
> variables as per documented requirements added since 7.6.3, but having
> trouble validating any map arguments. All requests return the error
> "CGI variable "map" fails to validate" even though regexp should pass
> based on expression tests.
>
> Here is the full config file in use:
>
> CONFIG
>ENV
>  MS_MAP_PATTERN "\.map$"
>  PROJ_LIB "F:/MapServer/bin/proj7/SHARE"
>  CURL_CA_BUNDLE "F:\MapServer\bin\curl\curl-ca-bundle.crt"
>END
>
>
>PLUGINS
>  "mssql" "F:/MapServer/bin/ms/plugins/mssql2008/msplugin_mssql2008.dll"
>  "oci" "F:/MapServer/bin/ms/plugins/oci/msplugin_oracle.dll"
>END
> END
>
> The current MS_MAP_PATTERN is just a simplified test to confirm 8.0.1
> working before I update to the real regexp, and my understanding is it
> should map anything that ends in .map? But every map argument I throw
> in (including verified working arguments for 7.6.2) result in a
> failure to validate. Are there other crucial configurations missing
> that are necessary to pass validation?
>
> Thanks,
>
> Matt
>
>
> ___
> MapServer-users mailing list
> MapServer-users@lists.osgeo.org
> https://list/
> s.osgeo.org%2Fmailman%2Flistinfo%2Fmapserver-users=05%7C02%7Cmatt
> .lernout%40stantec.com%7C34322cf56ae745f61ae908dc27b617c5%7C413c6f2c21
> 9a469297d3f2b4d80281e7%7C0%7C0%7C638428910243105153%7CUnknown%7CTWFpbG
> Zsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%
> 3D%7C0%7C%7C%7C=c%2BjBl2NTy%2BIZxCYZmp0CLwa2ujlD%2BC%2BfzzIQgXKw
> lyI%3D=0

--
Viele Grüße,
Jörg Thomsen

**
Aufwind durch Wissen!
Web-Seminare und Online-Schulungen
bei der http://www.foss-academy.com/
**


Jörg Thomsen
WhereGroup GmbH
Bundesallee 23
10717 Berlin
Germany

Tel: +49 (0)30 / 5130 278 74
Fax: +49 (0)30 / 5130 278 11

joerg.thom...@wheregroup.com
http://www.wheregroup.com/

Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885

---
Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com

___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users
 Caution: This email originated from outside of Stantec. Please take extra 
precaution.

 Attention: Ce courriel provient de l'extérieur de Stantec. Veuillez prendre 
des précautions supplémentaires.

 Atención: Este correo electrónico proviene de fuera de Stantec. Por favor, 
tome precauciones adicionales.
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] CGI variable "map" fails to validate

2024-02-07 Thread WhereGroup

Hi,

I'm not sure whether the pattern is correct. Shouldn't ist start with ^?

Have yout tried
MS_MAP_PATTERN '.'? (not for production, just as a test)

Jörg

Am 06.02.24 um 20:12 schrieb Lernout, Matthew via MapServer-users:

Hi,

Having trouble making requests since updating to 8.0.1 from 7.6.2.
Mapserver is running in IIS using FastCGI and the configuration steps 
from: https://mapserver.org/installation/iis.html 



A new config file was added to the filesystem and server Environment 
variables as per documented requirements added since 7.6.3, but having 
trouble validating any map arguments. All requests return the error "CGI 
variable "map" fails to validate" even though regexp should pass based 
on expression tests.


Here is the full config file in use:

CONFIG
   ENV
     MS_MAP_PATTERN "\.map$"
     PROJ_LIB "F:/MapServer/bin/proj7/SHARE"
     CURL_CA_BUNDLE "F:\MapServer\bin\curl\curl-ca-bundle.crt"
   END


   PLUGINS
     "mssql" "F:/MapServer/bin/ms/plugins/mssql2008/msplugin_mssql2008.dll"
     "oci" "F:/MapServer/bin/ms/plugins/oci/msplugin_oracle.dll"
   END
END

The current MS_MAP_PATTERN is just a simplified test to confirm 8.0.1 
working before I update to the real regexp, and my understanding is it 
should map anything that ends in .map? But every map argument I throw in 
(including verified working arguments for 7.6.2) result in a failure to 
validate. Are there other crucial configurations missing that are 
necessary to pass validation?


Thanks,

Matt


___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


--
Viele Grüße,
Jörg Thomsen

**
Aufwind durch Wissen!
Web-Seminare und Online-Schulungen
bei der www.foss-academy.com/
**


Jörg Thomsen
WhereGroup GmbH
Bundesallee 23
10717 Berlin
Germany

Tel: +49 (0)30 / 5130 278 74
Fax: +49 (0)30 / 5130 278 11

joerg.thom...@wheregroup.com
www.wheregroup.com

Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885

---
Folgen Sie der WhereGroup auf twitter: http://twitter.com/WhereGroup_com

___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [MapServer-users] CGI variable "map" fails to validate

2024-02-06 Thread Rahkonen Jukka via MapServer-users
Hi,

This one that is slightly edited from the MS4W config file works for me

MS_MAP_PATTERN 
"^(C:)?\/ms4w_data\/((?!\.{2})[_A-Za-z0-9\-\.]+\/{1})*([_A-Za-z0-9\-\.]+\.(map))$"

I am not a regexp expert but it seems like a slash must be escaped with a 
backslash.

-Jukka Rahkonen-

Lähettäjä: MapServer-users  Puolesta 
Lernout, Matthew via MapServer-users
Lähetetty: tiistai 6. helmikuuta 2024 21.13
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [MapServer-users] CGI variable "map" fails to validate

Hi,

Having trouble making requests since updating to 8.0.1 from 7.6.2.
Mapserver is running in IIS using FastCGI and the configuration steps from: 
https://mapserver.org/installation/iis.html

A new config file was added to the filesystem and server Environment variables 
as per documented requirements added since 7.6.3, but having trouble validating 
any map arguments. All requests return the error "CGI variable "map" fails to 
validate" even though regexp should pass based on expression tests.

Here is the full config file in use:

CONFIG
  ENV
MS_MAP_PATTERN "\.map$"
PROJ_LIB "F:/MapServer/bin/proj7/SHARE"
CURL_CA_BUNDLE "F:\MapServer\bin\curl\curl-ca-bundle.crt"
  END

  PLUGINS
"mssql" "F:/MapServer/bin/ms/plugins/mssql2008/msplugin_mssql2008.dll"
"oci" "F:/MapServer/bin/ms/plugins/oci/msplugin_oracle.dll"
  END
END

The current MS_MAP_PATTERN is just a simplified test to confirm 8.0.1 working 
before I update to the real regexp, and my understanding is it should map 
anything that ends in .map? But every map argument I throw in (including 
verified working arguments for 7.6.2) result in a failure to validate. Are 
there other crucial configurations missing that are necessary to pass 
validation?

Thanks,
Matt
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[MapServer-users] CGI variable "map" fails to validate

2024-02-06 Thread Lernout, Matthew via MapServer-users
Hi,

Having trouble making requests since updating to 8.0.1 from 7.6.2.
Mapserver is running in IIS using FastCGI and the configuration steps from: 
https://mapserver.org/installation/iis.html

A new config file was added to the filesystem and server Environment variables 
as per documented requirements added since 7.6.3, but having trouble validating 
any map arguments. All requests return the error "CGI variable "map" fails to 
validate" even though regexp should pass based on expression tests.

Here is the full config file in use:

CONFIG
  ENV
MS_MAP_PATTERN "\.map$"
PROJ_LIB "F:/MapServer/bin/proj7/SHARE"
CURL_CA_BUNDLE "F:\MapServer\bin\curl\curl-ca-bundle.crt"
  END

  PLUGINS
"mssql" "F:/MapServer/bin/ms/plugins/mssql2008/msplugin_mssql2008.dll"
"oci" "F:/MapServer/bin/ms/plugins/oci/msplugin_oracle.dll"
  END
END

The current MS_MAP_PATTERN is just a simplified test to confirm 8.0.1 working 
before I update to the real regexp, and my understanding is it should map 
anything that ends in .map? But every map argument I throw in (including 
verified working arguments for 7.6.2) result in a failure to validate. Are 
there other crucial configurations missing that are necessary to pass 
validation?

Thanks,
Matt
___
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] CGI variable "map" fails to validate.

2021-06-03 Thread Steve Lime via mapserver-users
I should note that 7.6.3 (also 7.4.5, 7.2.3 and 7.0.8) should make defining
a value for MS_MAP_PATTERN much simpler. We updated things to use two
filters instead of one. The first, MS_MAP_BAD_PATTERN, checks for
problematic character sequences in the map value, for example /./, /../ or
// and fails if there is a match. This means you don't have to account for
those with MS_MAP_PATTERN alone and you can just write something simple
like:

  MS_MAP_PATTERN "^\/etc\/mapserver"

You need to be running the latest version for this to work as intended and
of course that's strongly recommended.

--Steve


On Thu, Jun 3, 2021 at 8:12 AM Jeff McKenna via mapserver-users <
mapserver-users@lists.osgeo.org> wrote:

> Hi David,
>
> MS4W also uses PCRE for its regex engine, so Windows users will soon be
> facing these same issues as you (I'll be making this as easy as possible
> for the new Windows users).
>
> So to answer your question: I believe most users aren't yet aware of
> what regex engine they use, and, also I believe that the PCRE regex
> engine is used more frequently in the MapServer community than what is
> believed.  (most automated tests do not use PCRE, for example, even
> though it is so commonly used)
>
> I'm not sure if I have the answer that you need, but I wanted to give a
> perspective from the Windows side.
>
> -jeff
>
>
> --
> Jeff McKenna
> GatewayGeo: Developers of MS4W, MapServer Consulting and Training
> co-founder of FOSS4G
> http://gatewaygeo.com/
>
>
>
> On 2021-06-03 9:29 a.m., David Pavlíček via mapserver-users wrote:
> > Hi Steve,
> > your pattern works like a charm... escaped hyphen was the issue. I
> > tested the previous regex with regex101.com  and
> it
> > matches with no problems against most of the available variants except
> > PCRE. Which regex engine is suitable for a test against MapServer?
> >
> > Thank you.
> >
> > st 2. 6. 2021 v 15:16 odesílatel Steve Lime  > > napsal:
> >
> > Hi David: Presumably the Docker image is running the most recent
> > version of 7.4 which would have that pull request applied. That
> > said, I don't think it's the culprit here and I have seen some
> > issues with -'s where the MS_MAP_PATTERN expression compiles fine
> > but doesn't match as expected. Re-writing the expression to move the
> > - character can help. Try this:
> >
> >
> >
>  
> MS_MAP_PATTERN=^\/etc\/mapserver\/([^\.][-_A-Za-z0-9\.]+\/{1})*([-_A-Za-z0-9\.]+\.map)$
> >
> > --Steve
> >
> > On Wed, Jun 2, 2021 at 3:07 AM David Pavlíček via mapserver-users
> >  > > wrote:
> >
> > Hello,
> > I'm using camptocamp/mapserver:7.4 docker image to run mapserver
> > on our servers and I have recently encountered this error:
> >
> > [warn] [pid 25] mod_fcgid: stderr: msCGILoadMap(): Web
> > application error. CGI variable "map" fails to validate.
> > 2098 - 172.17.0.1 - - [02/Jun/2021:04:57:42 +] "GET
> >
>  
> /?map=/etc/mapserver/puobod/krpk-puobod-red.map=getcapabilities=WMS"
> >
> > In fact, any mapfile with hyphens won't work. They fail against
> > MS_MAP_PATTERN regex or something. This is strange because I
> > tested this regex and it works fine. Container MS ENV variables
> > look like this:
> >
> > MS_ERRORFILE=stderr
> >
>  
> MS_MAP_PATTERN=^\/etc\/mapserver\/([^\.][_A-Za-z0-9\-\.]+\/{1})*([_A-Za-z0-9\-\.]+\.map)$
> > MS_DEBUGLEVEL=0
> > MS_MAPFILE=/etc/mapserver/mapserver.map
> >
> > Maybe something related to this PR:
> > https://github.com/MapServer/MapServer/pull/6314
> > 
> >
> > Any suggestions about that? Renaming project is not an option
> > because they are referenced in many places outside of our direct
> > reach (GIS clients, servers, etc)
> >
> > Thanks, David
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] CGI variable "map" fails to validate.

2021-06-03 Thread Jeff McKenna via mapserver-users

Hi David,

MS4W also uses PCRE for its regex engine, so Windows users will soon be 
facing these same issues as you (I'll be making this as easy as possible 
for the new Windows users).


So to answer your question: I believe most users aren't yet aware of 
what regex engine they use, and, also I believe that the PCRE regex 
engine is used more frequently in the MapServer community than what is 
believed.  (most automated tests do not use PCRE, for example, even 
though it is so commonly used)


I'm not sure if I have the answer that you need, but I wanted to give a 
perspective from the Windows side.


-jeff


--
Jeff McKenna
GatewayGeo: Developers of MS4W, MapServer Consulting and Training
co-founder of FOSS4G
http://gatewaygeo.com/



On 2021-06-03 9:29 a.m., David Pavlíček via mapserver-users wrote:

Hi Steve,
your pattern works like a charm... escaped hyphen was the issue. I 
tested the previous regex with regex101.com  and it 
matches with no problems against most of the available variants except 
PCRE. Which regex engine is suitable for a test against MapServer?


Thank you.

st 2. 6. 2021 v 15:16 odesílatel Steve Lime > napsal:


Hi David: Presumably the Docker image is running the most recent
version of 7.4 which would have that pull request applied. That
said, I don't think it's the culprit here and I have seen some
issues with -'s where the MS_MAP_PATTERN expression compiles fine
but doesn't match as expected. Re-writing the expression to move the
- character can help. Try this:

  
MS_MAP_PATTERN=^\/etc\/mapserver\/([^\.][-_A-Za-z0-9\.]+\/{1})*([-_A-Za-z0-9\.]+\.map)$


--Steve

On Wed, Jun 2, 2021 at 3:07 AM David Pavlíček via mapserver-users
mailto:mapserver-users@lists.osgeo.org>> wrote:

Hello,
I'm using camptocamp/mapserver:7.4 docker image to run mapserver
on our servers and I have recently encountered this error:

[warn] [pid 25] mod_fcgid: stderr: msCGILoadMap(): Web
application error. CGI variable "map" fails to validate.
2098 - 172.17.0.1 - - [02/Jun/2021:04:57:42 +] "GET

/?map=/etc/mapserver/puobod/krpk-puobod-red.map=getcapabilities=WMS"

In fact, any mapfile with hyphens won't work. They fail against
MS_MAP_PATTERN regex or something. This is strange because I
tested this regex and it works fine. Container MS ENV variables
look like this:

MS_ERRORFILE=stderr

MS_MAP_PATTERN=^\/etc\/mapserver\/([^\.][_A-Za-z0-9\-\.]+\/{1})*([_A-Za-z0-9\-\.]+\.map)$
MS_DEBUGLEVEL=0
MS_MAPFILE=/etc/mapserver/mapserver.map

Maybe something related to this PR:
https://github.com/MapServer/MapServer/pull/6314


Any suggestions about that? Renaming project is not an option
because they are referenced in many places outside of our direct
reach (GIS clients, servers, etc)

Thanks, David

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] CGI variable "map" fails to validate.

2021-06-03 Thread David Pavlíček via mapserver-users
Hi Steve,
your pattern works like a charm... escaped hyphen was the issue. I tested
the previous regex with regex101.com and it matches with no problems
against most of the available variants except PCRE. Which regex engine is
suitable for a test against MapServer?

Thank you.

st 2. 6. 2021 v 15:16 odesílatel Steve Lime  napsal:

> Hi David: Presumably the Docker image is running the most recent version
> of 7.4 which would have that pull request applied. That said, I don't think
> it's the culprit here and I have seen some issues with -'s where the
> MS_MAP_PATTERN expression compiles fine but doesn't match as expected.
> Re-writing the expression to move the - character can help. Try this:
>
>
> MS_MAP_PATTERN=^\/etc\/mapserver\/([^\.][-_A-Za-z0-9\.]+\/{1})*([-_A-Za-z0-9\.]+\.map)$
>
> --Steve
>
> On Wed, Jun 2, 2021 at 3:07 AM David Pavlíček via mapserver-users <
> mapserver-users@lists.osgeo.org> wrote:
>
>> Hello,
>> I'm using camptocamp/mapserver:7.4 docker image to run mapserver on our
>> servers and I have recently encountered this error:
>>
>> [warn] [pid 25] mod_fcgid: stderr: msCGILoadMap(): Web application error.
>> CGI variable "map" fails to validate.
>> 2098 - 172.17.0.1 - - [02/Jun/2021:04:57:42 +] "GET
>> /?map=/etc/mapserver/puobod/krpk-puobod-red.map=getcapabilities=WMS"
>>
>> In fact, any mapfile with hyphens won't work. They fail against
>> MS_MAP_PATTERN regex or something. This is strange because I tested this
>> regex and it works fine. Container MS ENV variables look like this:
>>
>> MS_ERRORFILE=stderr
>>
>> MS_MAP_PATTERN=^\/etc\/mapserver\/([^\.][_A-Za-z0-9\-\.]+\/{1})*([_A-Za-z0-9\-\.]+\.map)$
>> MS_DEBUGLEVEL=0
>> MS_MAPFILE=/etc/mapserver/mapserver.map
>>
>> Maybe something related to this PR:
>> https://github.com/MapServer/MapServer/pull/6314
>>
>> Any suggestions about that? Renaming project is not an option because
>> they are referenced in many places outside of our direct reach (GIS
>> clients, servers, etc)
>>
>> Thanks, David
>> ___
>> mapserver-users mailing list
>> mapserver-users@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] CGI variable "map" fails to validate.

2021-06-02 Thread Steve Lime via mapserver-users
Hi David: Presumably the Docker image is running the most recent version of
7.4 which would have that pull request applied. That said, I don't think
it's the culprit here and I have seen some issues with -'s where the
MS_MAP_PATTERN expression compiles fine but doesn't match as expected.
Re-writing the expression to move the - character can help. Try this:


MS_MAP_PATTERN=^\/etc\/mapserver\/([^\.][-_A-Za-z0-9\.]+\/{1})*([-_A-Za-z0-9\.]+\.map)$

--Steve

On Wed, Jun 2, 2021 at 3:07 AM David Pavlíček via mapserver-users <
mapserver-users@lists.osgeo.org> wrote:

> Hello,
> I'm using camptocamp/mapserver:7.4 docker image to run mapserver on our
> servers and I have recently encountered this error:
>
> [warn] [pid 25] mod_fcgid: stderr: msCGILoadMap(): Web application error.
> CGI variable "map" fails to validate.
> 2098 - 172.17.0.1 - - [02/Jun/2021:04:57:42 +] "GET
> /?map=/etc/mapserver/puobod/krpk-puobod-red.map=getcapabilities=WMS"
>
> In fact, any mapfile with hyphens won't work. They fail against
> MS_MAP_PATTERN regex or something. This is strange because I tested this
> regex and it works fine. Container MS ENV variables look like this:
>
> MS_ERRORFILE=stderr
>
> MS_MAP_PATTERN=^\/etc\/mapserver\/([^\.][_A-Za-z0-9\-\.]+\/{1})*([_A-Za-z0-9\-\.]+\.map)$
> MS_DEBUGLEVEL=0
> MS_MAPFILE=/etc/mapserver/mapserver.map
>
> Maybe something related to this PR:
> https://github.com/MapServer/MapServer/pull/6314
>
> Any suggestions about that? Renaming project is not an option because they
> are referenced in many places outside of our direct reach (GIS clients,
> servers, etc)
>
> Thanks, David
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] CGI variable "map" fails to validate.

2021-06-02 Thread David Pavlíček via mapserver-users
Hello,
I'm using camptocamp/mapserver:7.4 docker image to run mapserver on our
servers and I have recently encountered this error:

[warn] [pid 25] mod_fcgid: stderr: msCGILoadMap(): Web application error.
CGI variable "map" fails to validate.
2098 - 172.17.0.1 - - [02/Jun/2021:04:57:42 +] "GET
/?map=/etc/mapserver/puobod/krpk-puobod-red.map=getcapabilities=WMS"

In fact, any mapfile with hyphens won't work. They fail against
MS_MAP_PATTERN regex or something. This is strange because I tested this
regex and it works fine. Container MS ENV variables look like this:

MS_ERRORFILE=stderr
MS_MAP_PATTERN=^\/etc\/mapserver\/([^\.][_A-Za-z0-9\-\.]+\/{1})*([_A-Za-z0-9\-\.]+\.map)$
MS_DEBUGLEVEL=0
MS_MAPFILE=/etc/mapserver/mapserver.map

Maybe something related to this PR:
https://github.com/MapServer/MapServer/pull/6314

Any suggestions about that? Renaming project is not an option because they
are referenced in many places outside of our direct reach (GIS clients,
servers, etc)

Thanks, David
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users