Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-28 Thread Scott Schwartz
On Fri, Jul 28, 2006 at 09:08:17AM -0600, Ronald G Minnich wrote:
> Scott Schwartz wrote:
> 
> >Is there enough 9p support in linux 2.6 to do that without fuse?
> 
> now you're depressing me. Yes, you can do 9p in linux 2.6 without fuse. 
> You just do a mount. I set a lot of mine up in /etc/fstab.
 
That's what I thought, but I wanted to double check. 
I'm not running 2.6 so it's hard to just try it. :)



Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-28 Thread Eric Van Hensbergen

On 7/28/06, Ronald G Minnich  wrote:

Scott Schwartz wrote:

> Is there enough 9p support in linux 2.6 to do that without fuse?

now you're depressing me. Yes, you can do 9p in linux 2.6 without fuse.
You just do a mount. I set a lot of mine up in /etc/fstab.

Or do you mean user mounts? Maybe I missed something.



User mounts (w/either FUSE or 9p) can be "tricked out" with a set-uid
mount helper (9p's would be called mount.9P I think).  Such a helper
is also needed in 9p to do DNS resolution (NFS name resolution is the
only special-case in mount).  I believe Lucho had a 9p helper that
took care of DNS resolution, could be made setuid and maybe even tried
to handle auth.
Its in the app directory on v9fs' sourceforge CVS. The discussion of
OLS was about how to remove the need for having a set-uid helper.

-eric


Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-28 Thread Ronald G Minnich

Scott Schwartz wrote:


Is there enough 9p support in linux 2.6 to do that without fuse?


now you're depressing me. Yes, you can do 9p in linux 2.6 without fuse. 
You just do a mount. I set a lot of mine up in /etc/fstab.


Or do you mean user mounts? Maybe I missed something.


Can someone who understands both compare this to v9fs?


Fuse is cute, it works, it's fine for the local case. It seems to be 
pretty solid. A very nice point solution, completely useless for what we 
do here at LANL. It seems to be easier for people to figure out than 9p 
servers. Another issue is that to date the 9p server libraries we had 
were mostly p9p-based, and Linux people prefer not to use p9p libraries 
to write software, I'm finding. Nothing wrong with p9p libraries, people 
just don't want to deal with them. Lucho has developed native Unix 
libraries which are pretty nice, and we're moving our software over to 
those.


thanks


ron


Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-28 Thread Ronald G Minnich

David Leimbach wrote:


Yeah but it did allow that, it would currently allow users to bind
their own passwd file or sudoers etc etc over /etc (unless they had an
implementation that prevented such things).


right, so in my v9fs on Linux 2.0, I made the 9p lack-of-attributes such 
as dev inode, suid, ec. out as a virtue. You could not express most of 
the ideas that were security issues in Unix.


If you add a few restrictions on where user mounts are allowed to go 
(e.g. you're only allowed to mount on /private, for example), I think 
you can knock a lot of the harder problems. It's all a hack, I guess, 
but there's only so much you can do on Unix. I still think you can do 
user mounts and still be safe.


ron


Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-28 Thread Ronald G Minnich

csant wrote:

But you'd have the 9p module, obviously. It's such a nonsene that the  
linux kernel doesn't allow mounting for non-privileged users  
out-of-the-box, IMO. I like filesystems in userspace.



it's an old argument which I have had had with multiple people multiple 
times since 1998, and lost every time :-)


It's always "but why do you want that" and "you don't want that" or "we 
can already to that" or "we tried that, it didn't work" and back to "but 
why do you want that".


Charles nailed it. The Land That Time Forgot.

ron


Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-28 Thread erik quanstrom
talk about reinventing the wheel!  once more with epicyclic gearing!
(apologies to arlo.)

- erik

On Fri Jul 28 08:58:14 CDT 2006, [EMAIL PROTECTED] wrote:
> I wonder how dragonflyBSD is coming along with their VFS "messaging"
> stuff.  They want to make it easy to do SSI clusters (single system
> image).  It sounds like FUSE would be completely redundant on this
> platform, and one could implement 9p translation trivially.
> 
> I once asked if Matt had even looked at plan 9's way of making things
> plug into the filesystem namespace via 9p and I actually don't
> remember what his response was but he seemed that he really wanted to
> do it his way :-)
> 
> Dave


Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-28 Thread David Leimbach

On 7/28/06, Eric Van Hensbergen <[EMAIL PROTECTED]> wrote:

