This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 842319 - getfattr fails for non-root users
getfattr fails for non-root users
Status: CLOSED NOTABUG
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: glusterfs (Show other bugs)
2.0
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Amar Tumballi
Sudhir D
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-23 09:21 EDT by Tim Speetjens
Modified: 2013-12-18 19:08 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-25 00:44:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tim Speetjens 2012-07-23 09:21:22 EDT
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 00:44:26 EDT
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.