mrdevel2002-ui opened a new pull request, #3412:
URL: https://github.com/apache/tika/pull/3412
GDALParser.parse substituted the input path into the `gdalinfo
${INPUT_FILE}` template and then split the whole string on whitespace, so every
space in the path became an argument boundary. TikaInputStream hands parsers
the original path for file-backed input (tika-app, the pipes
FileSystemFetcher), so a file named `tile.tif --config GDAL_HTTP_PROXY
attacker:8080` reaches gdalinfo as a truncated dataset path plus `--config
GDAL_HTTP_PROXY attacker:8080`, and any ordinary path containing a space fails
to parse. The fix splits the template first and substitutes the path into each
argument, the same approach ExternalParser takes. processCommand is public, so
I left it untouched rather than change its signature.
Verified with a stub gdalinfo on PATH that echoes its argv: on main the path
above arrives as five arguments, with the patch as one.
testInputPathWithWhitespaceIsOneArgument covers the argv construction and runs
without GDAL installed. `./mvnw clean install` of tika-parser-scientific-module
(tests, checkstyle, spotless) is green.
- [ ] open issue on the Tika issue tracker: not filed yet, happy to open one
or have it linked
- [ ] issue ID in the PR title and commit message: pending the issue above
- [x] commits are squashed into a single one
- [x] Tika builds and unit tests pass with `./mvnw clean install` (affected
module)
- [x] generative AI tool used: the commit carries `Generated-by:` per the
ASF Generative Tooling Guidance
- [x] no conflicts with the recent `main` branch
- [ ] new downstream module added to `tika-bom/pom.xml`: not applicable
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]