Brady Chen | 18 May 2009 18:08
Picon

create a 555 mode file get permssion denied

Hi all,

Here this scenario:
$ echo test > ReadOnlyFile
$ chmod 555 ReadOnlyFile
$ tar cf Tar.tar ReadOnlyFile
$ tar xf Tar.tar
tar: ReadOnlyFile: Cannot open: Permission denied
tar: Error exit delayed from previous errors

I searched the mail list:
seems like the same issue as
http://sourceforge.net/mailarchive/forum.php?thread_name=46F784A0.6090704 <at> Sun.COM&forum_name=fuse-sshfs

use the test cases in the thread (source code attached, surround with
<code>), got the "permission deny error" too. (it's said that it's a
very old bug, should have been fixed)

and here is sshfs version info
$sshfs -V
SSHFS version 2.2
FUSE library version: 2.7.4
fusermount version: 2.7.4
using FUSE kernel interface version 7.8

$ uname -a
Linux sh-audi 2.6.9-5.EL #1 Wed Jan 5 19:22:18 EST 2005 i686 i686 i386 GNU/Linux

any one have the same issues? thanks in advance.

(Continue reading)

Miklos Szeredi | 25 May 2009 16:56
Picon

Re: create a 555 mode file get permssion denied

On Tue, 19 May 2009, Brady Chen wrote:
> Hi all,
> 
> Here this scenario:
> $ echo test > ReadOnlyFile
> $ chmod 555 ReadOnlyFile
> $ tar cf Tar.tar ReadOnlyFile
> $ tar xf Tar.tar
> tar: ReadOnlyFile: Cannot open: Permission denied
> tar: Error exit delayed from previous errors
> 
> I searched the mail list:
> seems like the same issue as
> http://sourceforge.net/mailarchive/forum.php?thread_name=46F784A0.6090704 <at> Sun.COM&forum_name=fuse-sshfs
> 
> use the test cases in the thread (source code attached, surround with
> <code>), got the "permission deny error" too. (it's said that it's a
> very old bug, should have been fixed)
> 
> and here is sshfs version info
> $sshfs -V
> SSHFS version 2.2
> FUSE library version: 2.7.4
> fusermount version: 2.7.4
> using FUSE kernel interface version 7.8
> 
> $ uname -a
> Linux sh-audi 2.6.9-5.EL #1 Wed Jan 5 19:22:18 EST 2005 i686 i686 i386 GNU/Linux
> 

(Continue reading)

Brady Chen | 26 May 2009 03:38
Picon

Re: create a 555 mode file get permssion denied

Hi Miklos,
thanks very much.

Read many discussions in the mail list, seems that to fix this
problem, the kernel need to support a new syscall (create), it's
supported from 2.6.15.

However, I'm trying to use sshfs in a server, which I can not upgrade
the kernel.
so I'm seeking a user-space solution.
In the faq document of fuse-2.7.4/FAQ, I found it's doable. Not sure
if anyone have the user-space solution for this issue.

Thanks
-Brady

==snip start from fuse-2.7.4/FAQ==
Defining the 'create' method solves this problem, however this
requires a Linux kernel version of at least 2.6.15 and libfuse version
2.5 or greater (on FreeBSD you'll need fuse4bsd-0.3.0-pre1 or newer
for this).
There can be other workarounds, however the easy one is to use the
"default_permissions" mount option, and to avoid checking permissions
on open.  If you store files on a filesystem, this can get tricky
because you will have to change the file mode to allow writing.  Using
the stateful API (i.e. returning an handle on open) will simplify
things.  In this case, and using "-o default_permissions", when
implementing the open call you have to:
1. check if the open is in write mode (i.e. mode has O_RDWR or
   O_WRONLY)
(Continue reading)

Miklos Szeredi | 27 May 2009 12:54
Picon

Re: create a 555 mode file get permssion denied

On Tue, 26 May 2009, Brady Chen wrote:
> Hi Miklos,
> thanks very much.
> 
> Read many discussions in the mail list, seems that to fix this
> problem, the kernel need to support a new syscall (create), it's
> supported from 2.6.15.
> 
> However, I'm trying to use sshfs in a server, which I can not upgrade
> the kernel.
> so I'm seeking a user-space solution.
> In the faq document of fuse-2.7.4/FAQ, I found it's doable. Not sure
> if anyone have the user-space solution for this issue.

It is probably doable for sshfs as well, but I'm not aware of anyone
actually implementing it for sshfs.

Thanks,
Miklos

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 

Gmane