Home  
Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
43 user(s) are online (27 user(s) are browsing Forums)

Members: 0
Guests: 43

more...
Support us!
Recent OS4 Files
OS4Depot.net



(1) 2 3 »


SFTP filesystem
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1565
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.

   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2008/1/6 17:56
From Pennsylvania, USA
Posts: 1257
@salass00
Is this something like FTPMount?

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

   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1565
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.

   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1565
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.

   Report Go to top

Re: SFTP filesystem
Home away from home
Joined:
2007/9/11 11:31
From Russia
Posts: 4349
Not much to say: Cool !

_________________
Join us to improve dopus5!
zerohero's mirror of os4/os3 crosscompiler suites
   Report Go to top

Re: SFTP filesystem
Amigans Defender
Joined:
2006/11/17 22:40
From England
Posts: 3191
@salass00

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

   Report Go to top

Re: SFTP filesystem
Just popping in
Joined:
2007/12/5 3:00
Posts: 49
This will be really handy!

   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1565
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).

   Report Go to top

Re: SFTP filesystem
Just popping in
Joined:
2006/12/2 1:41
From VA, USA
Posts: 211
@salass00

Nice job! Looking forward to the results.

PJS

   Report Go to top

Re: SFTP filesystem
Supreme Council
Joined:
2006/11/16 19:25
From Sweden
Posts: 3114
@salass00

Want me to set up a project for you?

_________________
Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
   Report Go to top

Re: SFTP filesystem
Amigans Defender
Joined:
2006/11/17 22:40
From England
Posts: 3191
@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!

   Report Go to top

Re: SFTP filesystem
Home away from home
Joined:
2006/11/20 16:26
From Norway
Posts: 2668
@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.
   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2006/12/1 18:01
From Copenhagen, Denmark
Posts: 1045
Sounds great!

But will filedates be preserved across the SFTP link?

Best regards,

Niels

   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2007/1/26 21:48
From New Zealand
Posts: 1882
@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
   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2006/12/4 23:15
Posts: 1940
@salass00

Sounds interesting!


_________________
Blender For OS4.x : Blues : Walker Broad
   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1565
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.

   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1565
@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.

   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1565
@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)".

   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2006/11/30 11:30
From Finland
Posts: 1565
@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

   Report Go to top

Re: SFTP filesystem
Just can't stay away
Joined:
2008/1/6 17:56
From Pennsylvania, USA
Posts: 1257
@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

   Report Go to top


(1) 2 3 »



[Advanced Search]


Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project