From a3767c4ceb527cb0f52b95650c841964cf7faec9 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 11 Oct 2017 17:33:20 +0530 Subject: protocol-auth: use the proper validation method Currently, server protocol's init and glusterd's option validation methods are different, causing an issue. They should be same for having consistent behavior Updates #175 Change-Id: Ibbf9a18c7192b2d77f9b7675ae7da9b8d2fe5de4 Signed-off-by: Amar Tumballi --- libglusterfs/src/options.c | 4 ++-- libglusterfs/src/options.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/options.c b/libglusterfs/src/options.c index f0292eab5d4..a0f04c772e8 100644 --- a/libglusterfs/src/options.c +++ b/libglusterfs/src/options.c @@ -590,7 +590,7 @@ xlator_option_validate_addr (xlator_t *xl, const char *key, const char *value, return ret; } -static int +int xlator_option_validate_addr_list (xlator_t *xl, const char *key, const char *value, volume_option_t *opt, char **op_errstr) @@ -668,7 +668,7 @@ xlator_option_validate_addr_list (xlator_t *xl, const char *key, out: if (ret) { snprintf (errstr, sizeof (errstr), "option %s %s: '%s' is not " - "a valid internet-address-list", key, value, value); + "a valid internet-address-list", key, value, value); gf_msg (xl->name, GF_LOG_ERROR, 0, LG_MSG_INVALID_ENTRY, "%s", errstr); if (op_errstr) diff --git a/libglusterfs/src/options.h b/libglusterfs/src/options.h index 1d87e051cb4..6308773a3e1 100644 --- a/libglusterfs/src/options.h +++ b/libglusterfs/src/options.h @@ -140,6 +140,11 @@ int xlator_options_validate_list (xlator_t *xl, dict_t *options, int xlator_option_validate (xlator_t *xl, char *key, char *value, volume_option_t *opt, char **op_errstr); int xlator_options_validate (xlator_t *xl, dict_t *options, char **errstr); + +int xlator_option_validate_addr_list (xlator_t *xl, const char *key, + const char *value, volume_option_t *opt, + char **op_errstr); + volume_option_t * xlator_volume_option_get (xlator_t *xl, const char *key); -- cgit