Mime Util created SSHD-402:
------------------------------

             Summary: Strange behaviour when overwriting files using SCP 
(ScpCommandFactory)
                 Key: SSHD-402
                 URL: https://issues.apache.org/jira/browse/SSHD-402
             Project: MINA SSHD
          Issue Type: Bug
    Affects Versions: 0.13.0
         Environment: Ubuntu 14.10
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

            Reporter: Mime Util
            Priority: Critical


I set up a sshd-server als follows:

{code:java}
this.sshd = SshServer.setUpDefaultServer();
this.sshd.setPort(2023);
this.sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("keys"));

List<NamedFactory<UserAuth>> userAuthFactories = new 
ArrayList<NamedFactory<UserAuth>>();
userAuthFactories.add(new UserAuthNone.Factory());
this.sshd.setUserAuthFactories(userAuthFactories);

this.sshd.setCommandFactory(new ScpCommandFactory());

List<NamedFactory<Command>> namedFactoryList = new 
ArrayList<NamedFactory<Command>>();
namedFactoryList.add(new SftpSubsystem.Factory());
this.sshd.setSubsystemFactories(namedFactoryList);
{/code}

After starting the server, I uploasd a file (scp -P 2023 filename.txt 
localhost:) containing:

{quote}
1234567890

{/quote}

Afterwards I remove "234567890" from the local file an upload it again. Instead 
of containing on "1\n" the file contains:

{quote}
1

4567890

{/quote}

It seems that "23" is replaced by two spaces, and the rest of the original (on 
the server) remains in the file and is not overwritten.



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

Reply via email to