[ 
https://issues.apache.org/jira/browse/CAMEL-8828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

chandra shekhar pandey updated CAMEL-8828:
------------------------------------------
    Description: 
- If a user uses absolute path in ftp component like
{code}
<route id="timerToLog1">
      <from uri="file:///path/to/input"/>
      <to 
uri="sftp://rider:secret@localhost:21000//absolute/path/to/dir?fileExist=Move&amp;moveExisting=${file:name}-${date:now:yyyyMMdd-HHmmssSSS}"/>
</route>
{code}
- User receives following error
{code}
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot 
rename file from: /absolute/path/to/dir/filename.ext to: 
absolute/path/to/dir/filename-20150602-103603722.ext
    at 
org.apache.camel.component.file.remote.SftpOperations.renameFile(SftpOperations.java:397)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.remote.SftpOperations.doMoveExistingFile(SftpOperations.java:909)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.remote.SftpOperations.doStoreFile(SftpOperations.java:811)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.remote.SftpOperations.storeFile(SftpOperations.java:784)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:278)[280:org.apache.camel.camel-core:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:166)[280:org.apache.camel.camel-core:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.remote.RemoteFileProducer.process(RemoteFileProducer.java:49)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
    at 
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[280:org.apache.camel.camel-core:2.12.0.redhat-610379]
    at ...
{code}
- After discussion with camel experts, It is confirmed that only relative path 
are supported in camel-ftp components. As earlier there was support for 
absolute but it caused too much problems for some people with something working 
and not working. Also its not a good security model to allow absolute file 
access over FTP.
- But this is not documented with http://camel.apache.org/ftp2.html. This would 
be helpful for users.
- If people really want a ftp user to access some path outside the FTP folder, 
then use symlinks and so on.
- *It is expected that document should cleary say that absoulte path is not 
recommended when using camel-ftp component.*


  was:
- If a user uses absolute path in ftp component like
{code}
<route id="timerToLog1">
      <from uri="file:///path/to/input"/>
      <to 
uri="sftp://rider:secret@localhost:21000//absolute/path/to/dir?fileExist=Move&amp;moveExisting=${file:name}-${date:now:yyyyMMdd-HHmmssSSS}"/>
</route>
{code}
- User receives following error
{code}
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot 
rename file from: /absolute/path/to/dir/filename.ext to: 
absolute/path/to/dir/filename-20150602-103603722.ext
    at 
org.apache.camel.component.file.remote.SftpOperations.renameFile(SftpOperations.java:397)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.remote.SftpOperations.doMoveExistingFile(SftpOperations.java:909)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.remote.SftpOperations.doStoreFile(SftpOperations.java:811)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.remote.SftpOperations.storeFile(SftpOperations.java:784)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:278)[280:org.apache.camel.camel-core:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:166)[280:org.apache.camel.camel-core:2.12.0.redhat-610379]
    at 
org.apache.camel.component.file.remote.RemoteFileProducer.process(RemoteFileProducer.java:49)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
    at 
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[280:org.apache.camel.camel-core:2.12.0.redhat-610379]
    at ...
{code}
- After discussion with camel experts, It is confirmed that only relative path 
are supported in camel-ftp components. As earlier there was support for 
absolute but it caused too much problems for some people with something working 
and not working. Also its not a good security model to allow absolute file 
access over FTP.
- But this is not documented with http://camel.apache.org/ftp2.html. This would 
be helpful for users.
- If people really want a ftp user to access some path outside the FTP folder, 
then use symlinks and so on.
- *It is expected that document should cleary say that absoulte path is not 
recommended.*



> camel-ftp component does not support absolute path.
> ---------------------------------------------------
>
>                 Key: CAMEL-8828
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8828
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-ftp, documentation
>         Environment: Linux, Windows
>            Reporter: chandra shekhar pandey
>
> - If a user uses absolute path in ftp component like
> {code}
> <route id="timerToLog1">
>       <from uri="file:///path/to/input"/>
>       <to 
> uri="sftp://rider:secret@localhost:21000//absolute/path/to/dir?fileExist=Move&amp;moveExisting=${file:name}-${date:now:yyyyMMdd-HHmmssSSS}"/>
> </route>
> {code}
> - User receives following error
> {code}
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot 
> rename file from: /absolute/path/to/dir/filename.ext to: 
> absolute/path/to/dir/filename-20150602-103603722.ext
>     at 
> org.apache.camel.component.file.remote.SftpOperations.renameFile(SftpOperations.java:397)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
>     at 
> org.apache.camel.component.file.remote.SftpOperations.doMoveExistingFile(SftpOperations.java:909)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
>     at 
> org.apache.camel.component.file.remote.SftpOperations.doStoreFile(SftpOperations.java:811)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
>     at 
> org.apache.camel.component.file.remote.SftpOperations.storeFile(SftpOperations.java:784)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
>     at 
> org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:278)[280:org.apache.camel.camel-core:2.12.0.redhat-610379]
>     at 
> org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:166)[280:org.apache.camel.camel-core:2.12.0.redhat-610379]
>     at 
> org.apache.camel.component.file.remote.RemoteFileProducer.process(RemoteFileProducer.java:49)[284:org.apache.camel.camel-ftp:2.12.0.redhat-610379]
>     at 
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[280:org.apache.camel.camel-core:2.12.0.redhat-610379]
>     at ...
> {code}
> - After discussion with camel experts, It is confirmed that only relative 
> path are supported in camel-ftp components. As earlier there was support for 
> absolute but it caused too much problems for some people with something 
> working and not working. Also its not a good security model to allow absolute 
> file access over FTP.
> - But this is not documented with http://camel.apache.org/ftp2.html. This 
> would be helpful for users.
> - If people really want a ftp user to access some path outside the FTP 
> folder, then use symlinks and so on.
> - *It is expected that document should cleary say that absoulte path is not 
> recommended when using camel-ftp component.*



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to