This is an automated email from the ASF dual-hosted git repository. Croway pushed a commit to branch camel-4.22.x in repository https://gitbox.apache.org/repos/asf/camel.git
commit 81a1d5cc3564853e5de7d8780c2e152d9a435cdc Author: croway <[email protected]> AuthorDate: Mon Nov 23 18:56:32 2026 +0100 CAMEL-27453: camel-ftp - document that a producer without a directory does not restrict absolute file names --- .../org/apache/camel/catalog/docs/ftp-component.adoc | 15 +++++++++++++++ .../apache/camel/catalog/docs/mina-sftp-component.adoc | 15 +++++++++++++++ .../org/apache/camel/catalog/docs/sftp-component.adoc | 15 +++++++++++++++ components/camel-ftp/src/main/docs/ftp-component.adoc | 15 +++++++++++++++ components/camel-ftp/src/main/docs/sftp-component.adoc | 15 +++++++++++++++ .../src/main/docs/mina-sftp-component.adoc | 15 +++++++++++++++ 6 files changed, 90 insertions(+) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ftp-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ftp-component.adoc index b107223f4e13..311c3cabceb7 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ftp-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/ftp-component.adoc @@ -279,6 +279,21 @@ a line feed cannot be sent as the argument of one command. The `ftp` and `ftps` `GenericFileOperationFailedException` before they send any command for it, for example when the producer writes a file whose `CamelFileName` header has a line break. Remove or replace these characters in the name before the producer. +=== Writing files from an endpoint without a directory + +With `jailStartingDirectory` enabled (the default), the producer writes files within the starting directory of the +endpoint. An endpoint without a directory in its URI, such as `ftp://user@host`, writes into the login directory, +and an absolute file name, such as `/data/out/report.csv`, is written to that absolute path on the server. + +If the file name can come from untrusted input, configure a directory on the endpoint, or reduce the name to a single +path segment, for example with the `flatten` option, which strips any leading path from the file name: + +[source,java] +---- +from("direct:upload") + .to("ftp://user@host/upload?password=secret&flatten=true"); +---- + [[FTP-DefaultWhenConsumingFiles]] === Default when consuming files diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mina-sftp-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mina-sftp-component.adoc index 461b2b0494f0..8cb07d47b4b5 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mina-sftp-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/mina-sftp-component.adoc @@ -567,6 +567,21 @@ Values are validated at endpoint startup. Invalid values cause a clear error mes IMPORTANT: The `chmod` and `chmodDirectory` options only work on POSIX-compatible SFTP servers. Windows SFTP servers may ignore these settings. +== Writing files from an endpoint without a directory + +With `jailStartingDirectory` enabled (the default), the producer writes files within the starting directory of the +endpoint. An endpoint without a directory in its URI, such as `mina-sftp://user@host`, writes into the login directory, +and an absolute file name, such as `/data/out/report.csv`, is written to that absolute path on the server. + +If the file name can come from untrusted input, configure a directory on the endpoint, or reduce the name to a single +path segment, for example with the `flatten` option, which strips any leading path from the file name: + +[source,java] +---- +from("direct:upload") + .to("mina-sftp://user@host/upload?password=secret&flatten=true"); +---- + == Symbolic Links The consumer follows symbolic links to their target files, within the starting directory unless `jailStartingDirectory=false` (see below). The producer writes to symlink targets. diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sftp-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sftp-component.adoc index f893b297d3c3..1900ec980763 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sftp-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/sftp-component.adoc @@ -311,6 +311,21 @@ ssh -vvv <server_address> As of Camel 3.18.1, these values can also be set on SFTP endpoints by setting the corresponding URI parameters. +=== Writing files from an endpoint without a directory + +With `jailStartingDirectory` enabled (the default), the producer writes files within the starting directory of the +endpoint. An endpoint without a directory in its URI, such as `sftp://user@host`, writes into the login directory, +and an absolute file name, such as `/data/out/report.csv`, is written to that absolute path on the server. + +If the file name can come from untrusted input, configure a directory on the endpoint, or reduce the name to a single +path segment, for example with the `flatten` option, which strips any leading path from the file name: + +[source,java] +---- +from("direct:upload") + .to("sftp://user@host/upload?password=secret&flatten=true"); +---- + === Symbolic links and the starting directory With `jailStartingDirectory` enabled (the default), the consumer resolves a listed file that the server reports as a diff --git a/components/camel-ftp/src/main/docs/ftp-component.adoc b/components/camel-ftp/src/main/docs/ftp-component.adoc index b107223f4e13..311c3cabceb7 100644 --- a/components/camel-ftp/src/main/docs/ftp-component.adoc +++ b/components/camel-ftp/src/main/docs/ftp-component.adoc @@ -279,6 +279,21 @@ a line feed cannot be sent as the argument of one command. The `ftp` and `ftps` `GenericFileOperationFailedException` before they send any command for it, for example when the producer writes a file whose `CamelFileName` header has a line break. Remove or replace these characters in the name before the producer. +=== Writing files from an endpoint without a directory + +With `jailStartingDirectory` enabled (the default), the producer writes files within the starting directory of the +endpoint. An endpoint without a directory in its URI, such as `ftp://user@host`, writes into the login directory, +and an absolute file name, such as `/data/out/report.csv`, is written to that absolute path on the server. + +If the file name can come from untrusted input, configure a directory on the endpoint, or reduce the name to a single +path segment, for example with the `flatten` option, which strips any leading path from the file name: + +[source,java] +---- +from("direct:upload") + .to("ftp://user@host/upload?password=secret&flatten=true"); +---- + [[FTP-DefaultWhenConsumingFiles]] === Default when consuming files diff --git a/components/camel-ftp/src/main/docs/sftp-component.adoc b/components/camel-ftp/src/main/docs/sftp-component.adoc index f893b297d3c3..1900ec980763 100644 --- a/components/camel-ftp/src/main/docs/sftp-component.adoc +++ b/components/camel-ftp/src/main/docs/sftp-component.adoc @@ -311,6 +311,21 @@ ssh -vvv <server_address> As of Camel 3.18.1, these values can also be set on SFTP endpoints by setting the corresponding URI parameters. +=== Writing files from an endpoint without a directory + +With `jailStartingDirectory` enabled (the default), the producer writes files within the starting directory of the +endpoint. An endpoint without a directory in its URI, such as `sftp://user@host`, writes into the login directory, +and an absolute file name, such as `/data/out/report.csv`, is written to that absolute path on the server. + +If the file name can come from untrusted input, configure a directory on the endpoint, or reduce the name to a single +path segment, for example with the `flatten` option, which strips any leading path from the file name: + +[source,java] +---- +from("direct:upload") + .to("sftp://user@host/upload?password=secret&flatten=true"); +---- + === Symbolic links and the starting directory With `jailStartingDirectory` enabled (the default), the consumer resolves a listed file that the server reports as a diff --git a/components/camel-mina-sftp/src/main/docs/mina-sftp-component.adoc b/components/camel-mina-sftp/src/main/docs/mina-sftp-component.adoc index 461b2b0494f0..8cb07d47b4b5 100644 --- a/components/camel-mina-sftp/src/main/docs/mina-sftp-component.adoc +++ b/components/camel-mina-sftp/src/main/docs/mina-sftp-component.adoc @@ -567,6 +567,21 @@ Values are validated at endpoint startup. Invalid values cause a clear error mes IMPORTANT: The `chmod` and `chmodDirectory` options only work on POSIX-compatible SFTP servers. Windows SFTP servers may ignore these settings. +== Writing files from an endpoint without a directory + +With `jailStartingDirectory` enabled (the default), the producer writes files within the starting directory of the +endpoint. An endpoint without a directory in its URI, such as `mina-sftp://user@host`, writes into the login directory, +and an absolute file name, such as `/data/out/report.csv`, is written to that absolute path on the server. + +If the file name can come from untrusted input, configure a directory on the endpoint, or reduce the name to a single +path segment, for example with the `flatten` option, which strips any leading path from the file name: + +[source,java] +---- +from("direct:upload") + .to("mina-sftp://user@host/upload?password=secret&flatten=true"); +---- + == Symbolic Links The consumer follows symbolic links to their target files, within the starting directory unless `jailStartingDirectory=false` (see below). The producer writes to symlink targets.
