(strchr(pszParmName, ':') != NULL));
}
+/***************************************************************************
+ 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.
}
if (registry_smbconf_valname_forbidden(valname)) {
- d_fprintf(stderr, "Parameter '%s' not allowed in registry.\n",
+ d_fprintf(stderr, "Parameter '%s' not allowed in registry.\n",
valname);
werr = WERR_INVALID_PARAM;
goto done;
}
+ if (!strequal(key->key->name, GLOBAL_NAME) &&
+ lp_parameter_is_global(valname))
+ {
+ d_fprintf(stderr, "Global paramter '%s' not allowed in "
+ "service definition.\n", valname);
+ werr = WERR_INVALID_PARAM;
+ goto done;
+ }
+
werr = reg_setvalue(key, valname, &val);
if (!W_ERROR_IS_OK(werr)) {
d_fprintf(stderr,