Bruno Cesar Ribas | 1 Sep 2007 22:35
Picon

[sshfs] [patch] sftp-server basepath

Hi,

I made this simple patch to make sftp-server restricted to a basepath!

This was done because use sshfs [wich base is sftp-server] to allow people
access medias [ cdrom,dvdrom, floppy, usb] from x-terms.

Those x-terms [ diskless] does not have all users, so we share a single user
and a DSA empty passphrase, with some acl scipts at .ssh/authorized keys.

Main usage of this patch is to NOT allow a user who mounted a floppy access
other mounted media from another user.

Usage:
sftp-server -b <path>

My page includes this path: http://www.inf.ufpr.br/ribas/sshfs_help/

And it is attached too.

Thanks for atention

Bruno Ribas

--

-- 
Bruno Ribas - ribas <at> c3sl.ufpr.br
http://web.inf.ufpr.br/ribas
C3SL: http://www.c3sl.ufpr.br 
Attachment (sftp-server.c.patch): text/x-diff, 1369 bytes
(Continue reading)

Jake Conk | 1 Sep 2007 23:13
Picon

[sshfs] Multiple Client Support

Hello,

I was wondering if fuse has support for multiple clients for example say I
have more than 1 client mount the same location and they both try to read
and write to a file at the same time. Does sshfs provide a way to lock a
file and release it when its available again or this isn't a good idea?

Thanks,
- Jake
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Miklos Szeredi | 5 Sep 2007 21:39
Picon

Re: [sshfs] Multiple Client Support

> I was wondering if fuse has support for multiple clients for example say I
> have more than 1 client mount the same location and they both try to read
> and write to a file at the same time. Does sshfs provide a way to lock a
> file and release it when its available again or this isn't a good idea?

No locking is provided by the SFTP version present in current OpenSSH.

So if you need access from multiple clients with file locking, that's
not possible with sshfs.

Miklos

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Jake Conk | 6 Sep 2007 12:56
Picon

Re: [sshfs] Multiple Client Support

I don't have many requirements except that I want the filesystem to
automount when the servers comes up or down. Security isn't too important
since the shares are only within my LAN and not over the internet. I just
need to be able to share/export drives on my network to multiple
workstatations that all need to read and write to them at the same time.

Thanks,
- Jake

On 9/6/07, Miklos Szeredi <miklos <at> szeredi.hu> wrote:
>
> > Do you recommend something that might have it with fuse or worst case
> > another solution?
>
> What are your requirements?
>
> NFS supports locking, and is widely used, so that seems a trivial way
> to do this.
>
> Miklos
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
David Edwards | 7 Sep 2007 12:55
Picon

[sshfs] Bug : general protection rip

Hey

Just encountered this, I've pasted in the dmesg which should supply you with
any necessary info, if you need any more, just shout.

I've posted this incase it's of any use to anyone ! ;o)

Cheers

David Edwards

-----------------------------------------------------------------------------------------------

