Skip to content

Update PROJ_DATA and MS_MAP_BAD_PATTERN #1020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions en/installation/iis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ copied in:
# MS_MAP_PATTERN "^(C:)?\/MapServer\/apps\/((?!\.{2})[_A-Za-z0-9\-\.]+\/{1})*([_A-Za-z0-9\-\.]+\.(map))$"

# path to the Proj4 projection files
PROJ_LIB "C:/MapServer/bin/proj7/SHARE"
PROJ_DATA "C:/MapServer/bin/proj9/SHARE"

# point to the certs file for HTTPS access to OWS servers
CURL_CA_BUNDLE "C:\MapServer\bin\curl\curl-ca-bundle.crt"
Expand Down Expand Up @@ -244,7 +244,7 @@ Now create a new `test.map` file in this folder and paste in the test Mapfile be
MAP
EXTENT -180 -90 180 90
# Set the path to where the map projections are stored
CONFIG "PROJ_LIB" "C:\MapServer\bin\proj\SHARE"
CONFIG "PROJ_DATA" "C:\MapServer\bin\proj\SHARE"
NAME "TestMap"
WEB
METADATA
Expand Down Expand Up @@ -442,9 +442,9 @@ Common error messages and how to resolve them are listed below.

msLoadMap(): Unable to access file. (C:/MapServer/apps/test/test.map)

+ MapServer projections are stored in ``C:\MapServer\bin\proj\SHARE`` (or ``C:\MapServer\bin\proj6\SHARE`` when using PROJ 6). When the projection is specified
+ MapServer projections are stored in ``C:\MapServer\bin\proj\SHARE`` (or ``C:\MapServer\bin\proj9\SHARE`` when using PROJ 9). When the projection is specified
in the following form `"init=epsg:3857"`, MapServer will try to find this code in the `epsg` file, where it is listed as `<3857> +proj=merc +a=6378137...`.
If you receive the error below then make sure the ``CONFIG "PROJ_LIB" "C:\MapServer\bin\proj\SHARE"`` setting is pointing to the correct path.
If you receive the error below then make sure the ``CONFIG "PROJ_DATA" "C:\MapServer\bin\proj\SHARE"`` setting is pointing to the correct path.
*Note on one installation this message was shown as forward slashes rather than backslashes were used.*

.. code-block:: bat
Expand Down
2 changes: 1 addition & 1 deletion en/mapfile/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ A full sample config file is shown below:
#
# MS_MAP_NO_PATH "1"
MS_MAP_PATTERN "^/opt/mapserver" ## required when referencing mapfiles by path
# MS_MAP_BAD_PATTERN "[/\\]{2}|[/\\]?\\.+[/\\]|,"
# MS_MAP_BAD_PATTERN "[/\\\\]{2}|[/\\\\]?\\.+[/\\\\]|,"

#
# Global Log/Debug Setup
Expand Down
2 changes: 1 addition & 1 deletion en/ogc/wms_server.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2201,7 +2201,7 @@ to return HTTP 4xx or 5xx status codes in case of error.
#
# MS_MAP_NO_PATH "1"
MS_MAP_PATTERN "^/opt/mapserver" ## required when referencing mapfiles by path
# MS_MAP_BAD_PATTERN "[/\\]{2}|[/\\]?\\.+[/\\]|,"
# MS_MAP_BAD_PATTERN "[/\\\\]{2}|[/\\\\]?\\.+[/\\\\]|,"

# Enable HTTP status code 4xx and 5xx in case of errors on WMS requests
MS_WMS_ERROR_STATUS_CODE "ON"
Expand Down
2 changes: 1 addition & 1 deletion en/optimization/environment_variables.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ MS_MAP_BAD_PATTERN
*MS_MAP_BAD_PATTERN* of:
::

[/\\]{2}|[/\\]?\\.+[/\\]|,
[/\\\\]{2}|[/\\\\]?\\.+[/\\\\]|,

which will therefore not allow "/../" or "//" in the map value.

Expand Down
2 changes: 1 addition & 1 deletion en/optimization/limit_mapfile_access.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ generated. By default all MapServer installations (since 7.6.3) set a
hardcoded value for *MS_MAP_BAD_PATTERN* of:
::

[/\\]{2}|[/\\]?\\.+[/\\]|,
[/\\\\]{2}|[/\\\\]?\\.+[/\\\\]|,

which will therefore not allow "/../" or "//" in the map value.

Expand Down