Last active
December 20, 2015 05:39
-
-
Save mcenirm/6080162 to your computer and use it in GitHub Desktop.
Avoid map querystring parameter when using mapserver CGI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Options -Indexes | |
Options +ExecCGI | |
AddHandler cgi-script .cgi | |
AddHandler mapserver-map .map | |
Action mapserver-map /map/mapserver.cgi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PGPASSFILE=$(dirname $0)/.htpgpass | |
export MS_MAPFILE="$PATH_TRANSLATED" | |
export MS_ERRORFILE=$(mktemp --tmpdir $(basename $0 .cgi).$EUID.$(basename "$MS_MAPFILE" .map).log.XXXXXXXXXX) | |
echo "$MS_MAPFILE" >> $MS_ERRORFILE | |
echo "$QUERY_STRING" | tr \& \\012 | sort >> $MS_ERRORFILE | |
echo ============================================================ >> $MS_ERRORFILE | |
exec /usr/libexec/mapserver "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment