TScSFTPServer - RootPath (HomePath) for User

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
Andy_aaa
Posts: 3
Joined: Thu 19 Jul 2012 11:27

TScSFTPServer - RootPath (HomePath) for User

Post by Andy_aaa » Tue 11 Feb 2014 10:57

Hi,

using the TScSFTPServer via TScSSHServer (6.2): it look's like:

SFTPServer := TScSFTPServer.Create(nil);
ScFileStorage := TScFileStorage.Create(nil);
ScSSHServer := TScSSHServer.Create(nil);
ScSSHServer.SFTPServer := SFTPServer;
ScSSHServer.Storage := ScFileStorage;
..... Port 22 --- Options ect.
then:
scUser := TScUser.Create(ScFileStorage.Users);
scUser.UserName := 'User1';
scUser.Password := '123456';
scUser.Authentications := [uaPassword];
scUser.HomePath := 'C:\Home\User1';
****
Running this Code (maybe in "SimpleSSHServer-Demo") and Login via WinSCP (Connection SFTP)
--- Results after login:
1. in WinSCP I see the 'C:\Home\User1' Folder - OK
2. The Folder 'C:\Home\User1' is not the Root-Folder - !Ok
3. User1 can Change to the topfolders .. "C:\Home" - "C:\" .... - !Ok
4. Get a file from this Folder - OK
5. Save a file to this Folder - !Ok (WinSCP - error-message)
- path to copy is "C:\Home\User1\./*.*"
- error mess is : Can't create the file -> bad filename (code 4)

Where is the mistake? How can I solve this problem?

May be it is a bug in WinSCP:
- when I change the directory in WinSCP to "/"[Root] then the protocol works fine
- may be -- set "OnGetAbsolutePath" for ever "on Root"

Andy

Session = SSH-2
Implementation = Devart-6.0
algorithm = aes
Compression = No
Protocol = SFTP-5

Andy_aaa
Posts: 3
Joined: Thu 19 Jul 2012 11:27

Re: TScSFTPServer - RootPath (HomePath) for User

Post by Andy_aaa » Tue 18 Feb 2014 09:31

////////// only Root to Users "HomePath":
procedure ScSFTPServer1GetAbsolutePath(Sender: TObject;
SFTPSessionInfo: TScSFTPSessionInfo; const Path: String;
const Control: TScSFTPRealpathControl; ComposePath: TStringList;
var AbsolutePath: String; var Error: TScSFTPError);
var AScSFTPError: TScSFTPError;
begin
AScSFTPError.ErrorCode := erOk;
AScSFTPError.ErrorMessage := '';
Error := AScSFTPError;
AbsolutePath := '/';
end;
//////////

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: TScSFTPServer - RootPath (HomePath) for User

Post by Dimon » Tue 18 Feb 2014 11:09

Thank you for the information. We are investigating the problem. As soon as we solve the problem we will let you know.

Sabbiolina
Posts: 1
Joined: Wed 04 Jun 2014 09:53

Re: TScSFTPServer - RootPath (HomePath) for User

Post by Sabbiolina » Wed 04 Jun 2014 09:59

hello, I'm trying to run a sftp server but I too have the same problem.

Where can I set the root sftp?

The server sets it where the executable resides, and returns to the sftp client that path instead of a root.


I'm using the last trial with XE6 under Windows 7.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: TScSFTPServer - RootPath (HomePath) for User

Post by Dimon » Tue 24 Jun 2014 13:49

Thank you for the information. We have reproduced this problem and fixed it. This fix will be included in the next SecureBridge build.

Post Reply