From 0111ab923dd4c8f0985dd566c172cda31492b0f7 Mon Sep 17 00:00:00 2001 From: Meghana Madhusudhan Date: Mon, 10 Nov 2014 15:20:51 +0530 Subject: gNFS: Allow reading ACLs even without read permissions on the file. When root-squash is enabled or when no permissions are given to a file, NFS threw permission errors. According to the kernel-nfs behaviour, no permissions are required to read ACLs. When no ACLs are set, the system call sys_lgetxattr fails and returns a ENODATA error. This translates to ESERVERFAULT error in NFS. Fuse makes an exception to this error and returns a success case. Similar changes are made here to achieve the expected behaviour. Change-Id: I46b8f5911114eb087a3f8ca4e921b6b41e83f3b3 BUG: 1177899 Signed-off-by: Meghana Madhusudhan Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/9085 Tested-by: Gluster Build System Reviewed-on: http://review.gluster.org/9369 Reviewed-by: Raghavendra Bhat --- tests/bugs/bug-1161092-nfs-acls.t | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/bugs/bug-1161092-nfs-acls.t (limited to 'tests') diff --git a/tests/bugs/bug-1161092-nfs-acls.t b/tests/bugs/bug-1161092-nfs-acls.t new file mode 100644 index 00000000000..f64ae5b3c18 --- /dev/null +++ b/tests/bugs/bug-1161092-nfs-acls.t @@ -0,0 +1,36 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../nfs.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info + +TEST $CLI volume create $V0 $H0:$B0/brick1; +EXPECT 'Created' volinfo_field $V0 'Status'; + +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; + +EXPECT_WITHIN $NFS_EXPORT_TIMEOUT 1 is_nfs_export_available +TEST mount_nfs $H0:/$V0 $N0 + +TEST touch $N0/file1 +TEST chmod 700 $N0/file1 +TEST getfacl $N0/file1 + +TEST $CLI volume set $V0 root-squash on +TEST getfacl $N0/file1 + +TEST umount_nfs $H0:/$V0 $N0 +TEST mount_nfs $H0:/$V0 $N0 +TEST getfacl $N0/file1 + +## Before killing daemon to avoid deadlocks +umount_nfs $N0 + +cleanup; + -- cgit