From: "Pádraig Brady" <P@draigBrady.com>
To: xfs@oss.sgi.com
Cc: CoreutilsBugs <bug-coreutils@gnu.org>
Subject: fsetxattr() fails on a writable descriptor?
Date: Tue, 8 Sep 2009 12:29:49 +0100 [thread overview]
Message-ID: <4AA6402D.8040209@draigBrady.com> (raw)
In-Reply-To: <1252318482.3852.18.camel@dhcp-lab-219.englab.brq.redhat.com>
fsetxattr() is failing for me when the permissions are readonly
but the descriptor is writable as demonstrated by the program below.
I've tried this on ext3 and ext4 with libattr-2.4.43-3.fc11.i586
and linux-2.6.30.5-43.fc11.i586
Is this expected?
cheers,
Pádraig.
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <attr/libattr.h>
#include <stdio.h>
#include <unistd.h>
int main(void)
{
int wfd;
if ((wfd=open("writable", O_CREAT|O_WRONLY|O_EXCL, S_IRUSR)) == -1)
fprintf(stderr, "open('writable') error [%m]\n");
if (write(wfd, "data", 1) == -1)
fprintf(stderr, "write() error [%m]\n");
if (fsetxattr(wfd, "user.test", "test", 4, 0) == -1)
fprintf(stderr, "fsetxattr() error [%m]\n");
}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next parent reply other threads:[~2009-09-08 11:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1251987642.3855.36.camel@dhcp-lab-219.englab.brq.redhat.com>
[not found] ` <4AA1A3E6.2020606@draigBrady.com>
[not found] ` <87k50den1e.fsf@meyering.net>
[not found] ` <1252309787.3852.8.camel@dhcp-lab-219.englab.brq.redhat.com>
[not found] ` <4AA4C950.3080303@draigBrady.com>
[not found] ` <1252318482.3852.18.camel@dhcp-lab-219.englab.brq.redhat.com>
2009-09-08 11:29 ` Pádraig Brady [this message]
2009-09-08 18:40 ` fsetxattr() fails on a writable descriptor? Christoph Hellwig
2009-09-09 21:23 ` Pádraig Brady
2009-09-09 22:14 ` Michael Monnerie
2009-10-13 23:58 ` Christoph Hellwig
2009-10-14 1:17 ` Michael Monnerie
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=4AA6402D.8040209@draigBrady.com \
--to=p@draigbrady.com \
--cc=bug-coreutils@gnu.org \
--cc=xfs@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox