Bug 842319 - getfattr fails for non-root users
Summary: getfattr fails for non-root users
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: glusterfs
Version: 2.0
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Amar Tumballi
QA Contact: Sudhir D
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-23 13:21 UTC by Tim Speetjens
Modified: 2013-12-19 00:08 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-25 04:44:26 UTC
Embargoed:


Attachments (Terms of Use)

Description Tim Speetjens 2012-07-23 13:21:22 UTC
Description of problem:
Running getattr as non-root user fails with "Operation not permitted". This happens for any attribute, including 'trusted.glusterfs.pathinfo'

Version-Release number of selected component (if applicable):
glusterfs-fuse-3.3.0-22.el6rhs.x86_64
glusterfs-3.3.0-22.el6rhs.x86_64
glusterfs-server-3.3.0-22.el6rhs.x86_64
glusterfs-rdma-3.3.0-22.el6rhs.x86_64
glusterfs-geo-replication-3.3.0-22.el6rhs.x86_64

How reproducible:
100%
mount a gluster filesystem at /gluster/volume1
run through the steps, outlined next


Steps to Reproduce:
  # cd /gluster/volume1
  # touch testfile
  # chmod 644 testfile
  # setfattr -n trusted.testattr -v testvalue testfile
  # getfattr -n trusted.testattr testfile
# file: testfile
trusted.testattr="testvalue"
  # su - hadoop
  $ cd /gluster/volume1
  $ getfattr -n trusted.testattr testfile
testfile: trusted.testattr: Operation not permitted
  
Actual results:
fails with: Operation not permitted, and RC=1

Expected results:
should display attribute value, and exit RC=0

Additional info:

Comment 2 Amar Tumballi 2012-07-25 04:44:26 UTC
Actually, 'trusted.*' domain is reserved only for superuser in Linux. Hence getting information about 'trusted' domain key will result in failure as non-root user. Happens even on other filesystems.

only issue here is, the error below on xfs is 'ENODATA' and on glusterfs its ENOTSUP 

------ Snip ------
[root@tumballi ~]# cd /tmp/
[root@tumballi tmp]# touch abcd
[root@tumballi tmp]# chmod 0777 abcd 
[root@tumballi tmp]# setfattr -n trusted.testing -v value abcd 
[root@tumballi tmp]# getfattr -n trusted.testing abcd
# file: abcd
trusted.testing="value"

[root@tumballi tmp]# su amar -
amar@tumballi:/tmp$ getfattr -n trusted.testing abcd
abcd: trusted.testing: No such attribute
amar@tumballi:/tmp$ getfattr -d -m . abcd
# file: abcd
security.selinux="unconfined_u:object_r:user_tmp_t:s0"

amar@tumballi:/tmp$ exit
[root@tumballi tmp]# getfattr -d -m . abcd
# file: abcd
security.selinux="unconfined_u:object_r:user_tmp_t:s0"
trusted.testing="value"

[root@tumballi tmp]# 

-----


Note You need to log in before you can comment on or make changes to this bug.