You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jan Bednar (Jira)" <ji...@apache.org> on 2020/09/17 14:51:00 UTC
[jira] [Comment Edited] (CAMEL-15544) Using parameter tempFileName
or tempPrefix with relative location in parent directory will fail
[ https://issues.apache.org/jira/browse/CAMEL-15544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17197730#comment-17197730 ]
Jan Bednar edited comment on CAMEL-15544 at 9/17/20, 2:50 PM:
--------------------------------------------------------------
Option jailStartingDirectory is true by default, preventing you from writing outside of starting path. Please test with `jailStartingDirectory=false` and if it works, please close this issue as this is desirable behavior.
was (Author: bedla):
Option jailStartingDirectory is true by default, preventing you from writing outside of starting path. Please test with `jailStartingDirectory=false` and if it works, please close this PR as this is desirable behavior.
> Using parameter tempFileName or tempPrefix with relative location in parent directory will fail
> -----------------------------------------------------------------------------------------------
>
> Key: CAMEL-15544
> URL: https://issues.apache.org/jira/browse/CAMEL-15544
> Project: Camel
> Issue Type: Improvement
> Components: camel-ftp
> Affects Versions: 3.5.0, 3.6.0
> Reporter: Oliver Limberg
> Priority: Major
>
> When using either parameter tempFileName or tempPrefix with a relative path, the component will not create the final target directory and moving/renaming the file from the temp location will fail.
> Both tests below will fail when placing them in FtpProducerTempPrefixTest
> {code:java}
> @Test
> public void testWriteUsingRelativeTempPrefix() throws Exception {
> sendFile("ftp://admin@localhost:" + getPort() + "/upload/user/claus?binary=false&password=admin" + "&tempPrefix=../tmp/tmp_", "Hello World", "claus.txt");
> Thread.sleep(500);
> File file = new File(FTP_ROOT_DIR + "/upload/user/claus/claus.txt");
> assertTrue(file.exists(), "The uploaded file should exists");
> assertEquals("Hello World", IOConverter.toString(file, null));
> }
> @Test
> public void testWriteUsingRelativeTempFileName() throws Exception {
> sendFile("ftp://admin@localhost:" + getPort() + "/upload/user/claus?binary=false&password=admin" + "&tempFileName=../tmp/${file:name.noext}.tmp", "Hello World", "claus.txt");
> Thread.sleep(500);
> File file = new File(FTP_ROOT_DIR + "/upload/user/claus/claus.txt");
> assertTrue(file.exists(), "The uploaded file should exists");
> assertEquals("Hello World", IOConverter.toString(file, null));
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)