Rev 5311: correct the use of lp_next_parameter / lp_load to not
print in http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/
Michael Adam
ma at sernet.de
Tue Mar 27 21:54:48 GMT 2007
At http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/
------------------------------------------------------------
revno: 5311
revision-id: ma at sernet.de-20070327215446-254765ac4ba52d68
parent: ma at sernet.de-20070327214703-59efa290cec0ff01
committer: Michael Adam <ma at sernet.de>
branch nick: SAMBA_3_0-registry.bzr
timestamp: Tue 2007-03-27 23:54:46 +0200
message:
correct the use of lp_next_parameter / lp_load to not print
parameters that are set to default values
modified:
source/utils/net_conf.c net_conf.c-20070228210606-uywdn1acd043wgvt-1
=== modified file 'source/utils/net_conf.c'
--- a/source/utils/net_conf.c 2007-03-23 11:45:35 +0000
+++ b/source/utils/net_conf.c 2007-03-27 21:54:46 +0000
@@ -288,12 +288,16 @@
d_printf("TEST: snum %i : [%s]\n", share->service,
(share->service == GLOBAL_SECTION_SNUM)?
- "global":lp_servicename(share->service));
+ GLOBAL_NAME : lp_servicename(share->service));
while ((parm = lp_next_parameter(share->service, &pnum, 0)))
{
void *ptr = parm->ptr;
int i = 0;
+ if ((share->service < 0 && parm->p_class == P_LOCAL)
+ && !(parm->flags & FLAG_GLOBAL))
+ continue;
+
if (parm->p_class == P_LOCAL && share->service >= 0) {
ptr = lp_local_ptr(share->service, ptr);
}
@@ -460,9 +464,9 @@
if (!lp_load(filename,
False, /* global_only */
- False, /* save_defaults */
+ True, /* save_defaults */
False, /* add_ipc */
- True)) /* initialize_globals */
+ True)) /* initialize_globals */
{
d_fprintf(stderr, "Error parsing configuration file.\n");
goto done;
More information about the samba-cvs
mailing list