diff options
| author | Garming Sam <garming@catalyst.net.nz> | 2014-03-21 10:44:15 +1300 |
|---|---|---|
| committer | Michael Adam <obnox@samba.org> | 2014-07-31 08:17:11 +0200 |
| commit | a348fa95c12181f31c9a474e13b6715d238ac71c (patch) | |
| tree | 1b613d6d951986a4fd28207336e1342eaf8fa0ed /lib/param | |
| parent | a7c4446bef0d2b4e57fba7f3593f8c7379896160 (diff) | |
| download | samba-a348fa95c12181f31c9a474e13b6715d238ac71c.tar.gz samba-a348fa95c12181f31c9a474e13b6715d238ac71c.tar.xz samba-a348fa95c12181f31c9a474e13b6715d238ac71c.zip | |
param: allow dump_globals to check the actual defaults
Change-Id: Ia5f30b6922b2e836d3e93403c61458ee58d993fd
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib/param')
| -rw-r--r-- | lib/param/loadparm.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index 6adeb7ed46..b9edff0ad1 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -2041,8 +2041,16 @@ static void dump_globals(struct loadparm_context *lp_ctx, FILE *f, for (i = 0; parm_table[i].label; i++) if (parm_table[i].p_class == P_GLOBAL && (i == 0 || (parm_table[i].offset != parm_table[i - 1].offset))) { - if (!show_defaults && (lp_ctx->flags[i] & FLAG_DEFAULT)) - continue; + if (!show_defaults) { + if (lp_ctx->flags && (lp_ctx->flags[i] & FLAG_DEFAULT)) { + continue; + } + + if (is_default(lp_ctx->globals, i)) { + continue; + } + } + fprintf(f, "\t%s = ", parm_table[i].label); lpcfg_print_parameter(&parm_table[i], lpcfg_parm_ptr(lp_ctx, NULL, &parm_table[i]), f); fprintf(f, "\n"); |