Bootdata ok (command line is root=/dev/sda1 ro )
Linux version 2.6.18-4-amd64 (Debian 2.6.18.dfsg.1-12) (waldi <at> debian.org)
(gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Mon Mar
26 11:36:53 CEST 2007
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e8000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 00000000bfff0000 (usable)
 BIOS-e820: 00000000bfff0000 - 00000000bffff000 (ACPI data)
 BIOS-e820: 00000000bffff000 - 00000000c0000000 (ACPI NVS)
 BIOS-e820: 00000000ff780000 - 0000000100000000 (reserved)
 BIOS-e820: 0000000100000000 - 0000000240000000 (usable)
DMI 2.3 present.
ACPI: RSDP (v000 ACPIAM                                )  <at> 
0x00000000000f97b0
ACPI: RSDT (v001 A M I  OEMRSDT  0x01000604 MSFT 0x00000097)  <at> 
(Continue reading)

BEUGIN Sylvain SCE | 10 Sep 2007 19:09

[sshfs] TR: segmentation fault


hi,

I forgot to tell you that after the normal input / output error i stop firewall and make ssh connection possible...
So The crash occurs during reconnect after the ServerAliveInternal was reached

 
Another debug (same scenarii) with  a glibc error instead of a segmentation fault

remote host has disconnected
write: Broken pipe
   unique: 20158, error: -5 (Input/output error), outsize: 16
write: Bad file descriptor
   unique: 20162, error: -5 (Input/output error), outsize: 16
unique: 20163, opcode: RELEASEDIR (29), nodeid: 1, insize: 56
   unique: 20163, error: 0 (Success), outsize: 16
unique: 20164, opcode: FLUSH (25), nodeid: 5, insize: 64
FLUSH[3066037536]
   unique: 20164, error: -5 (Input/output error), outsize: 16
unique: 20165, opcode: RELEASE (18), nodeid: 5, insize: 56
RELEASE[3066037536] flags: 0x8001
   unique: 20165, error: 0 (Success), outsize: 16
unique: 20166, opcode: GETATTR (3), nodeid: 1, insize: 40
remote host has disconnected
   unique: 20166, error: -5 (Input/output error), outsize: 16
unique: 20167, opcode: GETATTR (3), nodeid: 1, insize: 40
write: Broken pipe
   unique: 20167, error: -5 (Input/output error), outsize: 16
remote host has disconnected
unique: 20168, opcode: GETATTR (3), nodeid: 1, insize: 40
(Continue reading)

BEUGIN Sylvain SCE | 10 Sep 2007 18:47

[sshfs] segmentation fault


Hi,

i use command

 sshfs -o ConnectTimeout=5 -o ServerAliveInterval=60 -o ServerAliveCountMax=1 -o TCPKeepAlive=yes -o
reconnect -o LogLevel=DEBUG3 -f -d user <at> remote:/partage/tmp/logs/CLI
<mailto:user <at> remote:/partage/tmp/logs/CLI>  /partage/tmp/logs/CLI /

whith version:

 $ sshfs -V
SSHFS version 1.6
FUSE library version: 2.5.3
fusermount version: 2.5.3
using FUSE kernel interface version 7.5

Then 

on first terminal i copy a bigtext to the  mounted directory  /partage/tmp/logs/CLI
on second terminal  i do  command "ls /partage/tmp/logs/CLI/CE" to test 

I start firewall on host remote  to simulate a broken line...
after 60 second i have got normal error (input /ouptut error) and suddenly after repeating  ls,  sshfs crash...

After that the monted directory is in strange state 

$ls /partage/tmp/logs/CLI
ls: /partage/tmp/logs/CLI: Noeud final de transport n'est pas connecté

(Continue reading)

BEUGIN Sylvain SCE | 11 Sep 2007 11:47

[sshfs] Segmentation fault (full debug)


Hi

Command:
sshfs -o ConnectTimeout=5 -o ServerAliveInterval=60 -o
ServerAliveCountMax=1 -o TCPKeepAlive=yes -o reconnect -o
LogLevel=DEBUG3 -f -d -o debug -o  sshfs_debug -o loglevel=debug
x <at> x.x.x.x:/partage/tmp/logs/CLI /partage/tmp/logs/CLI

A error during reconnection afert ServerAliveInterval timeout reached : 

debug2: client_session2_setup: id 0
debug1: Sending subsystem: sftp
debug2: channel 0: request subsystem confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 131072
Server version: 3
[08489] LSTAT
  [08489]         STATUS       33bytes (2ms)
   unique: 10448, error: -2 (No such file or directory), outsize: 16
unique: 10449, opcode: GETATTR (3), nodeid: 1, insize: 40
[08490] LSTAT
  [08490]          ATTRS       41bytes (0ms)
   unique: 10449, error: 0 (Success), outsize: 112
unique: 10450, opcode: OPENDIR (27), nodeid: 1, insize: 48
   unique: 10450, error: 0 (Success), outsize: 32
unique: 10451, opcode: GETATTR (3), nodeid: 1, insize: 40
   unique: 10451, error: 0 (Success), outsize: 112
unique: 10452, opcode: READDIR (28), nodeid: 1, insize: 64
(Continue reading)

Miklos Szeredi | 11 Sep 2007 18:57
Picon

Re: [sshfs] Bug : general protection rip

> Just encountered this, I've pasted in the dmesg which should supply you with
> any necessary info, if you need any more, just shout.
> 
> I've posted this incase it's of any use to anyone ! ;o)

Thanks.

Should be fixed in newer kernels (2.6.21 or greater I think).

Miklos

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Miklos Szeredi | 11 Sep 2007 19:14
Picon

Re: [sshfs] segmentation fault

> i use command
> 
>  sshfs -o ConnectTimeout=5 -o ServerAliveInterval=60 -o ServerAliveCountMax=1 -o TCPKeepAlive=yes
-o reconnect -o LogLevel=DEBUG3 -f -d user <at> remote:/partage/tmp/logs/CLI
<mailto:user <at> remote:/partage/tmp/logs/CLI>  /partage/tmp/logs/CLI /
> 
> 
> whith version:
> 
>  $ sshfs -V
> SSHFS version 1.6
> FUSE library version: 2.5.3
> fusermount version: 2.5.3
> using FUSE kernel interface version 7.5

Can you please try sshfs-1.8?  That has a couple of segfaults fixed.

Thanks,
Miklos

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Gmane