summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2016-11-23 11:14:54 +0100
committerRalph Boehme <slow@samba.org>2016-11-23 13:00:21 +0100
commit1f91b6aa63df4c48c49dabf8b30cde33579da17f (patch)
tree0db403e205efdfa0fc9f34e2770dfb58f0ded48d
parentfa7e40b92460c094e64cb175dfb297436fe483eb (diff)
downloadsamba-1f91b6aa63df4c48c49dabf8b30cde33579da17f.tar.gz
param: validate value in lp_canonicalize_parameter_with_value()
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r--source3/param/loadparm.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 6ac7b693ce2..21073c6753c 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1688,9 +1688,11 @@ bool lp_canonicalize_parameter(const char *parm_name, const char **canon_parm,
Turn the value given into the inverse boolean expression when
the synonym is an invers boolean synonym.
- Return true if parm_name is a valid parameter name and
- in case it is an invers boolean synonym, if the val string could
- successfully be converted to the reverse bool.
+ Return true if
+ - parm_name is a valid parameter name and
+ - val is a valid value for this parameter and
+ - in case the parameter is an inverse boolean synonym, if the val
+ string could successfully be converted to the reverse bool.
Return false in all other cases.
**************************************************************************/
@@ -1701,6 +1703,7 @@ bool lp_canonicalize_parameter_with_value(const char *parm_name,
{
int num;
bool inverse;
+ bool ret;
if (!lp_parameter_is_valid(parm_name)) {
*canon_parm = NULL;
@@ -1726,7 +1729,9 @@ bool lp_canonicalize_parameter_with_value(const char *parm_name,
*canon_val = val;
}
- return true;
+ ret = lp_parameter_value_is_valid(*canon_parm, *canon_val);
+
+ return ret;
}
/***************************************************************************