From a1e26be05c7b344dc8e7f980d0a6ab00695f2f42 Mon Sep 17 00:00:00 2001 From: Santosh Kumar Pradhan Date: Tue, 7 Jan 2014 14:22:03 +0530 Subject: gNFS: mnt3_find_export() by pass AUTH check NFS subdir mount does not respect nfs.rpc-auth-reject option in the volume. If the volume is being mounted, then it would validate the AUTH by mnt3_check_client_net() but if the client is mounting a subdir, the control takes a different code path i.e. mnt3_find_export() which does not bother about the AUTH. FIX: Enforce the AUTH check in mnt3_parse_dir_exports() which is invoked by mnt3_find_export() for subdir mount. Change-Id: I6fdd3e6bd6cbd32b0d9ca620cc4c30fdaff9ca30 BUG: 1049225 Signed-off-by: Santosh Kumar Pradhan Reviewed-on: http://review.gluster.org/6655 Reviewed-by: Niels de Vos Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- tests/bugs/bug-921072.t | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/bugs/bug-921072.t b/tests/bugs/bug-921072.t index e101d5b46..37f8fde52 100755 --- a/tests/bugs/bug-921072.t +++ b/tests/bugs/bug-921072.t @@ -89,12 +89,13 @@ TEST $CLI volume set $V0 nfs.rpc-auth-allow 127.0.0.1 EXPECT_WITHIN 20 1 is_nfs_export_available TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0 +TEST mkdir -p $N0/subdir TEST umount $N0 # case 10: allow a non-localhost ip TEST $CLI volume set $V0 nfs.rpc-auth-allow 192.168.1.1 EXPECT_WITHIN 20 1 is_nfs_export_available -#40 +#41 TEST ! mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0 # case 11: reject only localhost ip @@ -104,6 +105,7 @@ TEST $CLI volume set $V0 nfs.rpc-auth-reject 127.0.0.1 EXPECT_WITHIN 20 1 is_nfs_export_available TEST ! mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0 +TEST ! mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0/subdir $N0 # case 12: reject only non-localhost ip TEST $CLI volume set $V0 nfs.rpc-auth-reject 192.168.1.1 @@ -112,7 +114,10 @@ EXPECT_WITHIN 20 1 is_nfs_export_available TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0 $N0 TEST umount $N0 +TEST mount -t nfs -o vers=3,nolock,soft,intr localhost:/$V0/subdir $N0 +TEST umount $N0 + TEST $CLI volume stop --mode=script $V0 -#49 +#52 TEST $CLI volume delete --mode=script $V0 cleanup -- cgit