Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
108 user(s) are online (61 user(s) are browsing Forums)

Members: 1
Guests: 107

afxgroup, more...

Headlines

 
  Register To Post  

(1) 2 3 4 »
SFTP filesystem
Just can't stay away
Just can't stay away


See User information
https://www.dropbox.com/s/v4lxtnzi2jd6mtv/ssh2fs_wbinfo.png?dl=0

Currently only init(), destroy(), statfs() and getattr() FUSE operations are supported.

Unlike previous FUSE based file systems this is not a port. I'm simply using filesysbox here to avoid reinventing the wheel as far as the interface to AmigaDOS goes.

Because sshfs was too complex to port I'm writing a new file system from scratch using libssh2.

Go to top
Re: SFTP filesystem
Just can't stay away
Just can't stay away


See User information
@salass00
Is this something like FTPMount?

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top
Re: SFTP filesystem
Just can't stay away
Just can't stay away


See User information
I just added readdir() support so directory listing now works:

https://www.dropbox.com/s/qz4gggto5wy5x4i/ssh2fs_wb_01.png?dl=0

@xenic

SFTP (SSH File Transfer Protocol) is a very different protocol from FTP but from a user's perspective they can be seen as somewhat similar in that both allow access to files on another computer. The main difference is that SFTP gets encryption for free thanks to being based on SSH protocol (SSL encryption in ssh2-handler is done using AmiSSL).

Currently you have to specify the server by IP address in the DOSDriver file but eventually I also intend to add code for resolving a domain name.

Go to top
Re: SFTP filesystem
Just can't stay away
Just can't stay away


See User information
The FUSE operations open(), release() and read() are now supported so reading files is working, and seeking as well because seeking is not a separate operation in FUSE API.

If I had implemented the file system without using filesysbox it would have taken a lot longer to get to this point.

Go to top
Re: SFTP filesystem
Home away from home
Home away from home


See User information
Not much to say: Cool !

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: SFTP filesystem
Amigans Defender
Amigans Defender


See User information
@salass00

Ooooh, lovely! This means I can ditch Samba/smbfs!

Go to top
Re: SFTP filesystem
Just popping in
Just popping in


See User information
This will be really handy!

Go to top
Re: SFTP filesystem
Just can't stay away
Just can't stay away


See User information
The operations opendir(), releasedir(), write(), create() and readlink() are now supported as well.

Allowing file creation and directory listing of soft links.

@Chris

