Bug 1240258

Summary: The uid and gid of a file created when rootsquash is enabled on a ganesha volume, is not nfsnobody
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Apeksha <akhakhar>
Component: nfs-ganeshaAssignee: Soumya Koduri <skoduri>
Status: CLOSED ERRATA QA Contact: Arthy Loganathan <aloganat>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: aloganat, amukherj, asriram, bmohanra, jthottan, kkeithle, ndevos, nlevinki, rcyriac, rhinduja, rhs-bugs, sankarshan, skoduri
Target Milestone: ---   
Target Release: RHGS 3.2.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: nfs-ganesha-2.4.1-2 Doc Type: Bug Fix
Doc Text:
Previously, NFS-ganesha mapped all anonymous users to uid 4294967294. This value is different from the nfsnobody value of 65534. With this fix all the anonymous uid and gid are mapped to nfsnobody by default.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-23 06:21:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1216951, 1351522    
Attachments:
Description Flags
sample_fix none

Description Apeksha 2015-07-06 11:27:40 UTC
Description of problem:
The uid and gid of a file created when rootsquash is enabled on a ganesha volume, is not nfsnobody

Version-Release number of selected component (if applicable):
glusterfs-3.7.1-7.el6rhs.x86_64
nfs-ganesha-2.2.0-3.el6rhs.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create a ganesha volune and export it
2. Create a directory say dir and change the permissions to 777
3. Now enable root-suash for the volume, by cahnging the export directory entry and do a refresh config
4. Now if we create any directory/file within the dir, it has a uid and gid of no.- 4294967294 and not nfsnobody 

[root@vm8 ~]# cd /mnt/nfs1436207669.65
[root@vm8 nfs1436207669.65]#
[root@vm8 nfs1436207669.65]#
[root@vm8 nfs1436207669.65]#
[root@vm8 nfs1436207669.65]# ls
dir  file.dd
[root@vm8 nfs1436207669.65]#
[root@vm8 nfs1436207669.65]#
[root@vm8 nfs1436207669.65]# ls -ld dir
drwxrwxrwx. 3 root root 102 Jul  7 00:05 dir
[root@vm8 nfs1436207669.65]# cd dir
[root@vm8 dir]# mkdir dir2
[root@vm8 dir]# ls -l
total 0
drwxr-xr-x. 2 4294967294 4294967294 69 Jul  7 00:37 dir1
drwxr-xr-x. 2 4294967294 4294967294 36 Jul  7 00:42 dir2
[root@vm8 dir]# touch f.1
[root@vm8 dir]# ls -l
total 0
drwxr-xr-x. 2 4294967294 4294967294 69 Jul  7 00:37 dir1
drwxr-xr-x. 2 4294967294 4294967294 36 Jul  7 00:42 dir2
-rw-r--r--. 1 4294967294 4294967294  0 Jul  7 00:42 f.1

[root@vm8 dir1]# id nfsnobody
uid=65534(nfsnobody) gid=65534(nfsnobody) groups=65534(nfsnobody)
[root@vm8 dir1]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)


Actual results:The uid and gid of a file created when rootsquash is enabled on a ganesha volume, is not nfsnobody

Expected results: The uid and gid of a file created when rootsquash is enabled on a ganesha volume, has to be nfsnobody


Additional info:

Comment 2 Soumya Koduri 2015-07-06 13:17:25 UTC
From the bug1054124
>>>> 
The permissions that are seen when root squash is enabled is based on anonymous UID and GID values used by NFS-ganesha. The default values for both  
anonymous UID and anonymous GID is -2. When this is converted to a 32 bit unsigned integer, we get the large number,  i.e., 4294967294 that is seen in the permissions. The expected value of 65534 is the 16 bit equivalent of -2. 
<<<<

This is expected behaviour while using nfs-ganesha. If needed, anonymous values can be manually configured to be 16-bit equivalent value of (-2).

Comment 3 Niels de Vos 2015-07-20 12:32:52 UTC
We should just set the uid+gid for the nfsnobody by default in our ganesha.conf. A simple and effective fix.

Comment 4 monti lawrence 2015-07-22 19:45:40 UTC
Doc text is edited. Please sign off to be included in Known Issues.

Comment 5 Meghana 2015-07-27 09:32:14 UTC
Doc text looks good to me.

Comment 9 Soumya Koduri 2016-11-07 10:08:53 UTC
Created attachment 1217958 [details]
sample_fix

Comment 12 Arthy Loganathan 2016-12-21 06:45:11 UTC
Verified the fix in build,

nfs-ganesha-gluster-2.4.1-3.el7rhgs.x86_64
nfs-ganesha-2.4.1-3.el7rhgs.x86_64
glusterfs-ganesha-3.8.4-9.el7rhgs.x86_64

The uid and gid of a file created when rootsquash is enabled on a ganesha volume, is 65534.

Comment 13 Bhavana 2017-03-08 07:02:05 UTC
Edited the doc text further for the errata.

Comment 15 errata-xmlrpc 2017-03-23 06:21:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2017-0493.html