summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src
diff options
context:
space:
mode:
authorShreyas Siravara <sshreyas@fb.com>2015-09-02 22:58:32 -0700
committerKevin Vigor <kvigor@fb.com>2017-03-17 13:13:32 -0400
commitbc7df6287a79a817579b9f925b9e97cd997201f3 (patch)
tree145ccfbd4b69113bfe85705859f121710353f4d8 /xlators/nfs/server/src
parentae361e8339cc51966ebd222d7fb9046e936d56f5 (diff)
nfs/auth: Fix sensitivity to rw,ro ordering in the exports file
Summary: When a netgroup is marked as rw in the exports file, and another netgroup is marked as ro for the same share, the ro option is not honored. This diff fixes that bug Test Plan: Added a test and verifies that it passes with this patch and does not pass without this patch. Reviewers: rwareing, dph, moox Reviewed By: moox FB-commit-id: 2d36d2d Change-Id: Ia394f36472f094a62ddfedc0c8fd5d95e247b4b0 Signed-off-by: Kevin Vigor <kvigor@fb.com> Reviewed-on: https://review.gluster.org/16908 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shreyas Siravara <sshreyas@fb.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/nfs/server/src')
-rw-r--r--xlators/nfs/server/src/mount3-auth.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/xlators/nfs/server/src/mount3-auth.c b/xlators/nfs/server/src/mount3-auth.c
index 97c95cbfd23..831d92edbef 100644
--- a/xlators/nfs/server/src/mount3-auth.c
+++ b/xlators/nfs/server/src/mount3-auth.c
@@ -429,6 +429,15 @@ __export_dir_lookup_netgroup (dict_t *dict, char *key, data_t *val,
GF_ASSERT ((*key == '@'));
+ /**
+ * If at any point in time as we search through the dictionaries,
+ * if we were marked as "Found", we should exit out immediately
+ * and not set anything else in this struct.
+ */
+ if (ngsa->found) {
+ goto out;
+ }
+
/* We use ++key here because keys start with '@' for ngs */
ngentry = ng_file_get_netgroup (nfile, (key + 1));
if (!ngentry) {
@@ -452,10 +461,6 @@ __export_dir_lookup_netgroup (dict_t *dict, char *key, data_t *val,
ngsa);
}
- /* If the above search was successful, just return */
- if (ngsa->found)
- goto out;
-
/* Run through the netgroups dict */
if (ngentry->netgroup_ngs) {
ngsa->_is_host_dict = _gf_false;