At http://samba.sernet.de/ma/bzr/SAMBA_3_0-registry.bzr/

------------------------------------------------------------
revno: 5311
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Michael Adam <[EMAIL PROTECTED]>
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;

Reply via email to