Thanks. The fact that smbfs stopped working for me after I recently updated my Ubuntu install from 32-bit to 64-bit was a motivating factor for me to get this working (I can also use PFTP to access files on my PC but it's not quite as convenient).

Go to top
Re: SFTP filesystem
Not too shy to talk
Not too shy to talk


See User information
@salass00

Nice job! Looking forward to the results.

PJS

Go to top
Re: SFTP filesystem
Supreme Council
Supreme Council


See User information
@salass00

Want me to set up a project for you?

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: SFTP filesystem
Amigans Defender
Amigans Defender


See User information
@salass00

smbfs still working here, but only the old version - the one currently on OS4Depot is completely broken for me. Looking forward to ditching it!

Go to top
Re: SFTP filesystem
Home away from home
Home away from home


See User information
@salass00

Well I hope this file system will be reliable, I have been using USB sticks to transference files, for most part.

When I need transfer lots file I have been using Opus5 built in FTP client, that kind of works.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: SFTP filesystem
Just can't stay away
Just can't stay away


See User information
Sounds great!

But will filedates be preserved across the SFTP link?

Best regards,

Niels

Go to top
Re: SFTP filesystem
Home away from home
Home away from home


See User information
@salass00
Nice!

I'm curious about one thing, though:
Quote:
Unlike previous FUSE based file systems this is not a port. I'm simply using filesysbox here to avoid reinventing the wheel as far as the interface to AmigaDOS goes.

What does FileSysBox provide that makes it easier?

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
Go to top
Re: SFTP filesystem
Home away from home
Home away from home


See User information
@salass00

Sounds interesting!


Go to top
Re: SFTP filesystem
Just can't stay away
Just can't stay away


See User information
Some more progress from yesterday: I replaced inet_aton() with gethostbyname() so it should be possible to specify a domain name for HOSTADDR argument and not just an IP address, I added support for the operations relabel(), unlink(), rmdir(), truncate(), utimens(), rename() and fgetattr() and I also fixed the write() implementation to return the total number of bytes written and not just the number written by the last call to libssh2_sftp_write().

Today I've spent most of my time hunting down the reason for a deadlock which happened during some simple stress testing of the file system. The cause seems to be that GetTimezoneAttrsA() calls OpenLocale() at the beginning of the function which causes a deadlock situation if the LocaleBase semaphore is being held by another program which in turn is trying to make a file system call to ssh2-handler (all filesysbox vector calls are mutex protected).

The only solutions I can see is to either fix timezone.library so it doesn't call OpenLocale() on every invocation or cache the TZA_UTCOffset value in filesysbox.library and replace calls to time(), gettimeofday() and every other newlib function that directly or indirectly uses GetTimeZoneAttrs() in the file system with code that uses the cached value.

Go to top
Re: SFTP filesystem
Just can't stay away
Just can't stay away


See User information
@Hans

Quote:

What does FileSysBox provide that makes it easier?


TBH the list is quite long if you want me to list everything but a few things that come to mind:

- It correctly creates and handles AmigaDOS specific structures like volumes, locks and so forth.
- It enforces various AmigaDOS rules like not allowing seeks beyond the end of a file, not deleting a file or directory which has a lock on it, not allowing to truncate a file if there are other users with file positions that would end up beyond EOF and so on.
- Also it enforces some other rules like not allowing to create recursive directory loops by way of soft/hard links or by way of renaming a directory so that it becomes its own child.
- All relative paths are converted to absolute UNIX style paths with the filesystem root as root before they are passed to the FUSE callbacks.
- UNIX GMT timestamps are converted to AmigaDOS style date stamps in local time and vice versa.
- UNIX mode flags are converted to AmigaDOS protection flags and vice versa.
- If the file system supports xattrs then filesysbox can use them to support AmigaDOS specific metadata like additional protection flags (hspa) and comments (not applicable to ssh2-handler).

All the FUSE file system has to implement are some simple call back functions which in case of ssh2-handler are mostly thin wrappers around libssh2_sftp_*() functions, with exception of init() and exit() which have to deal with connecting to and disconnecting from the SSH server.

Go to top
Re: SFTP filesystem
Just can't stay away
Just can't stay away


See User information
@Chris

FWIW I'm still using version 1.74 (31.8.2009) of smbfs because it was working fine for me and I didn't want to risk breaking anything especially since I had read about problems with the latest releases.

The error that smbfs returns is "smbfs: Cannot connect to server (13, Access denied)".

Go to top
Re: SFTP filesystem
Just can't stay away
Just can't stay away


See User information
@nbache

Quote:

But will filedates be preserved across the SFTP link?


Yes, file dates are supported.

https://www.dropbox.com/s/qz4gggto5wy5x4i/ssh2fs_wb_01.png?dl=0

Go to top
Re: SFTP filesystem
Just can't stay away
Just can't stay away


See User information
@salass00
Quote:
Today I've spent most of my time hunting down the reason for a deadlock which happened during some simple stress testing of the file system. The cause seems to be that GetTimezoneAttrsA() calls OpenLocale() at the beginning of the function which causes a deadlock situation if the LocaleBase semaphore is being held by another program which in turn is trying to make a file system call to ssh2-handler (all filesysbox vector calls are mutex protected).


Would the same deadlock occur if you were using AmigaDOS packets instead of filesysbox vector calls? To a novice programmer like me it seems that you would just have a queued packet (message) in ssh2-handler until the first call to OpenLocale() is completed and the LocalBase semaphore is released.

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top

  Register To Post
(1) 2 3 4 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project