oscerd opened a new pull request, #24219: URL: https://github.com/apache/camel/pull/24219
Backport of #24180 (CAMEL-23765) to `camel-4.18.x`. ## What When `localWorkDirectory` is enabled, the remote-file consumers built the local work file path from the remote file name (`target.getRelativeFilePath()`) without ensuring the result stayed within the configured work directory — a remote name containing `../` could resolve outside it. A shared `GenericFileHelper.jailToLocalWorkDirectory` check (`compactPath` + `startsWith`, mirroring the file producer's jail) is now applied to both the in-progress temp file and the final file, **before `mkdirs`**, in `FtpOperations`, `SftpOperations`, `MinaSftpOperations`, `FilesOperations` and `SmbOperations`. It reuses the existing `jailStartingDirectory` option (default `true`). ## Scope note **Source-only backport.** The main PR also relabelled `jailStartingDirectory` from `producer` to `common` and regenerated catalog/JSON/endpoint-dsl metadata for all file components; that cosmetic change and its wide metadata churn are intentionally omitted here to keep the maintenance-branch change minimal. The upgrade-guide entry lives on `main`. ## Tests - `GenericFileHelperTest` (2 tests) passes; the 5 components compile on `4.18.3-SNAPSHOT`. - Existing localWorkDirectory ITs cover legitimate-download regression. --- _Claude Code on behalf of Andrea Cosentino_ -- 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]