On 7/28/06, csant <[EMAIL PROTECTED]> wrote:
> > this allows me (without becoming root or having v9fs) to
> >   ; mount $home/9/acme
>
> But you'd have the 9p module, obviously. It's such a nonsene that the
> linux kernel doesn't allow mounting for non-privileged users
> out-of-the-box, IMO. I like filesystems in userspace.
>

This was discussed a bit at OLS -  there have been folks working
towards it for a bit, but I think we'll finally see it within the next
year.


I wonder how dragonflyBSD is coming along with their VFS "messaging"
stuff.  They want to make it easy to do SSI clusters (single system
image).  It sounds like FUSE would be completely redundant on this
platform, and one could implement 9p translation trivially.

I once asked if Matt had even looked at plan 9's way of making things
plug into the filesystem namespace via 9p and I actually don't
remember what his response was but he seemed that he really wanted to
do it his way :-)

Dave



   -eric



Re: Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-28 Thread David Leimbach

Oh I know it's solvable.

A buddy of mine had a PAM module where you only had to "not lose" a
game of tic tac toe to be authenticated So sure, there are lots of
options there.

My point was that I think I really like the way fossil doesn't really
do auth, yet still controls who's in what groups or at least appears
to control all of this through fscons.



On 7/28/06, erik quanstrom <[EMAIL PROTECTED]> wrote:

the /etc/(passwd|shadow) problem is solvable.  linux pam/shadow login supports 
ldap already,
the linux kernel supports 9p already and /bin/(login|su) could consult an 
authentication server
on the loopback device, if one were so inclined.  it's not like this would be a 
radical departure
from authentication methods pam already supports --- like ldap.

- erik



Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-28 Thread Eric Van Hensbergen

On 7/28/06, csant <[EMAIL PROTECTED]> wrote:

> this allows me (without becoming root or having v9fs) to
>   ; mount $home/9/acme

But you'd have the 9p module, obviously. It's such a nonsene that the
linux kernel doesn't allow mounting for non-privileged users
out-of-the-box, IMO. I like filesystems in userspace.



This was discussed a bit at OLS -  there have been folks working
towards it for a bit, but I think we'll finally see it within the next
year.

  -eric


Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-28 Thread erik quanstrom
the /etc/(passwd|shadow) problem is solvable.  linux pam/shadow login supports 
ldap already,
the linux kernel supports 9p already and /bin/(login|su) could consult an 
authentication server
on the loopback device, if one were so inclined.  it's not like this would be a 
radical departure
from authentication methods pam already supports --- like ldap.

- erik


Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-28 Thread Scott Schwartz
On Thu, Jul 27, 2006 at 10:50:29AM -0600, andrey mirtchovski wrote:
> >The fuse module is a kernel module, and part of the kernel tree,  
> >the userland tools are not.
> 
> i kept thinking that all i need to do is mount :)

Is there enough 9p support in linux 2.6 to do that without fuse?
Can someone who understands both compare this to v9fs?



Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread David Leimbach

On 7/27/06, csant <[EMAIL PROTECTED]> wrote:

> this allows me (without becoming root or having v9fs) to
>   ; mount $home/9/acme

But you'd have the 9p module, obviously. It's such a nonsene that the
linux kernel doesn't allow mounting for non-privileged users
out-of-the-box, IMO. I like filesystems in userspace.


Yeah but it did allow that, it would currently allow users to bind
their own passwd file or sudoers etc etc over /etc (unless they had an
implementation that prevented such things).

The problems in unix really were too deep to fix at some point... at
least in any elegant way :-)



/c



Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread csant

this allows me (without becoming root or having v9fs) to
; mount $home/9/acme


But you'd have the 9p module, obviously. It's such a nonsene that the  
linux kernel doesn't allow mounting for non-privileged users  
out-of-the-box, IMO. I like filesystems in userspace.


/c


Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread Gorka guardiola

Just to add a positive comment, worked for me instantly with no sweat with the
last fuse version, kernel 2.6, debian.
--
- curiosity sKilled the cat


Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread erik quanstrom
i use this in my /etc/fstab

/tmp/ns.quanstro.:0/acme/home/quanstro/9/acme   9P  
uid=1000,user,name=quanstro,proto=unix,noauto   0 0
/tmp/ns.quanstro.:0/upasfs  /home/quanstro/9/upasfs 9P  
uid=1000,user,name=quanstro,proto=unix,noauto   0 0
/tmp/ns.quanstro.:0/sources /home/quanstro/9/sources9P  
uid=1000,user,name=quanstro,proto=unix,noauto   0 0
/tmp/ns.quanstro.:0/tapefs  /home/quanstro/9/tapefs 9P  
uid=1000,user,name=quanstro,proto=unix,noauto   0 0
/tmp/ns.quanstro.:0/dns /home/quanstro/9/dns9P  
uid=1000,user,name=quanstro,proto=unix,noauto   0 0

