{
struct parm_struct *parm;
void *ptr;
+ char *local_parm_name;
+ char *parm_opt;
+ const char *parm_opt_value;
+ /* check for parametrical option */
+ local_parm_name = talloc_strdup(lp_ctx, parm_name);
+ if (local_parm_name == NULL) {
+ return false;
+ }
+
+ parm_opt = strchr( local_parm_name, ':');
+
+ if (parm_opt) {
+ *parm_opt = '\0';
+ parm_opt++;
+ if (strlen(parm_opt)) {
+ parm_opt_value = lpcfg_parm_string(lp_ctx, service,
+ local_parm_name, parm_opt);
+ if (parm_opt_value) {
+ fprintf(f, "%s\n", parm_opt_value);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /* parameter is not parametric, search the table */
parm = lpcfg_parm_struct(lp_ctx, parm_name);
if (!parm) {
return false;
bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal)
{
bool result = false;
- char *local_parm_name;
- char *parm_opt;
- const char *parm_opt_value;
struct loadparm_context *lp_ctx;
return false;
}
- /* check for parametrical option */
- local_parm_name = talloc_strdup(lp_ctx, parm_name);
- if (local_parm_name == NULL) {
- TALLOC_FREE(lp_ctx);
- return false;
- }
-
- parm_opt = strchr( local_parm_name, ':');
-
- if (parm_opt) {
- *parm_opt = '\0';
- parm_opt++;
- if (strlen(parm_opt)) {
- parm_opt_value = lp_parm_const_string( snum,
- local_parm_name, parm_opt, NULL);
- if (parm_opt_value) {
- fprintf(f, "%s\n", parm_opt_value);
- result = true;
- }
- }
- return result;
- }
-
if (isGlobal) {
result = lpcfg_dump_a_parameter(lp_ctx, NULL, parm_name, f);
} else {