linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Inheritance of sgid in nfsv3
@ 2018-03-07  6:17 Lu Xinyu
  2018-03-07  7:11 ` Inheritance of sgid in nfsv3 (supplement) Lu Xinyu
  0 siblings, 1 reply; 2+ messages in thread
From: Lu Xinyu @ 2018-03-07  6:17 UTC (permalink / raw)
  To: linux-nfs; +Cc: fnst-xmlinux

hi, folks


I have client and server using nfsv3. The kernels are all 4.16-rc3.
In client I mount a partition or a disk formatted in xfs/ext4 in
/nfstest. It seems there is someting wrong with inheritance of sgid. I
try the following operations in the client.
> [root@localhost ]#id user1
> uid=1003(user1) gid=1006(testgroup1) groups=1006(testgroup1),1007(testgroup2)
> [root@localhost ]# mount -t nfs -o vers=3 -o noac 192.168.56.9:/data/nfstest /mnt/test/ 
> [root@localhost ]# cd /mnt/test/
> [root@localhost ]# mkdir mainsub
> [root@localhost ]# setfacl -d -m u:user2:rwx mainsub/
> [root@localhost ]# chown user1:testgroup1 mainsub/
> [root@localhost ]# runuser -u user1 -g testgroup1 mkdir mainsub/subdir1
> [root@localhost ]# runuser -u user1 -g testgroup2 mkdir mainsub/subdir2
> [root@localhost ]# ls -l mainsub/
> drwxrwsr-x+ 2 user1 testgroup1 4096 Mar  6 22:50 subdir1
> drwxrwxr-x+ 2 user1 testgroup1 4096 Mar  6 22:50 subdir2


The subdir2 losts SGID. But if the same operations are applied in the
xfs or ext4 directedly, the SGID could be interited normally.

> [root@localhost ]# ls -l mainsub/
> drwxrwsr-x+ 2 user1 testgroup1 4096 Mar  6 22:55 subdir1
> drwxrwsr-x+ 2 user1 testgroup1 4096 Mar  6 22:55 subdir2

Is this a bug of NFSv3?


Lu Xinyu



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Inheritance of sgid in nfsv3 (supplement)
  2018-03-07  6:17 Inheritance of sgid in nfsv3 Lu Xinyu
@ 2018-03-07  7:11 ` Lu Xinyu
  0 siblings, 0 replies; 2+ messages in thread
From: Lu Xinyu @ 2018-03-07  7:11 UTC (permalink / raw)
  To: linux-nfs

hi, folks


I have client and server using nfsv3. The kernels are all 4.16-rc3.
In client I mount a partition or a disk formatted in xfs/ext4 in
/nfstest. It seems there is someting wrong with inheritance of sgid. I
try the following operations in the client.
> [root@localhost ]#id user1
> uid=1003(user1) gid=1006(testgroup1) groups=1006(testgroup1),1007(testgroup2)
> [root@localhost ]# mount -t nfs -o vers=3 -o noac 192.168.56.9:/data/nfstest /mnt/test/ 
> [root@localhost ]# cd /mnt/test/
> [root@localhost ]# mkdir mainsub
> [root@localhost ]# setfacl -d -m u:user2:rwx mainsub/
> [root@localhost ]# chown user1:testgroup1 mainsub/
      (supplement) # chmod 2775 mainsub/
> [root@localhost ]# runuser -u user1 -g testgroup1 mkdir mainsub/subdir1
> [root@localhost ]# runuser -u user1 -g testgroup2 mkdir mainsub/subdir2
> [root@localhost ]# ls -l mainsub/
> drwxrwsr-x+ 2 user1 testgroup1 4096 Mar  6 22:50 subdir1
> drwxrwxr-x+ 2 user1 testgroup1 4096 Mar  6 22:50 subdir2


The subdir2 losts SGID. But if the same operations are applied in the
xfs or ext4 directedly, the SGID could be interited normally.

> [root@localhost ]# ls -l mainsub/
> drwxrwsr-x+ 2 user1 testgroup1 4096 Mar  6 22:55 subdir1
> drwxrwsr-x+ 2 user1 testgroup1 4096 Mar  6 22:55 subdir2

Is this a bug of NFSv3?


Lu Xinyu



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-07  7:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-07  6:17 Inheritance of sgid in nfsv3 Lu Xinyu
2018-03-07  7:11 ` Inheritance of sgid in nfsv3 (supplement) Lu Xinyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).