symlink xattrs

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

symlink xattrs

Michael j Theall
I'm trying to test xattrs on symlinks in my filesystem, but only
llistxattr actually invokes listxattr in fuse_lowlevel_ops. Any attempt to
use lgetxattr, lsetxattr, or lremovexattr comes back immediately with
EPERM without any apparent attempt to consult my filesystem. They do go
through with regular files and directories, but not with symlinks,
regardless of whether the link is broken or not. The permissions for the
symlink are 777, and I'm using FUSE 2.8.3 lowlevel API on a 2.6.32 kernel.
Any ideas?

Regards,

Michael Theall
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: symlink xattrs

David Bartley-4
On Wed, Aug 7, 2013 at 8:35 AM, Michael j Theall <[hidden email]> wrote:

> I'm trying to test xattrs on symlinks in my filesystem, but only
> llistxattr actually invokes listxattr in fuse_lowlevel_ops. Any attempt to
> use lgetxattr, lsetxattr, or lremovexattr comes back immediately with
> EPERM without any apparent attempt to consult my filesystem. They do go
> through with regular files and directories, but not with symlinks,
> regardless of whether the link is broken or not. The permissions for the
> symlink are 777, and I'm using FUSE 2.8.3 lowlevel API on a 2.6.32 kernel.
> Any ideas?
>

Try turning on fuselib debugging (pass -d as an arg to fuse_main) to see if
the requests make it out of the kernel. xattrs on symlinks should
definitely work.


>
> Regards,
>
> Michael Theall
>
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
> _______________________________________________
> fuse-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/fuse-devel
>
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: symlink xattrs

Michael j Theall
The only thing that shows up when using -d is a lookup. The command I was
trying is:

getfattr -h -n user.attr <filename>

A clip from strace:

lstat("<filename>", {st_mode=S_IFLNK|0777, st_size=3, ...}) = 0
lgetxattr("<filename>", "user.attr", 0x0, 0) = -1 EPERM (Operation not
permitted)

Output from FUSE program:

unique: 579, opcode: GETATTR (3), nodeid: 1, insize: 56
   unique: 579, success, outsize: 120
unique: 580, opcode: LOOKUP (1), nodeid: 1, insize: 48
   unique: 580, success, outsize: 144

Regards,

Michael Theall

David Bartley <[hidden email]> wrote on 08/07/2013 10:05:26 PM:

> From: David Bartley <[hidden email]>
> To: Michael j Theall/Houston/IBM@IBMUS,
> Cc: [hidden email]
> Date: 08/07/2013 10:05 PM
> Subject: Re: [fuse-devel] symlink xattrs
>
> On Wed, Aug 7, 2013 at 8:35 AM, Michael j Theall <[hidden email]>
wrote:
> I'm trying to test xattrs on symlinks in my filesystem, but only
> llistxattr actually invokes listxattr in fuse_lowlevel_ops. Any attempt
to
> use lgetxattr, lsetxattr, or lremovexattr comes back immediately with
> EPERM without any apparent attempt to consult my filesystem. They do go
> through with regular files and directories, but not with symlinks,
> regardless of whether the link is broken or not. The permissions for the
> symlink are 777, and I'm using FUSE 2.8.3 lowlevel API on a 2.6.32
kernel.

> Any ideas?
>
> Try turning on fuselib debugging (pass -d as an arg to fuse_main) to
> see if the requests make it out of the kernel. xattrs on symlinks
> should definitely work.
>  
>
> Regards,
>
> Michael Theall
>
------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite!
> It's a free troubleshooting tool designed for production.
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
>
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

> _______________________________________________
> fuse-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/fuse-devel
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|

Re: symlink xattrs

Jean-Pierre André
In reply to this post by Michael j Theall


Michael j Theall wrote:
> I'm trying to test xattrs on symlinks in my filesystem, but only
> llistxattr actually invokes listxattr in fuse_lowlevel_ops. Any attempt to
> use lgetxattr, lsetxattr, or lremovexattr comes back immediately with
> EPERM without any apparent attempt to consult my filesystem. They do go
> through with regular files and directories, but not with symlinks,
> regardless of whether the link is broken or not. The permissions for the
> symlink are 777, and I'm using FUSE 2.8.3 lowlevel API on a 2.6.32 kernel.
> Any ideas?

 From http://linux.die.net/man/5/attr :

For regular files and directories the file permission bits define access
to the file's contents, while for device special files they define
access to the device described by the special file. The file permissions
of symbolic links are not used in access checks. These differences would
allow users to consume filesystem resources in a way not controllable by
disk quotas for group or world writable special files and directories.

For this reason, *extended user attributes are only allowed for regular
files and directories*, and access to extended user attributes is
restricted to the owner and to users with appropriate capabilities for
directories with the sticky bit set



------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel