Re: [9fans] copying over 9P using plan9port

2011-10-05 Thread Nicolas Bercher

On 04/10/2011 19:08, Jens Staal wrote:

When I then try something like

cp -ar sources/plan9/sys/src/ape ape

I get an error stating:
unexpected open flags 050cp: can not open
”sources/plan9/sys/src/ape/9src/mkfile” for reading: Access denied



Hi,

This is working for me without plan9port (Debian GNU/Linux):

  $ mkdir -p /n/sources
  $ mount -t 9p -o proto=tcp 204.178.31.11 /n/sources
  $ cp -ar /n/sources/plan9/sys/src/ape /tmp/ape

Nicolas



[9fans] copying over 9P using plan9port

2011-10-04 Thread Jens Staal
Hi.

First of all sorry if I through my ignorance am attempting something
completely stupid.

I have been trying to copy the APE sources using plan9port. The
purpose of this is that I am trying to make an APE augmentation
PKGBUILD to the kencc package [1] (and ultimately, I will try to
figure out how to make a kencc+APE cross compiler for Plan9 on a Linux
host) for Arch linux.

I have also asked at the Arch forums [2] but no answers yet, so I
guess it is nothing anyone has attempted...

I can mount the sources at bell labs using the following procedure

mkdir sources
9 mount 'tcp!sources.cs.bell-labs.com' sources

I can then cd and explore the bell labs sources via plan9port, so that
works just fine.

When I then try something like

cp -ar sources/plan9/sys/src/ape ape

I get an error stating:
unexpected open flags 050cp: can not open
”sources/plan9/sys/src/ape/9src/mkfile” for reading: Access denied

What I now wonder is: Is this the expected behaviour? Is anonymous
copying from the Bell labs sources blocked? Or is the permission
issues local and something I can fix by a mount option? I could not
find anything using 9 man mount...

[1] https://aur.archlinux.org/packages.php?ID=49835
[2] https://bbs.archlinux.org/viewtopic.php?id=127522



Re: [9fans] copying over 9P using plan9port

2011-10-04 Thread David du Colombier
 What I now wonder is: Is this the expected behaviour?

No. You are doing it fine.
It's working for me right now, authenticated and unauthenticated.

I don't know why it doesn't work for you.
Beware 9 mount should be spelled 9mount in your messages.

What kernel version are you using?

-- 
David du Colombier



Re: [9fans] copying over 9P using plan9port

2011-10-04 Thread Jens Staal
2011/10/4 David du Colombier 0in...@gmail.com:
 What I now wonder is: Is this the expected behaviour?

 No. You are doing it fine.
 It's working for me right now, authenticated and unauthenticated.

 I don't know why it doesn't work for you.
 Beware 9 mount should be spelled 9mount in your messages.

 What kernel version are you using?

 --
 David du Colombier



uname -r:
3.0-ARCH

Since you ask about kernel version, I guessed that it meant that it
might be a permission issue on my side. I also tried doing the same
mount and copy as root.
This also failed, so I am confused.



Re: [9fans] copying over 9P using plan9port

2011-10-04 Thread Russ Cox
What does 'mount' (not 9 mount, just mount)
say after you mount the file system?

That will tell you whether the '9 mount' used
v9fs (Linux 9P driver) or 9pfuse (user-space
9P-to-FUSE translator).

Neither gets much use, so it is easy to believe
that there is a bug.

Russ



Re: [9fans] copying over 9P using plan9port

2011-10-04 Thread Brian L. Stuart
 I can then cd and explore the bell labs sources via
 plan9port, so that
 works just fine.
 
 When I then try something like
 
 cp -ar sources/plan9/sys/src/ape ape
 
 I get an error stating:
 unexpected open flags 050cp: can not open
 ”sources/plan9/sys/src/ape/9src/mkfile” for reading:
 Access denied

Give it a shot without the -a.  I've had a lot of issues
with the strange attribute flags in modern Unices.  The
issues have usually been when writing via 9p, but it's
worth a try to see if that has anything to do with it.
Any idea what the 050 flags indicate on your system?

BLS




Re: [9fans] copying over 9P using plan9port

2011-10-04 Thread Russ Cox
To answer my question: the error message comes from 9pfuse.
The extra bits are O_NOFOLLOW and O_LARGEFILE, both of
which seem harmless in this context.  Try this:


diff -r 6db8fc2588f6 src/cmd/9pfuse/main.c
--- a/src/cmd/9pfuse/main.c Mon Oct 03 18:16:09 2011 -0400
+++ b/src/cmd/9pfuse/main.c Tue Oct 04 15:43:16 2011 -0400
@@ -577,6 +577,13 @@
openmode = flags3;
flags = ~3;
flags = ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC);
+#ifdef O_NOFOLLOW
+   flags = ~O_NOFOLLOW
+#endif
+#ifdef O_LARGEFILE
+   flags = ~O_LARGEFILE
+#endif
+
/*
 * Discarding O_APPEND here is not completely wrong,
 * because the host kernel will rewrite the offsets
@@ -594,7 +601,7 @@
 *  O_NONBLOCK - ONONBLOCK
 */
if(flags){
-   fprint(2, unexpected open flags %#uo, (uint)in-flags);
+   fprint(2, unexpected open flags %#uo\n, (uint)in-flags);
replyfuseerrno(m, EACCES);
return;
}



Re: [9fans] copying over 9P using plan9port

2011-10-04 Thread Jens Staal
2011/10/4 Russ Cox r...@swtch.com:
 What does 'mount' (not 9 mount, just mount)
 say after you mount the file system?

 That will tell you whether the '9 mount' used
 v9fs (Linux 9P driver) or 9pfuse (user-space
 9P-to-FUSE translator).

 Neither gets much use, so it is easy to believe
 that there is a bug.

 Russ



The p9p 9mount uses 9pfuse on my system



Re: [9fans] copying over 9P using plan9port

2011-10-04 Thread Jens Staal
2011/10/4 Russ Cox r...@swtch.com:
 To answer my question: the error message comes from 9pfuse.
 The extra bits are O_NOFOLLOW and O_LARGEFILE, both of
 which seem harmless in this context.  Try this:


 diff -r 6db8fc2588f6 src/cmd/9pfuse/main.c
 --- a/src/cmd/9pfuse/main.c     Mon Oct 03 18:16:09 2011 -0400
 +++ b/src/cmd/9pfuse/main.c     Tue Oct 04 15:43:16 2011 -0400
 @@ -577,6 +577,13 @@
        openmode = flags3;
        flags = ~3;
        flags = ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC);
 +#ifdef O_NOFOLLOW
 +       flags = ~O_NOFOLLOW
 +#endif
 +#ifdef O_LARGEFILE
 +       flags = ~O_LARGEFILE
 +#endif
 +
        /*
         * Discarding O_APPEND here is not completely wrong,
         * because the host kernel will rewrite the offsets
 @@ -594,7 +601,7 @@
         *      O_NONBLOCK - ONONBLOCK
         */
        if(flags){
 -               fprint(2, unexpected open flags %#uo, (uint)in-flags);
 +               fprint(2, unexpected open flags %#uo\n, (uint)in-flags);
                replyfuseerrno(m, EACCES);
                return;
        }



Thanks I will try the patch as soon as I got time.

@ brian:

doing cp -r instead of cp -ar did not make a difference