summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2012-03-07 13:06:38 +0530
committerAnand Avati <avati@redhat.com>2012-03-18 00:52:40 -0700
commit93022c0cc6c22b3a30ded3e109a3fe0a0dce8ca0 (patch)
treee3544585d651356c8e8bbb17d62f432855f1ea47 /xlators/protocol
parentc3bbf6aa6c090fd066ab0079aa1c8ae332309d2a (diff)
mgmt/glusterd : volume set validation fixes
This is the new version of the patch by Kaushik at review.gluster.com/699 The following new option types have been introduced: * GF_OPTION_TYPE_INTERNET_ADDRESS_LIST * GF_OPTION_TYPE_PRIORITY_LIST * GF_OPTION_TYPE_SIZE_LIST and option types of several options in translators have been updated to use the new types. valid_internet_address(), valid_ipv4_address() & valid_ipv6_address() functions has been updated for * wildcard matching. Previously used standalone wildcard address checking functions have been removed. Changes have been done to stripe translator to correctly set, update and use stripe-blocksize. Also minimum value for block-size has been set to 16KB. Change-Id: I2aa484ff695f6a915a8fc9a9f965cf0344f41d59 BUG: 765248 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/2899 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shishir Gowda <shishirng@gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/auth/addr/src/addr.c6
-rw-r--r--xlators/protocol/server/src/server.c16
2 files changed, 16 insertions, 6 deletions
diff --git a/xlators/protocol/auth/addr/src/addr.c b/xlators/protocol/auth/addr/src/addr.c
index 0209dd3538f..2bc604de8c0 100644
--- a/xlators/protocol/auth/addr/src/addr.c
+++ b/xlators/protocol/auth/addr/src/addr.c
@@ -226,14 +226,14 @@ out:
struct volume_options options[] = {
{ .key = {"auth.addr.*.allow"},
- .type = GF_OPTION_TYPE_ANY
+ .type = GF_OPTION_TYPE_INTERNET_ADDRESS_LIST
},
{ .key = {"auth.addr.*.reject"},
- .type = GF_OPTION_TYPE_ANY
+ .type = GF_OPTION_TYPE_INTERNET_ADDRESS_LIST
},
/* Backword compatibility */
{ .key = {"auth.ip.*.allow"},
- .type = GF_OPTION_TYPE_ANY
+ .type = GF_OPTION_TYPE_INTERNET_ADDRESS_LIST
},
{ .key = {NULL} }
};
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index f87e371f1bb..33889fd9b15 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -558,9 +558,8 @@ validate_auth_options (xlator_t *this, dict_t *dict)
while (addr) {
- if (valid_internet_address (addr) ||
- valid_wildcard_internet_address (addr))
- {
+ if (valid_internet_address
+ (addr, _gf_true)) {
error = 0;
} else {
error = -1;
@@ -1140,5 +1139,16 @@ struct volume_options options[] = {
.min = GF_MIN_SOCKET_WINDOW_SIZE,
.max = GF_MAX_SOCKET_WINDOW_SIZE
},
+
+ /* The following two options are defined in addr.c, redifined here *
+ * for the sake of validation during volume set from cli */
+
+ { .key = {"auth.addr.*.allow"},
+ .type = GF_OPTION_TYPE_INTERNET_ADDRESS_LIST
+ },
+ { .key = {"auth.addr.*.reject"},
+ .type = GF_OPTION_TYPE_INTERNET_ADDRESS_LIST
+ },
+
{ .key = {NULL} },
};