Repository navigation
Decoding, validation, and path-resolution fixes for cgi-bin scripts - #3
Merged
Merged
Conversation
…ectness and parameter validation
…rameter validation
…ess and input validation
…arameter validation
The v0.7.62.1 release removed these scripts. Earlier commits on this branch modified them. Deleting them lets the branch merge into a tree that includes the release.
lonvia
pushed a commit
that referenced
this pull request
Nov 30, 2026
Add run_testsuite_regressions.sh, which runs every test in
osm-3s_testing/input/regression_*/ and compares its output with
expected/regression_*/, and call it from run_testsuite.sh. Each test is
one directory, so a fix can add its test without changing a script:
stdin.log the query (for a CGI test, the request body, if any)
init.osm optional: data imported into a database of the test's own
import.args optional: arguments for update_database (default --meta)
env optional: run cgi-bin/interpreter with these environment
variables instead of osm3s_query, with a dispatcher over
the test's database
As in the other suites, stderr is compared only for a test that has an
expected stderr.log, which only tests that expect an error need, and
remarks and timings in it are ignored.
Each test runs for at most 60 seconds and writes at most 10 MB per file,
so a test of a hang fails rather than blocks the suite: either limit
adds a note to stdout.log. The database is created with mktemp, because
the dispatcher's socket path in a directory under osm-3s_testing/run can
exceed the length limit for socket paths. The script passes shellcheck.
The following commits add tests for the fixes since v0.7.62.11. They
leave out the parts of #4 that leave the output of a request unchanged
(reading the POST body in chunks, the scope of the "=" search, the
operates_* checks in pt_diagrams), the cgi-bin shell scripts of #3,
and the performance changes of #8 and #11.
Co-Authored-By: Colin Dellow <cldellow@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is upstream drolbr#796.
The v0.7.62.1 import removed
src/cgi-bin/augmented_map,src/cgi-bin/pingandsrc/cgi-bin/sitemap. Commits4bbd2903,494faaceand29ac83e4on this branch edit those scripts. The last commit deletes them again so the branch merges cleanly. Their edits do not appear in "Files changed".src/cgi-bin/*
uncgion stdin usingprintf '%s'to ensure that they are correctly decoded.realpathto ensure that path construction is correct.400for a malformed request and500only for a missing or unreadable backend file. Scripts that render an HTML page fall back to defaults instead of erroring.kill_my_queries: validate the PID argument; construct paths more carefully.$( )fixes throughout.Scripts accept the same inputs and produce the same outputs as before for
well-formed requests.
src/pt_diagrams/uncgi.cc
%at the end of the input.uncgiaccepts the same inputs and produces the same outputs as before forwell-formed requests.