svn commit: samba r6155 - in branches/SAMBA_3_0/source: libsmb param

derrell at samba.org derrell at samba.org
Thu Mar 31 20:28:47 GMT 2005


Author: derrell
Date: 2005-03-31 20:28:47 +0000 (Thu, 31 Mar 2005)
New Revision: 6155

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6155

Log:
Fixes bug #1133

Added provision for overloading some global configuration options via the new,
per-user file ~/.smb/smb.conf.append which is read after the global config
file is read (and only if the global config file was read).  This leave the
original, BC behavior of ~/.smb/smb.conf which, if found, is read but causes
the global config file to not be read.

Also fixed a potential seg fault in to lp_dump_one().


Modified:
   branches/SAMBA_3_0/source/libsmb/libsmbclient.c
   branches/SAMBA_3_0/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/libsmbclient.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/libsmbclient.c	2005-03-31 20:11:20 UTC (rev 6154)
+++ branches/SAMBA_3_0/source/libsmb/libsmbclient.c	2005-03-31 20:28:47 UTC (rev 6155)
@@ -5169,10 +5169,25 @@
                          * defaults ...
                          */
 
-                   if (!lp_load(dyn_CONFIGFILE, True, False, False)) {
-                      DEBUG(5, ("Could not load either config file: %s or %s\n",
-                             conf, dyn_CONFIGFILE));
-                   }
+                        if (!lp_load(dyn_CONFIGFILE, True, False, False)) {
+                                DEBUG(5, ("Could not load either config file: "
+                                          "%s or %s\n",
+                                          conf, dyn_CONFIGFILE));
+                        } else {
+                                /*
+                                 * We loaded the global config file.  Now lets
+                                 * load user-specific modifications to the
+                                 * global config.
+                                 */
+                                slprintf(conf, sizeof(conf),
+                                         "%s/.smb/smb.conf.append", home);
+                                if (!lp_load(conf, True, False, False)) {
+                                        DEBUG(10,
+                                              ("Could not append config file: "
+                                               "%s\n",
+                                               conf));
+                                }
+                        }
                 }
 
                 reopen_logs();  /* Get logging working ... */

Modified: branches/SAMBA_3_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_3_0/source/param/loadparm.c	2005-03-31 20:11:20 UTC (rev 6154)
+++ branches/SAMBA_3_0/source/param/loadparm.c	2005-03-31 20:28:47 UTC (rev 6155)
@@ -73,7 +73,7 @@
 
 /* some helpful bits */
 #define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && ServicePtrs[(i)]->valid)
-#define VALID(i) ServicePtrs[i]->valid
+#define VALID(i) (ServicePtrs != NULL && ServicePtrs[i]->valid)
 
 int keepalive = DEFAULT_KEEPALIVE;
 BOOL use_getwd_cache = True;



More information about the samba-cvs mailing list