[SCM] Samba Shared Repository - branch v4-3-test updated

Karolin Seeger kseeger at samba.org
Mon Feb 22 13:27:03 UTC 2016


The branch, v4-3-test has been updated
       via  f37cb21 Real memeory leak(buildup) issue in loadparm.
       via  89b13fe docs: Add example for domain logins to smbspool man page.
       via  80a8453 libcli: Fix debug message, print sid string for new_ace trustee.
      from  150d1f6 VERSION: Bump version up to 4.3.6...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-3-test


- Log -----------------------------------------------------------------
commit f37cb215c81968e7f75cb93129d05175ecb6512a
Author: Hemanth Thummala <hemanth.thummala at nutanix.com>
Date:   Tue Feb 16 14:44:38 2016 -0800

    Real memeory leak(buildup) issue in loadparm.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11740
    
    As part of reload services, unused service ptr structures are getting
    unloaded without actually freeingup the memory associated to them.
    
    Made changes to freeup those allocations on unload. On reload, reuse the
    slots in ServicePtr global array instead of extending the array with
    holes.
    
    Also we should mark shares like IPC$ as auto loaded as they never be
    exposed to users.
    
    Signed-off-by: Hemanth Thummala <hemanth.thummala at nutanix.com>
    Reviewed-by: Volker Lendecke <Volker.Lendecke at SerNet.DE>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Feb 17 22:30:25 CET 2016 on sn-devel-144
    
    (cherry picked from commit 03081c2c1484504bdcc0e111b2df95e073c1c166)
    
    Autobuild-User(v4-3-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-3-test): Mon Feb 22 14:26:23 CET 2016 on sn-devel-104

commit 89b13fea7bb91afe4159c58b8b2cabdfc7a18818
Author: Berend De Schouwer <berend.de.schouwer at gmail.com>
Date:   Mon Feb 22 11:09:57 2016 +0100

    docs: Add example for domain logins to smbspool man page.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11643
    
    Reviewed-by: Karolin Seeger <kseeger at samba.org>

commit 80a845393e5e43ab566a5a1259c90e9a95625e2a
Author: Noel Power <noel.power at suse.com>
Date:   Thu Feb 11 16:00:55 2016 +0000

    libcli: Fix debug message, print sid string for new_ace trustee.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11738
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    (cherry picked from commit c4cd56c484c4edd8f271524bdd8e97a9e52116e6)

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages/smbspool.8.xml |  5 +++++
 libcli/security/secdesc.c        |  2 +-
 source3/param/loadparm.c         | 40 +++++++++++++++++++++++++++-------------
 3 files changed, 33 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/smbspool.8.xml b/docs-xml/manpages/smbspool.8.xml
index 2f2de08..5d619c4 100644
--- a/docs-xml/manpages/smbspool.8.xml
+++ b/docs-xml/manpages/smbspool.8.xml
@@ -50,6 +50,7 @@
 		<listitem><para>smb://server[:port]/printer</para></listitem>
 		<listitem><para>smb://workgroup/server[:port]/printer</para></listitem>
 		<listitem><para>smb://username:password@server[:port]/printer</para></listitem>
+		<listitem><para>smb://domain\username:password@server[:port]/printer</para></listitem>
 		<listitem><para>smb://username:password@workgroup/server[:port]/printer</para></listitem>
 	</itemizedlist>
 
@@ -62,6 +63,10 @@
 	pass the URI in argv[0], while shell scripts must set the 
 	<envar>DEVICE_URI</envar> environment variable prior to
 	running smbspool.</para>
+
+	<para>smbspool will accept URI escaped characters.  This allows setting
+	a domain in the username, or space in the printer name. For example
+	smb://domain%5Cusername/printer%20name</para>
 </refsect1>
 
 <refsect1>
diff --git a/libcli/security/secdesc.c b/libcli/security/secdesc.c
index 46b820e..e4f3430 100644
--- a/libcli/security/secdesc.c
+++ b/libcli/security/secdesc.c
@@ -586,7 +586,7 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx,
 			  " inherited as %s:%d/0x%02x/0x%08x\n",
 			  dom_sid_string(frame, &ace->trustee),
 			  ace->type, ace->flags, ace->access_mask,
-			  dom_sid_string(frame, &ace->trustee),
+			  dom_sid_string(frame, &new_ace->trustee),
 			  new_ace->type, new_ace->flags,
 			  new_ace->access_mask));
 
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index c576b22..3e4a772 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -97,8 +97,11 @@ static struct smbconf_csn conf_last_csn;
 static int config_backend = CONFIG_BACKEND_FILE;
 
 /* some helpful bits */
-#define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && (ServicePtrs != NULL) && ServicePtrs[(i)]->valid)
-#define VALID(i) (ServicePtrs != NULL && ServicePtrs[i]->valid)
+#define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && \
+                       (ServicePtrs != NULL) && \
+		       (ServicePtrs[(i)] != NULL) && ServicePtrs[(i)]->valid)
+#define VALID(i) ((ServicePtrs != NULL) && (ServicePtrs[i]!= NULL) && \
+                  ServicePtrs[i]->valid)
 
 #define USERSHARE_VALID 1
 #define USERSHARE_PENDING_DELETE 2
@@ -1370,7 +1373,7 @@ static void free_service_byindex(int idx)
 	}
 
 	free_service(ServicePtrs[idx]);
-	talloc_free_children(ServicePtrs[idx]);
+	TALLOC_FREE(ServicePtrs[idx]);
 }
 
 /***************************************************************************
@@ -1392,20 +1395,30 @@ static int add_a_service(const struct loadparm_service *pservice, const char *na
 		}
 	}
 
-	/* if not, then create one */
-	i = iNumServices;
-	tsp = talloc_realloc(NULL, ServicePtrs, struct loadparm_service *, num_to_alloc);
-	if (tsp == NULL) {
-		DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n"));
-		return (-1);
+	/* Re use empty slots if any before allocating new one.*/
+	for (i=0; i < iNumServices; i++) {
+		if (ServicePtrs[i] == NULL) {
+			break;
+		}
 	}
-	ServicePtrs = tsp;
-	ServicePtrs[iNumServices] = talloc_zero(ServicePtrs, struct loadparm_service);
-	if (!ServicePtrs[iNumServices]) {
+	if (i == iNumServices) {
+		/* if not, then create one */
+		tsp = talloc_realloc(NULL, ServicePtrs,
+				     struct loadparm_service *,
+				     num_to_alloc);
+		if (tsp == NULL) {
+			DEBUG(0, ("add_a_service: failed to enlarge "
+				  "ServicePtrs!\n"));
+			return (-1);
+		}
+		ServicePtrs = tsp;
+		iNumServices++;
+	}
+	ServicePtrs[i] = talloc_zero(ServicePtrs, struct loadparm_service);
+	if (!ServicePtrs[i]) {
 		DEBUG(0,("add_a_service: out of memory!\n"));
 		return (-1);
 	}
-	iNumServices++;
 
 	ServicePtrs[i]->valid = true;
 
@@ -1571,6 +1584,7 @@ static bool lp_add_ipc(const char *ipc_name, bool guest_ok)
 	ServicePtrs[i]->guest_ok = guest_ok;
 	ServicePtrs[i]->printable = false;
 	ServicePtrs[i]->browseable = sDefault.browseable;
+	ServicePtrs[i]->autoloaded = true;
 
 	DEBUG(3, ("adding IPC service\n"));
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list