this allows me (without becoming root or having v9fs) to 
; mount $home/9/acme
assuming that acme is running and my current namespace is the default.

- erik

On Thu Jul 27 17:58:11 CDT 2006, [EMAIL PROTECTED] wrote:
> I had 9P mounting working but the v9fs (9P) module has vanished from
> my Linux machine.  As root, I invoked the equivalent in C of
> 
>   mount -t 9P -o proto=fd,name=$LOGNAME,rfdno=%d,wfdno=%d '' /n/remote
> 
> where %d is the file descriptor to communicate with the 9P server.
> The more common usage is
> 
>   mount -t 9P -o name=geoff 10.240.55.178 /n/remote


Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread Russ Cox

9 mount (http://swtch.com/usr/local/plan9/bin/mount) does try 9P first.
Not everyone has v9fs though (e.g., Linux 2.4).

Russ


Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread geoff
I had 9P mounting working but the v9fs (9P) module has vanished from
my Linux machine.  As root, I invoked the equivalent in C of

mount -t 9P -o proto=fd,name=$LOGNAME,rfdno=%d,wfdno=%d '' /n/remote

where %d is the file descriptor to communicate with the 9P server.
The more common usage is

mount -t 9P -o name=geoff 10.240.55.178 /n/remote



Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread Russ Cox

"Fixed."

tux=; cvs diff -u -r1.7 main.c
Index: main.c
===
RCS file: /home/am3/rsc/cvsroot/plan9/src/cmd/9pfuse/main.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- main.c  27 Jul 2006 05:14:16 -  1.7
+++ main.c  27 Jul 2006 22:36:00 -  1.8
@@ -23,8 +23,12 @@
#define O_DIRECTORY 0
#endif
#ifndef O_LARGEFILE
+#if defined(__linux__)
+#define O_LARGEFILE 010  /* Sigh */
+#else
#define O_LARGEFILE 0
#endif
+#endif


int debug;
tux=;


On 7/27/06, andrey mirtchovski <[EMAIL PROTECTED]> wrote:

trying on the aforementioned intel with the aforementioned linux
distribution i get 'permission denied' errors every time i try to
access the mounted directory.

turns out that fuse sends out an extra flag, O_LARGEFILE=0x8000, which
9pfuse.c thinks it has masked. it also turns out that the two programs
involved differ over what O_LARGEFILE should be defined as:
O_LARGEFILE is 0 for 9pfuse.c (actually it was defined at compile time
as it couldn't find it in the include files)

bits/fcntl.h has the following to say (after a few spelling errors):

#ifdef __USE_LARGEFILE64
# if __WORDSIZE == 64
#  define O_LARGEFILE   0
# else
#  define O_LARGEFILE   010
# endif
#endif

this particular standard installation has __USE_LARGEFILE64 undefined,
and i assume that the one which the kernel was compiled on did.

i suppose i should recompile the fuse module, or fusermount or
something else... i feel a sacrifice is required.




Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread Skip Tavakkolian
> i suppose i should recompile the fuse module, or fusermount or
> something else... i feel a sacrifice is required.

i saw in a movie where they used a bucket of kfc chicken (original
recipe i think) instead of a live chicken. worth a try.



Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread andrey mirtchovski

trying on the aforementioned intel with the aforementioned linux
distribution i get 'permission denied' errors every time i try to
access the mounted directory.

turns out that fuse sends out an extra flag, O_LARGEFILE=0x8000, which
9pfuse.c thinks it has masked. it also turns out that the two programs
involved differ over what O_LARGEFILE should be defined as:
O_LARGEFILE is 0 for 9pfuse.c (actually it was defined at compile time
as it couldn't find it in the include files)

bits/fcntl.h has the following to say (after a few spelling errors):

#ifdef __USE_LARGEFILE64
# if __WORDSIZE == 64
#  define O_LARGEFILE   0
# else
#  define O_LARGEFILE   010
# endif
#endif

this particular standard installation has __USE_LARGEFILE64 undefined,
and i assume that the one which the kernel was compiled on did.

i suppose i should recompile the fuse module, or fusermount or
something else... i feel a sacrifice is required.


Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread Charles Forsyth
> i kept thinking that all i need to do is mount :)

just keep reminding yourself that you're in The Land that Time Forgot



Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread csant
The fuse module is a kernel module, and part of the kernel tree, the  
userland tools are not.


i kept thinking that all i need to do is mount :)


AFAIK you need some filesystem specific mount tool, and umount (requires  
root privileges) or fusermount (no root privileges) to unmount. Not  
actually sure if you can mount simply with mount.


Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread andrey mirtchovski
The fuse module is a kernel module, and part of the kernel tree,  
the userland tools are not.


i kept thinking that all i need to do is mount :)



Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread csant

