r14869: Allow to dump a paramatrical option.
authorLars Müller <lmuelle@samba.org>
Sun, 2 Apr 2006 21:12:23 +0000 (21:12 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:15:52 +0000 (11:15 -0500)
Flaw: We print an empty line if the paramatrical option is not defined
in the requested section.
(This used to be commit a0d84ccc02e19d22d827e7d052fab6d471f0a1b3)

source3/param/loadparm.c

index 7644843fc535823ea5dec5aa636891c30b29da41..7d3995f092ba5f51dfafda4e8915ab0a8a54eecc 100644 (file)
@@ -3880,13 +3880,31 @@ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal)
        int i, result = False;
        parm_class p_class;
        unsigned flag = 0;
+       fstring local_parm_name;
+       char *parm_opt;
+
+       /* check for parametrical option */
+       fstrcpy( local_parm_name, parm_name);
+       parm_opt = strchr( local_parm_name, ':');
+
+       if (parm_opt) {
+               *parm_opt = '\0';
+               parm_opt++;
+               if (strlen(parm_opt)) {
+                       printf( "%s\n", lp_parm_const_string( snum,
+                               local_parm_name, parm_opt, ""));
+                       result = True;
+               }
+               return result;
+       }
 
+       /* check for a key and print the value */
        if (isGlobal) {
                p_class = P_GLOBAL;
                flag = FLAG_GLOBAL;
        } else
                p_class = P_LOCAL;
-       
+
        for (i = 0; parm_table[i].label; i++) {
                if (strwicmp(parm_table[i].label, parm_name) == 0 &&
                    (parm_table[i].p_class == p_class || parm_table[i].flags & flag) &&