From: "Michael Kerrisk" <mtk-lkml@gmx.net>
To: Jacky Malcles <Jacky.Malcles@bull.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: A question about extended attributes of filesystem objects (setfattr command)
Date: Wed, 30 Jun 2004 16:21:06 +0200 (MEST) [thread overview]
Message-ID: <30493.1088605266@www51.gmx.net> (raw)
In-Reply-To: 40E2C888.BB5BB7F1@bull.net
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 2202 bytes --]
Salut Jacky,
> > > I have a question regarding
> > > Attributes of symlinks vs. the files pointed to
> > >
> > > If I try to attach name:value pair to object symlink file
> > > then I'll get: "Operation not permitted"
> >
> > What file system are you using? If ext2, ext3 (or patched kernel
> > supporting Reiserfs EAs), did you mount with "-o user_xattr?
> > (The above error suggests you haven't used this option.)
>
> # mount
> /dev/sdb3 on /a type ext3 (rw,acl,user_xattr)
> ...etc...
Okay.
> > > reading the man pages of setfattr (or attr) I thought that it operates
> > > on the attributes of the symbolic link itself.
> >
> > No, these commands follow symbolic links.
> >
> > > show:
> > > -----
> > > touch f
> > > ln -s f l
> > > setfattr -n user.filename -v ascii1 f l
> > > setfattr -h -n user.filename -v ascii2 f
> > > getfattr -d f l
> > > setfattr -h -n user.filename -v ascii3 l
> > > setfattr -h --no-dereference -n user.filename -v ascii4 l
I'm sorry -- I missed the above "--no-dereference"; that's why
my point below becomes relevant.
> > > getfattr -d f l
> > >
> > > so, my question is : what is expected ?
> should have added this:
>
> [root@t20 acl]# show
> # file: f
> user.filename="ascii2"
>
> # file: l
> user.filename="ascii2"
>
> setfattr: l: Operation not permitted
> setfattr: l: Operation not permitted
> # file: f
> user.filename="ascii2"
>
> # file: l
> user.filename="ascii2"
>
> [root@t20 acl]#
But note the following:
> > attr(5) specifically notes that USER EAs are disallowed on
> > symbolic links, but this is rather an issu that affects the
> > use of lsetxattr(2).
or setfattr if you specify "--no-dereference"...
There is a reason for this restriction: for a symbolic link, all
permissions are enabled for all users, and these permissions
cannot be changed. This means that permissions cannot be used (as
they would be with regular files) to prevent arbitrary users from
placing user EAs on a symbolic link. Thus all users are
prevented from creating user EAs on the symbolic link.
Michael
--
+++ Jetzt WLAN-Router für alle DSL-Einsteiger und Wechsler +++
GMX DSL-Powertarife zudem 3 Monate gratis* http://www.gmx.net/dsl
next prev parent reply other threads:[~2004-06-30 14:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-30 12:52 A question about extended attributes of filesystem objects (setfattr command) Jacky Malcles
2004-06-30 13:31 ` Michael Kerrisk
2004-06-30 14:04 ` Jacky Malcles
2004-06-30 14:21 ` Michael Kerrisk [this message]
2004-06-30 14:22 ` Jacky Malcles
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=30493.1088605266@www51.gmx.net \
--to=mtk-lkml@gmx.net \
--cc=Jacky.Malcles@bull.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.