It's part of FUSE, isn't it? http://fuse.sourceforge.net/


i thought that was already installed, after all the fuse module is :)


The fuse module is a kernel module, and part of the kernel tree, the  
userland tools are not.


Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread andrey mirtchovski


It's part of FUSE, isn't it? http://fuse.sourceforge.net/


i thought that was already installed, after all the fuse module is :) 


Re: Re: Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread csant

i'm trying this on fedora core 5 (intel's core duo) but seem to be
missing a 'fusermount' program. i'm trying to find it now and when i
do i'll let you know (so far i'm only finding advisories and bug
reports about it).


It's part of FUSE, isn't it? http://fuse.sourceforge.net/


Re: Re: Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread andrey mirtchovski

i'm trying this on fedora core 5 (intel's core duo) but seem to be
missing a 'fusermount' program. i'm trying to find it now and when i
do i'll let you know (so far i'm only finding advisories and bug
reports about it).


Re: Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread Russ Cox

the new script 'mount' relies on a recent change to rc to allow
unquoted ='s in argument lists. i suspect you're running an old rc.
either update rc or modify the mount script to quote your ='s.


That change isn't quite correct, either, but I haven't
gotten to fixing it yet.  (It turns "echo a = b" into "echo a=b".)

I fixed the mount script to quote properly.

Russ


Re: Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-27 Thread Anthony Sorace

the new script 'mount' relies on a recent change to rc to allow
unquoted ='s in argument lists. i suspect you're running an old rc.
either update rc or modify the mount script to quote your ='s.


Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-26 Thread csant
i think you must omit "x40=;" as that is russ' prompt. either that or  
use 9term.


Yes, yes - I am omitting the prompt :)
Still I get a syntax error I cannot make any sense of... (the syntax is  
right, isn't it?)
Haven't tried 9term yet, but last time I did it killed my X server - need  
to investigate on that - so I'd like to postpone that try.



On 7/27/06, csant <[EMAIL PROTECTED]> wrote:

>   x40=; 9 mount `namespace`/acme /mnt/acme
I get a
rc: /usr/local/plan9/bin/mount:12: token '=': syntax error
on Linux.







--
[Quote]
I have measured out my life with coffee spoons;
~~~ T.S. Eliot


Re: Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-26 Thread andrey mirtchovski

i think you must omit "x40=;" as that is russ' prompt. either that or use 9term.

On 7/27/06, csant <[EMAIL PROTECTED]> wrote:

>   x40=; 9 mount `namespace`/acme /mnt/acme
I get a
rc: /usr/local/plan9/bin/mount:12: token '=': syntax error
on Linux.



Re: [9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-26 Thread csant

x40=; 9 mount `namespace`/acme /mnt/acme

I get a
rc: /usr/local/plan9/bin/mount:12: token '=': syntax error
on Linux.


[9fans] mount 9P on Linux and FreeBSD via FUSE

2006-07-26 Thread Russ Cox

Various changes to p9p over the weekend;
see http://swtch.com/usr/local/plan9/CHANGES.

The changes center around a new program called 9pfuse
(inspired by Christoph Lohmann's program of the same name)
that mounts 9P servers on Linux and FreeBSD via FUSE.
9pfuse uses the raw FUSE message format instead of using
the high-level library interface, which actually hides some
details important to a faithful translation.

The net result is that I can do:

x40=; 9 mount `namespace`/acme /mnt/acme
x40=; ls /mnt/acme
309  355  356  acme  cons  consctl  draw  editout  index  label  new
x40=; cat /mnt/acme/356/body
Hello, FUSE!
x40=; unmount /mnt/acme
x40=;

Thanks to Lou Kamenov for working through some FreeBSD
bugs.  If you want to use 9pfuse on FreeBSD you'll need the
very latest FUSE implementation (this morning's), which
fixes some protocol errors on the part of the kernel module.

And thanks to Christoph Lohmann for writing the other 9pfuse.

Russ