The Samba-Bugzilla – Attachment 11453 Details for
Bug 11526
[samba-tool] testparm doesn't hide synonyms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for v4-3-test
tmp43.diff.txt (text/plain), 3.71 KB, created by
Stefan Metzmacher
on 2015-09-21 18:13:36 UTC
(
hide
)
Description:
Patch for v4-3-test
Filename:
MIME Type:
Creator:
Stefan Metzmacher
Created:
2015-09-21 18:13:36 UTC
Size:
3.71 KB
patch
obsolete
>From 3dceaacca69dcfb3a2b76df5d272bdb988331f38 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Fri, 18 Sep 2015 18:54:31 +0200 >Subject: [PATCH] lib/param: fix hiding of FLAG_SYNONYM values > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=11526 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Reviewed-by: Michael Adam <obnox@samba.org> >(cherry picked from commit 25dcdc92709a46d87125bc454faae7cad43d6b71) >--- > lib/param/loadparm.c | 89 +++++++++++++++++++++++++++++++--------------------- > 1 file changed, 53 insertions(+), 36 deletions(-) > >diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c >index 06a9e59..c26442a 100644 >--- a/lib/param/loadparm.c >+++ b/lib/param/loadparm.c >@@ -2014,22 +2014,28 @@ void lpcfg_dump_globals(struct loadparm_context *lp_ctx, FILE *f, > > fprintf(f, "# Global parameters\n[global]\n"); > >- 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) { >- if (lp_ctx->flags && (lp_ctx->flags[i] & FLAG_DEFAULT)) { >- continue; >- } >+ for (i = 0; parm_table[i].label; i++) { >+ if (parm_table[i].p_class != P_GLOBAL) { >+ continue; >+ } > >- if (is_default(lp_ctx->globals, i)) { >- continue; >- } >+ if (parm_table[i].flags & FLAG_SYNONYM) { >+ 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"); >+ 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"); > } > if (lp_ctx->globals->param_opt != NULL) { > for (data = lp_ctx->globals->param_opt; data; >@@ -2057,34 +2063,45 @@ void lpcfg_dump_a_service(struct loadparm_service * pService, struct loadparm_se > fprintf(f, "\n[%s]\n", pService->szService); > > for (i = 0; parm_table[i].label; i++) { >- if (parm_table[i].p_class == P_LOCAL && >- (*parm_table[i].label != '-') && >- (i == 0 || (parm_table[i].offset != parm_table[i - 1].offset))) >- { >- if (pService == sDefault) { >- if (!show_defaults) { >- if (flags && (flags[i] & FLAG_DEFAULT)) { >- continue; >- } >+ if (parm_table[i].p_class != P_LOCAL) { >+ continue; >+ } > >- if (is_default(sDefault, i)) { >- continue; >- } >+ if (parm_table[i].flags & FLAG_SYNONYM) { >+ continue; >+ } >+ >+ if (*parm_table[i].label == '-') { >+ continue; >+ } >+ >+ if (pService == sDefault) { >+ if (!show_defaults) { >+ if (flags && (flags[i] & FLAG_DEFAULT)) { >+ continue; > } >- } else { >- if (lpcfg_equal_parameter(parm_table[i].type, >- ((char *)pService) + >- parm_table[i].offset, >- ((char *)sDefault) + >- parm_table[i].offset)) >+ >+ if (is_default(sDefault, i)) { > continue; >+ } >+ } >+ } else { >+ bool equal; >+ >+ equal = lpcfg_equal_parameter(parm_table[i].type, >+ ((char *)pService) + >+ parm_table[i].offset, >+ ((char *)sDefault) + >+ parm_table[i].offset); >+ if (equal) { >+ continue; > } >- >- fprintf(f, "\t%s = ", parm_table[i].label); >- lpcfg_print_parameter(&parm_table[i], >- ((char *)pService) + parm_table[i].offset, f); >- fprintf(f, "\n"); > } >+ >+ fprintf(f, "\t%s = ", parm_table[i].label); >+ lpcfg_print_parameter(&parm_table[i], >+ ((char *)pService) + parm_table[i].offset, f); >+ fprintf(f, "\n"); > } > if (pService->param_opt != NULL) { > for (data = pService->param_opt; data; data = data->next) { >-- >1.9.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
obnox
:
review+
Actions:
View
Attachments on
bug 11526
: 11453