Opened 15 years ago

Closed 13 years ago

#3005 closed defect (fixed)

Changing map file parameters via a form or a URL broken in Mapserver 5.4 CGI.

Reported by: pyrliu Owned by: jmckenna
Priority: normal Milestone:
Component: Documentation - MapServer Version: 5.4
Severity: normal Keywords: itasca demo map_web cgi parsing error
Cc: sdlime, havatv

Description

I just started using Mapserver and I began by following the excellent introduction documentation.

I'm using Ubuntu and because Ubuntu repositories only have version 5.0.2 available, I downloaded the packaged 5.4 source from the download-page and configured, compiled and installed the cgi program successfully, with the following features:

pyry@lounaispaikka2:/usr/lib/cgi-bin$ ./mapserv54 -v
MapServer version 5.4.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=TIFF INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

Note that to get the compiled 5.4 version working in Ubuntu, I had to install the GDAL v1.6 from source, because the version 1.5.2-2 is buggy

I got the Itasca demo running just fine when I was using the 5.0 version (cgi-mapserver installed from Ubuntu repository), but when I tried to use it with 5.4, I was confronted by the following error:

loadWeb(): Unknown identifier. Parsing error near (IMAGEPATH):(line 1) 

After "a while", I found the note about the new security measures implemented in v5.4. I modified the Itasca demo templates accordingly, but still recieved the same error. Only after I removed the "map_web" variable from the index-page and added the "imagepath", "imageurl" and "template" variables to the WEB section of the itasca.map file, I was able to get the demo working with 5.4.

I'm still unable to get any parameters to work with the "map_web" variable. I can not provide any debug log, because the resulting error is a parse error (which IMHO should also be logged to somewhere). So I believe that there problem is either a) I'm too newbie b) map parameter modding via get request is broken in 5.4 cgi or c) The documentation differs from 5.2 to 5.4. and the some major differences between those versions still remain undocumented. I hope it's a) or c) option ;)

Change History (5)

comment:1 by sdlime, 15 years ago

Cc: sdlime added
Component: MapServer CGIMapServer Documentation
Owner: changed from sdlime to jmckenna

It's option C), a documentation issue. Allowing an unknown user to change where images are created is silly. The hole was closed in 5.4 and as a result you're seeing the result in the demo. Your fix is right on target and I'm working on a new 5.4 demo along the same lines. Sorry you had to beat your head against the wall on this.

Changing to the documentation component. Hoping Jeff can suggest how to handle it.

Steve

comment:2 by drm, 15 years ago

Hi,

I do respect the work you do on this project, but *please* edit the install docs to refer to this issue, so this might save the next person half a day beyond crazy finding out what the heck is going on unlike me!

Demo patches are easy, just remove all <input type="hidden" name="map_web" value="[map_web]"> entries from the .html templates and change the .map file.

I agree though on the "silly" part ;) Keep up the good work.

comment:3 by jmckenna, 15 years ago

drm,

Which demo are you referring to? The correct one to use is linked at the bottom of http://www.mapserver.org/download.html

-jeff

comment:4 by drm, 15 years ago

Ah I see, the link at http://www.mapserver.org/introduction.html#get-demo-running points to the wrong version of the demo (workshop-5.0).

comment:5 by havatv, 13 years ago

Cc: havatv added
Resolution: fixed
Status: newclosed

Updated the link in the introduction for trunk and 6.0 documentation in r12497. Closing.

Note: See TracTickets for help on using tickets.