This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 896410

Summary: gnfs-root-squash: write success with "nfsnobody", though file created by "root" user
Product: [Community] GlusterFS Reporter: vpshastry <vshastry>
Component: coreAssignee: Amar Tumballi <amarts>
Status: CLOSED DUPLICATE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: mainlineCC: gluster-bugs, nsathyan, vraman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-18 00:57:19 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description vpshastry 2013-01-17 04:18:23 EST
Description of problem:


Description of problem:
server,

[root@localhost ~]# gluster volume info dist-rep
 
Volume Name: dist-rep
Type: Distributed-Replicate
Volume ID: 3a9fb84b-6f4b-4bd6-aa2b-6fe86fbc44be
Status: Started
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: 10.70.37.148:/export/dr
Brick2: 10.70.37.149:/export/drr
Brick3: 10.70.37.164:/export/ddr
Brick4: 10.70.37.101:/export/ddrr
Options Reconfigured:
features.root-squashing: enable

client,
[root@dhcp159-239 dir]# mount | grep dist-rep
10.70.37.148:/dist-rep on /mnt/nfs-test type nfs (rw,vers=3,addr=10.70.37.148)
[root@dhcp159-239 nfs-test]# cd dir
[root@dhcp159-239 dir]# ls -l
total 1
-rw-rw-r--. 1 dev1      dev1       0 Dec 13 17:57 1
-rwxrwx---. 1 nfsnobody nfsnobody 11 Dec 13 17:49 a
drwxr-xr-x. 3 nfsnobody nfsnobody 42 Dec 12 19:09 dir1
#-----------------directory in consideration------------
drwxr-xr-x. 3 root      root      46 Dec 12 19:14 dir-n1
#---------------------------------------------------------

[root@dhcp159-239 dir]# ls -l dir-n1/1
-rw-r--r--. 1 root root 9 Dec 13 18:04 dir-n1/1

[root@dhcp159-239 dir]# cat >> dir-n1/1
Hello 1\

[root@dhcp159-239 dir]# ls -ld 
drwxrwxrwx. 4 root root 76 Dec 13 17:57 .


#---------------------------------------------------------------------------
whereas similarly I tried over kernel nfs and found that write should fail,
#---------------------------------------------------------------------------
[root@snow ~]# cat /etc/exports
/opt *(rw,sync,no_root_squash)
/home *(rw,root_squash)

[root@konsoul testing]# mount | grep home
10.70.34.114:/home on /mnt/nfs-test type nfs (rw,vers=3,addr=10.70.34.114)

[root@konsoul testing]# ls -ld
drwxrwxrwx. 8 root root 4096 Jan 29  2012 .

[root@konsoul testing]# ls -ld dir-n1
drwxr-xr-x. 2 root root 4096 Jan 29  2012 dir-n1

[root@konsoul testing]# ls -l dir-n1
total 0
-rw-r--r--. 1 root root 0 Jan 29  2012 1


[root@konsoul testing]# cat >> dir-n1/1
bash: dir-n1/1: Permission denied

some more observation related to the same issue,

created a new directory from fuse mount, effectively from root username,
chmod 770 dirfuse
[root@dhcp159-239 nfs-test]# ls -ld dir-fuse
drwxrwx---. 2 root root 26 Dec 14 00:07 dir-fuse
tried to create file inside this dir and it is a pass,
[root@dhcp159-239 nfs-test]# touch dir-fuse/new1


whereas on kernel-nfs ... it fails similarly,

[root@konsoul nfs-test]# ls -ld dir-new
drwxrwx---. 2 root root 4096 Jan 29  2012 dir-new

[root@konsoul nfs-test]# touch dir-new/new1
touch: cannot touch `dir-new/new1': Permission denied
Comment 1 Amar Tumballi 2013-01-18 00:57:19 EST
valid only if the bug 896408 is fixed, so, rather keeping this open, keeping it as duplicate of that bug.

*** This bug has been marked as a duplicate of bug 896408 ***