diff options
author | Michael Adam <obnox@samba.org> | 2007-06-29 13:07:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:23:42 -0500 |
commit | e388130aa63b9bbe1b27999aad6052585fc2e16b (patch) | |
tree | cef52bb6091bd0cb6f61c982140bcacca71077c7 /source3/param | |
parent | 20733036644c11a6b4fa7466f9a5b3aa1cae3916 (diff) | |
download | samba-e388130aa63b9bbe1b27999aad6052585fc2e16b.tar.gz samba-e388130aa63b9bbe1b27999aad6052585fc2e16b.tar.bz2 samba-e388130aa63b9bbe1b27999aad6052585fc2e16b.zip |
r23657: Prevent setting of a global option in a share definition
in "net conf setparm".
Michael
(This used to be commit bf92d567984f00ebb998fb2485d0aac87d30b924)
Diffstat (limited to 'source3/param')
-rw-r--r-- | source3/param/loadparm.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 58ea751fa5..8c6c0f1afe 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2789,6 +2789,24 @@ BOOL lp_parameter_valid(const char *pszParmName) } /*************************************************************************** + Check whether the given name is the name of a global parameter. + Returns True for strings belonging to parameters of class + P_GLOBAL, False for all other strings, also for parametric options + and strings not belonging to any option. +***************************************************************************/ + +BOOL lp_parameter_is_global(const char *pszParmName) +{ + int num = map_parameter(pszParmName); + + if (num >= 0) { + return (parm_table[num].p_class == P_GLOBAL); + } + + return False; +} + +/*************************************************************************** Map a parameter's string representation to something we can use. Returns False if the parameter string is not recognised, else TRUE. ***************************************************************************/ |