[SFTP] Read from write-only file not returning error

Stef Bon stefbon at gmail.com
Mon Aug 7 06:04:44 AEST 2017


2017-08-06 19:38 GMT+02:00 Nikolaus Rath <Nikolaus at rath.org>:
> On Aug 06 2017, Stef Bon <stefbon at gmail.com> wrote:
>> Hi,

>>
>> I shall test this using my sftp fuse fs with the sftp-server.
>
> Out of curiosity, how does your sftp fuse fs differ from SSHFS (which
> also uses FUSE and SFTP)?
>

My fuse fs creates a SFTP_Network map, and creates for every sftp
server it finds a directory.
In this server directory in any case the "home" map is created, since
the connecting user has access to it's home map.
Other directories are possible through a script run on the server
which gives the client the directories which are shared via sftp.

It uses avahi for detection of the sftp servers.

It uses the same mutex and condition variable for:
- response from sftp server
- connection problems
- interrupt of fuse requests

This way the fuse fs will never "hang" due to timeout's, errors/crash
on the server.
I had to write my own ssh libraries since the existing libraries
(libssh,libssh2, etc) do not provide this possibility
to use this construction with a shared mutex and condition variabeles
(and of course pthread_cond_timedwat).

Futher my client can handle versions 3-6, and possibly (todo) use
locking. It's possible to provide the client info like
who (user at host) has a file in use (locked), although this info cannot
be exported through the VFS/kernel.

Some other features:

- automatic correction of the time skew between server and client when
handling times.
- fs-workspace runs as a daemon and creates sftp_network maps when users log in.


Stef


More information about the openssh-unix-dev mailing list