diff options
author | Lars Müller <lmuelle@samba.org> | 2006-04-02 21:12:23 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:15:52 -0500 |
commit | 570b49f33faf99491220faeca98c36086fe9f71f (patch) | |
tree | a4c3d1174df0b0cc8a41dff1b4e3053f53654b04 /source3/param/loadparm.c | |
parent | e4998337e75c5e9debe914ff4eb2c0b0fa97c156 (diff) | |
download | samba-570b49f33faf99491220faeca98c36086fe9f71f.tar.gz samba-570b49f33faf99491220faeca98c36086fe9f71f.tar.bz2 samba-570b49f33faf99491220faeca98c36086fe9f71f.zip |
r14869: Allow to dump a paramatrical option.
Flaw: We print an empty line if the paramatrical option is not defined
in the requested section.
(This used to be commit a0d84ccc02e19d22d827e7d052fab6d471f0a1b3)
Diffstat (limited to 'source3/param/loadparm.c')
-rw-r--r-- | source3/param/loadparm.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7644843fc5..7d3995f092 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -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) && |