1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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>
This commit is contained in:
Garming Sam 2014-03-21 10:44:15 +13:00 committed by Michael Adam
parent a7c4446bef
commit a348fa95c1

View File

@ -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");