Peergos / Peergos

A p2p, secure file storage, social network and application protocol
https://peergos.org
GNU Affero General Public License v3.0
1.95k stars 165 forks source link

[bug] put command in shell does not handle spaces in names #1183

Closed rapenne-s closed 2 weeks ago

rapenne-s commented 2 weeks ago

It is not possible to push a file or directory that contain a space in its name.

I tried to escape it using \ or quote it using " or ' without success.

rapenne-s@https://aaaa > put /var/home/solene/Seafile/hello\ world 
java.nio.file.NoSuchFileException: /var/home/solene/Seafile/hello
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
    at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
    at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
    at java.base/java.nio.file.Files.readAllBytes(Files.java:3288)
    at peergos.server.cli.CLI.put(CLI.java:275)
    at peergos.server.cli.CLI.handle(CLI.java:119)
    at peergos.server.cli.CLI.run(CLI.java:730)
    at peergos.server.cli.CLI.main(CLI.java:751)
    at peergos.server.Main.startShell(Main.java:837)
    at peergos.server.Command.main(Command.java:75)
    at peergos.server.Command.main(Command.java:63)
    at peergos.server.Main.main(Main.java:922)
Failed to execute ParsedCommand{cmd=put, line='put /var/home/solene/Seafile/hello world ', arguments=[/var/home/solene/Seafile/hello, world]}
rapenne-s@https://aaaa > put '/var/home/solene/Seafile/hello world'
java.nio.file.NoSuchFileException: /var/home/solene/Seafile/'/var/home/solene/Seafile/hello
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
    at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
    at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
    at java.base/java.nio.file.Files.readAllBytes(Files.java:3288)
    at peergos.server.cli.CLI.put(CLI.java:275)
    at peergos.server.cli.CLI.handle(CLI.java:119)
    at peergos.server.cli.CLI.run(CLI.java:730)
    at peergos.server.cli.CLI.main(CLI.java:751)
    at peergos.server.Main.startShell(Main.java:837)
    at peergos.server.Command.main(Command.java:75)
    at peergos.server.Command.main(Command.java:63)
    at peergos.server.Main.main(Main.java:922)
Failed to execute ParsedCommand{cmd=put, line='put '/var/home/solene/Seafile/hello world'', arguments=['/var/home/solene/Seafile/hello, world']}
rapenne-s@https://aaaa > put "/var/home/solene/Seafile/hello world"
java.nio.file.NoSuchFileException: /var/home/solene/Seafile/"/var/home/solene/Seafile/hello
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
    at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
    at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
    at java.base/java.nio.file.Files.readAllBytes(Files.java:3288)
    at peergos.server.cli.CLI.put(CLI.java:275)
    at peergos.server.cli.CLI.handle(CLI.java:119)
    at peergos.server.cli.CLI.run(CLI.java:730)
    at peergos.server.cli.CLI.main(CLI.java:751)
    at peergos.server.Main.startShell(Main.java:837)
    at peergos.server.Command.main(Command.java:75)
    at peergos.server.Command.main(Command.java:63)
    at peergos.server.Main.main(Main.java:922)
Failed to execute ParsedCommand{cmd=put, line='put "/var/home/solene/Seafile/hello world"', arguments=["/var/home/solene/Seafile/hello, world"]}