You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Stefan4112 (via GitHub)" <gi...@apache.org> on 2025/04/28 16:20:01 UTC
[I] FS Does not support secure directory streams & NOFOLLOW_LINKS on IBM i [mina-sshd]
Stefan4112 opened a new issue, #742:
URL: https://github.com/apache/mina-sshd/issues/742
### Version
2.12.1
### Bug description
The new WinSCP client version 6.5 sends the FileAttribute "size" when opening a file. This leads to following Exception:
```
java.lang.UnsupportedOperationException: FS Does not support secure directory streams.
at org.apache.sshd.sftp.server.SftpFileSystemAccessor.secure(SftpFileSystemAccessor.java:593)
at org.apache.sshd.sftp.server.SftpFileSystemAccessor.secureResolveDirectoryStream(SftpFileSystemAccessor.java:585)
at org.apache.sshd.sftp.server.SftpFileSystemAccessor.seekableByteChannelNoLinkFollow(SftpFileSystemAccessor.java:565)
at org.apache.sshd.sftp.server.SftpFileSystemAccessor.openFile(SftpFileSystemAccessor.java:217)
at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.setFileAttributes(AbstractSftpSubsystemHelper.java:2707)
at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doSetAttributes(AbstractSftpSubsystemHelper.java:2671)
at org.apache.sshd.sftp.server.FileHandle.<init>(FileHandle.java:94)
at org.apache.sshd.sftp.server.SftpSubsystem.doOpen(SftpSubsystem.java:968)
at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doOpen(AbstractSftpSubsystemHelper.java:496)
at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doProcess(AbstractSftpSubsystemHelper.java:353)
at org.apache.sshd.sftp.server.SftpSubsystem.doProcess(SftpSubsystem.java:355)
at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.process(AbstractSftpSubsystemHelper.java:344)
at org.apache.sshd.sftp.server.SftpSubsystem.run(SftpSubsystem.java:331)
```
I identified the problem in org.apache.sshd.sftp.server.FileHandle.java
```
SftpFileSystemAccessor accessor = subsystem.getFileSystemAccessor();
SeekableByteChannel channel;
try {
channel = accessor.openFile(
subsystem, this, file, handle, openOptions, fileAttrs);
} catch (UnsupportedOperationException e) {
channel = accessor.openFile(
subsystem, this, file, handle, openOptions, IoUtils.EMPTY_FILE_ATTRIBUTES);
subsystem.doSetAttributes(SftpConstants.SSH_FXP_OPEN, "", file, attrs, false);
}
```
### Actual behavior
1. The first accessor.openFile(...) throws an exception that is not shown in log
2. Second accessor.openFile(...) creates file, but subsystem.doSetAttributes(...) throws Exception "FS Does not support secure directory streams", because followLinks is hard-coded to false and not supported on IBM i.
### Expected behavior
1. Show the exception on debug/trace log
2. Do not use followLinks=false if it can lead to problems. A fallback as it is mentioned before the exception. Or maybe some way to configure it?
### Relevant log output
```Shell
```
### Other information
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org
Re: [I] FS Does not support secure directory streams & NOFOLLOW_LINKS on IBM i [mina-sshd]
Posted by "kimberly13vazquez-droid (via GitHub)" <gi...@apache.org>.
kimberly13vazquez-droid commented on issue #742:
URL: https://github.com/apache/mina-sshd/issues/742#issuecomment-3284329870
> ### Version
>
> 2.12.1
>
> ### Bug description
>
> The new WinSCP client version 6.5 sends the FileAttribute "size" when opening a file. This leads to following Exception:
> ```
> java.lang.UnsupportedOperationException: FS Does not support secure directory streams.
> at org.apache.sshd.sftp.server.SftpFileSystemAccessor.secure(SftpFileSystemAccessor.java:593)
> at org.apache.sshd.sftp.server.SftpFileSystemAccessor.secureResolveDirectoryStream(SftpFileSystemAccessor.java:585)
> at org.apache.sshd.sftp.server.SftpFileSystemAccessor.seekableByteChannelNoLinkFollow(SftpFileSystemAccessor.java:565)
> at org.apache.sshd.sftp.server.SftpFileSystemAccessor.openFile(SftpFileSystemAccessor.java:217)
> at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.setFileAttributes(AbstractSftpSubsystemHelper.java:2707)
> at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doSetAttributes(AbstractSftpSubsystemHelper.java:2671)
> at org.apache.sshd.sftp.server.FileHandle.<init>(FileHandle.java:94)
> at org.apache.sshd.sftp.server.SftpSubsystem.doOpen(SftpSubsystem.java:968)
> at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doOpen(AbstractSftpSubsystemHelper.java:496)
> at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doProcess(AbstractSftpSubsystemHelper.java:353)
> at org.apache.sshd.sftp.server.SftpSubsystem.doProcess(SftpSubsystem.java:355)
> at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.process(AbstractSftpSubsystemHelper.java:344)
> at org.apache.sshd.sftp.server.SftpSubsystem.run(SftpSubsystem.java:331)
> ```
>
> I identified the problem in org.apache.sshd.sftp.server.FileHandle.java
> ```
> SftpFileSystemAccessor accessor = subsystem.getFileSystemAccessor();
> SeekableByteChannel channel;
> try {
> channel = accessor.openFile(
> subsystem, this, file, handle, openOptions, fileAttrs);
> } catch (UnsupportedOperationException e) {
> channel = accessor.openFile(
> subsystem, this, file, handle, openOptions, IoUtils.EMPTY_FILE_ATTRIBUTES);
> subsystem.doSetAttributes(SftpConstants.SSH_FXP_OPEN, "", file, attrs, false);
> }
> ```
>
> ### Actual behavior
>
> 1. The first accessor.openFile(...) throws an exception that is not shown in log
> 2. Second accessor.openFile(...) creates file, but subsystem.doSetAttributes(...) throws Exception "FS Does not support secure directory streams", because followLinks is hard-coded to false and not supported on IBM i.
>
> ### Expected behavior
>
> 1. Show the exception on debug/trace log
> 2. Do not use followLinks=false if it can lead to problems. A fallback as it is mentioned before the exception. Or maybe some way to configure it?
>
> ### Relevant log output
>
> ```Shell
>
> ```
>
> ### Other information
>
> _No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org
Re: [I] FS Does not support secure directory streams & NOFOLLOW_LINKS on IBM i [mina-sshd]
Posted by "himanshuED (via GitHub)" <gi...@apache.org>.
himanshuED commented on issue #742:
URL: https://github.com/apache/mina-sshd/issues/742#issuecomment-4928420061
Hi Team,
We are getting similar error message - UnsupportedOperationException / Unsupported Operation Requested, however for a different use case. Can someone confirm, whether this use case is also tied up to above reported ??
**_Use Case details:_**
When using WinSCP Desktop client, post connecting to our SFTP Server (running with MINA implementation) as we try to upload file to any given directory the file doesn't gets uploaded and rather we get a popup window with below message in it and log prompt as shown below.
"Cannot overwrite remote file : /<path>/<uploadedFileName>.
`The server does not support the operation.
Error code: 8
Error message from server: Unsupported operation requested
`
We have to click on 'Retry' button, for each file being uploaded for this to work.
This problem was also reported by many of Vendors using WInSCP CLI with wrapper as their SFTP client for file transfer automation.
https://winscp.net/eng/docs/commandline
With the upgraded WinSCP CLI version, the transfer fails and the CLI unfortunately doesn't have auto retry option - hence we are not left with any alternative in that case.
If these issues are already tied up, can this be fixed in upcoming MINA library releases?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org
Re: [I] FS Does not support secure directory streams & NOFOLLOW_LINKS on IBM i [mina-sshd]
Posted by "PortaSFTPServer (via GitHub)" <gi...@apache.org>.
PortaSFTPServer commented on issue #742:
URL: https://github.com/apache/mina-sshd/issues/742#issuecomment-4929884057
Hi @himanshuED, Did you try to adjust WinSCP to not use .filepart or check the https://winscp.net/eng/docs/message_preserve_time_perm?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org
Re: [I] FS Does not support secure directory streams & NOFOLLOW_LINKS on IBM i [mina-sshd]
Posted by "yakugama (via GitHub)" <gi...@apache.org>.
yakugama commented on issue #742:
URL: https://github.com/apache/mina-sshd/issues/742#issuecomment-3646430065
Same behaviour on Windows:
```
java.lang.UnsupportedOperationException: 'size' not supported as initial attribute
at sun.nio.fs.WindowsSecurityDescriptor.fromAttribute(WindowsSecurityDescriptor.java:...)
at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(WindowsFileSystemProvider.java:...)
at org.apache.sshd.common.file.root.RootedFileSystemProvider.newFileChannel(RootedFileSystemProvider.java:...)
at java.nio.channels.FileChannel.open(FileChannel.java:292)
at org.apache.sshd.sftp.server.SftpFileSystemAccessor.openFile(SftpFileSystemAccessor.java:...)
at org.apache.sshd.sftp.server.FileHandle.<init>(FileHandle.java:89)
at org.apache.sshd.sftp.server.SftpSubsystem.doOpen(SftpSubsystem.java:967)
at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doOpen(AbstractSftpSubsystemHelper.java:...)
at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.doProcess(AbstractSftpSubsystemHelper.java:...)
at org.apache.sshd.sftp.server.SftpSubsystem.doProcess(SftpSubsystem.java:354)
at org.apache.sshd.sftp.server.AbstractSftpSubsystemHelper.process(AbstractSftpSubsystemHelper.java:...)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org
Re: [I] FS Does not support secure directory streams & NOFOLLOW_LINKS on IBM i [mina-sshd]
Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #742:
URL: https://github.com/apache/mina-sshd/issues/742#issuecomment-4932499882
@himanshuED : this is unrelated to the issue originally reported. Without logs it's impossible to even guess at what might go wrong. It's possible that WinSCP does something that is simply not implemented. WinSCP needs a server-side shell, and the implementation of that shell in Apache MINA SSHD is very basic. See https://github.com/apache/mina-sshd/blob/8a86e32b2d87b1140065e94adccf438f9b2b1272/sshd-scp/src/main/java/org/apache/sshd/scp/server/ScpShell.java#L330-L338
Please open a new Github issue for this and do provide logs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org