Bug 1240258 - The uid and gid of a file created when rootsquash is enabled on a ganesha volume, is not nfsnobody
Summary: The uid and gid of a file created when rootsquash is enabled on a ganesha vol...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: nfs-ganesha
Version: rhgs-3.1
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
: RHGS 3.2.0
Assignee: Soumya Koduri
QA Contact: Arthy Loganathan
URL:
Whiteboard:
Depends On:
Blocks: 1216951 1351522
TreeView+ depends on / blocked
 
Reported: 2015-07-06 11:27 UTC by Apeksha
Modified: 2017-03-23 06:21 UTC (History)
13 users (show)

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.
Clone Of:
Environment:
Last Closed: 2017-03-23 06:21:30 UTC
Embargoed:


Attachments (Terms of Use)
sample_fix (1.37 KB, application/mbox)
2016-11-07 10:08 UTC, Soumya Koduri
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1054124 0 unspecified CLOSED nfs-ganesha: "root-squash" enabled and "ls -l" for file and directory displays user:group as a numeral instead of "nfsno... 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHEA-2017:0493 0 normal SHIPPED_LIVE Red Hat Gluster Storage 3.2.0 nfs-ganesha bug fix and enhancement update 2017-03-23 09:19:13 UTC

Internal Links: 1054124

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


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