diff options
author | Junaid <junaid@gluster.com> | 2011-04-12 08:19:27 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-04-12 21:50:09 -0700 |
commit | 35998844040cf713f229e896524a1a6be249e31d (patch) | |
tree | ef83cce7344f128a75224fd820ba0dc9d8988ac3 /xlators/features/quota | |
parent | 1fd570380ba5def514ff42e81008a7ddd588348f (diff) |
features/quota: Validate the quota options. and donot include into the client volfile.
Signed-off-by: Junaid <junaid@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2541 (insufficient option validation in quota translator)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2541
Diffstat (limited to 'xlators/features/quota')
-rw-r--r-- | xlators/features/quota/src/quota.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 80d4181e5d0..2b238b2b559 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -2546,6 +2546,34 @@ quota_forget (xlator_t *this, inode_t *inode) return 0; } +int +validate_options (xlator_t *this, char **op_errstr) +{ + int ret = 0; + volume_opt_list_t *vol_opt = NULL; + volume_opt_list_t *tmp; + + if (!this) { + gf_log (this->name, GF_LOG_DEBUG, "'this' not a valid ptr"); + ret =-1; + goto out; + } + + if (list_empty (&this->volume_options)) + goto out; + + vol_opt = list_entry (this->volume_options.next, + volume_opt_list_t, list); + list_for_each_entry_safe (vol_opt, tmp, &this->volume_options, list) { + ret = validate_xlator_volume_options_attacherr (this, + vol_opt->given_opt, + op_errstr); + } + +out: + + return ret; +} int32_t quota_parse_options (quota_priv_t *priv, xlator_t *this, dict_t *options) |