summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-06-29 12:30:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:42 -0500
commit20733036644c11a6b4fa7466f9a5b3aa1cae3916 (patch)
treefc815cf588f638d26d324e3de0b2d1dd745f9327 /source3/param
parent96c4bf4a1c70e080107e954ea09dbe0a9709ae4f (diff)
downloadsamba-20733036644c11a6b4fa7466f9a5b3aa1cae3916.tar.gz
samba-20733036644c11a6b4fa7466f9a5b3aa1cae3916.tar.bz2
samba-20733036644c11a6b4fa7466f9a5b3aa1cae3916.zip
r23656: Add initial checking of the validity of a paramter
given to "net conf setparm". Add a utility function lp_parameter_valid() for this to loadparm.c. Michael (This used to be commit 639051e58d4da9fb1116c19f0790250640b6ac7a)
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index c43a032560..58ea751fa5 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -2776,6 +2776,18 @@ BOOL lp_add_printer(const char *pszPrintername, int iDefaultService)
return (True);
}
+
+/***************************************************************************
+ Check whether the given parameter name is valid.
+ Parametric options (names containing a colon) are considered valid.
+***************************************************************************/
+
+BOOL lp_parameter_valid(const char *pszParmName)
+{
+ return ((map_parameter(pszParmName) != -1) ||
+ (strchr(pszParmName, ':') != NULL));
+}
+
/***************************************************************************
Map a parameter's string representation to something we can use.
Returns False if the parameter string is not recognised, else TRUE.