svn commit: samba r2628 - in branches/SAMBA_4_0/source: ldap_server lib/socket librpc/rpc rpc_server/samr smbd torture/basic

tridge at samba.org tridge at samba.org
Sat Sep 25 11:48:30 GMT 2004


Author: tridge
Date: 2004-09-25 11:48:30 +0000 (Sat, 25 Sep 2004)
New Revision: 2628

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=2628&nolog=1

Log:
got rid of some warnings and converted a few more places to use hierarchical memory allocation






Modified:
   branches/SAMBA_4_0/source/ldap_server/ldap_server.c
   branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_tcp.c
   branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c
   branches/SAMBA_4_0/source/smbd/service.c
   branches/SAMBA_4_0/source/torture/basic/charset.c


Changeset:
Modified: branches/SAMBA_4_0/source/ldap_server/ldap_server.c
===================================================================
--- branches/SAMBA_4_0/source/ldap_server/ldap_server.c	2004-09-25 11:24:10 UTC (rev 2627)
+++ branches/SAMBA_4_0/source/ldap_server/ldap_server.c	2004-09-25 11:48:30 UTC (rev 2628)
@@ -612,7 +612,7 @@
 
 	DEBUG(5, ("ldapsrv_accept\n"));
 
-	ldap_conn = talloc_p(NULL, struct ldapsrv_connection);
+	ldap_conn = talloc_p(conn, struct ldapsrv_connection);
 
 	if (ldap_conn == NULL)
 		return;

Modified: branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c
===================================================================
--- branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c	2004-09-25 11:24:10 UTC (rev 2627)
+++ branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c	2004-09-25 11:48:30 UTC (rev 2628)
@@ -153,7 +153,7 @@
 	socklen_t cli_addr_len = 0;
 	int new_fd;
 
-	new_fd = accept(sock->fd, &cli_addr, &cli_addr_len);
+	new_fd = accept(sock->fd, (struct sockaddr *)&cli_addr, &cli_addr_len);
 	if (new_fd == -1) {
 		/* TODO: we need to map from errno to NTSTATUS here! */
 		return NT_STATUS_FOOBAR;

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c	2004-09-25 11:24:10 UTC (rev 2627)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c	2004-09-25 11:48:30 UTC (rev 2628)
@@ -22,8 +22,7 @@
 
 #include "includes.h"
 
-/* initialise a dcerpc pipe. This currently assumes a SMB named pipe
-   transport */
+/* initialise a dcerpc pipe. */
 struct dcerpc_pipe *dcerpc_pipe_init(void)
 {
 	struct dcerpc_pipe *p;

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c	2004-09-25 11:24:10 UTC (rev 2627)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c	2004-09-25 11:48:30 UTC (rev 2628)
@@ -433,7 +433,7 @@
 	/* Over-ride the default session key with the SMB session key */
 	(*p)->security_state.session_key = smb_session_key;
 
-	smb = talloc((*p), sizeof(*smb));
+	smb = talloc_p((*p), struct smb_private);
 	if (!smb) {
 		dcerpc_pipe_close(*p);
 		return NT_STATUS_NO_MEMORY;

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_tcp.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_tcp.c	2004-09-25 11:24:10 UTC (rev 2627)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_tcp.c	2004-09-25 11:48:30 UTC (rev 2628)
@@ -329,7 +329,7 @@
 
 	set_socket_options(fd, lp_socket_options());
 
-    if (!(*p = dcerpc_pipe_init())) {
+	if (!(*p = dcerpc_pipe_init())) {
                 return NT_STATUS_NO_MEMORY;
 	}
  

Modified: branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c	2004-09-25 11:24:10 UTC (rev 2627)
+++ branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c	2004-09-25 11:48:30 UTC (rev 2628)
@@ -47,13 +47,13 @@
 
 	ZERO_STRUCTP(r->out.connect_handle);
 
-	c_state = talloc_p(NULL, struct samr_connect_state);
+	c_state = talloc_p(dce_call->conn, struct samr_connect_state);
 	if (!c_state) {
 		return NT_STATUS_NO_MEMORY;
 	}
 
 	/* make sure the sam database is accessible */
-	c_state->sam_ctx = samdb_connect(mem_ctx);
+	c_state->sam_ctx = samdb_connect(c_state);
 	if (c_state->sam_ctx == NULL) {
 		talloc_free(c_state);
 		return NT_STATUS_INVALID_SYSTEM_SERVICE;

Modified: branches/SAMBA_4_0/source/smbd/service.c
===================================================================
--- branches/SAMBA_4_0/source/smbd/service.c	2004-09-25 11:24:10 UTC (rev 2627)
+++ branches/SAMBA_4_0/source/smbd/service.c	2004-09-25 11:48:30 UTC (rev 2628)
@@ -101,9 +101,9 @@
   if you pass *port == 0, then a port > 1024 is used
  */
 struct server_socket *service_setup_socket(struct server_service *service,
-                        const struct model_ops *model_ops,
-                        const char *sock_addr,
-                        uint16_t *port)
+					   const struct model_ops *model_ops,
+					   const char *sock_addr,
+					   uint16_t *port)
 {
 	NTSTATUS status;
 	struct server_socket *srv_sock;
@@ -155,7 +155,7 @@
 		return NULL;
 	}
 
-	srv_sock = talloc_p(NULL, struct server_socket);
+	srv_sock = talloc_p(service, struct server_socket);
 	if (!srv_sock) {
 		DEBUG(0,("talloc_p(mem_ctx, struct server_socket) failed\n"));
 		socket_destroy(socket_ctx);
@@ -185,13 +185,16 @@
 	return srv_sock;
 }
 
-struct server_connection *server_setup_connection(struct event_context *ev, struct server_socket *server_socket, struct socket_context *sock, time_t t)
+struct server_connection *server_setup_connection(struct event_context *ev, 
+						  struct server_socket *server_socket, 
+						  struct socket_context *sock, 
+						  time_t t)
 {
 	struct fd_event fde;
 	struct timed_event idle;
 	struct server_connection *srv_conn;
 
-	srv_conn = talloc_p(NULL, struct server_connection);
+	srv_conn = talloc_p(server_socket, struct server_connection);
 	if (!srv_conn) {
 		DEBUG(0,("talloc_p(mem_ctx, struct server_service_connection) failed\n"));
 		return NULL;

Modified: branches/SAMBA_4_0/source/torture/basic/charset.c
===================================================================
--- branches/SAMBA_4_0/source/torture/basic/charset.c	2004-09-25 11:24:10 UTC (rev 2627)
+++ branches/SAMBA_4_0/source/torture/basic/charset.c	2004-09-25 11:48:30 UTC (rev 2628)
@@ -40,7 +40,7 @@
 	int i;
 	NTSTATUS status;
 
-	ucs_name = talloc(NULL, (1+u_name_len)*2);
+	ucs_name = talloc(mem_ctx, (1+u_name_len)*2);
 	if (!ucs_name) {
 		printf("Failed to create UCS2 Name - talloc() failure\n");
 		return NT_STATUS_NO_MEMORY;



More information about the samba-cvs mailing list