[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fsetxattr() fails on a writable descriptor?
From: |
Pádraig Brady |
Subject: |
fsetxattr() fails on a writable descriptor? |
Date: |
Tue, 8 Sep 2009 12:29:49 +0100 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071008) |
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");
}
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, (continued)
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, Ondřej Vašík, 2009/09/07
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, Pádraig Brady, 2009/09/07
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, Ondřej Vašík, 2009/09/14
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, Pádraig Brady, 2009/09/14
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, Jim Meyering, 2009/09/14
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, Ondřej Vašík, 2009/09/15
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, Jim Meyering, 2009/09/15
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, Ondřej Vašík, 2009/09/15
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, Jim Meyering, 2009/09/15
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, Pádraig Brady, 2009/09/15
- fsetxattr() fails on a writable descriptor?,
Pádraig Brady <=
- Re: fsetxattr() fails on a writable descriptor?, Christoph Hellwig, 2009/09/08
- Re: fsetxattr() fails on a writable descriptor?, Pádraig Brady, 2009/09/09
- Re: [PATCH] cp, mv: do preserve extended attributes even for read-only source files, Jim Meyering, 2009/09/07