The branch, master has been updated
       via  7ca576e... s4:rpc_server: remove unused socket_address based 
functions
       via  9a1a001... s4:web_server: use tsocket_address functions to get the 
local ip and port
       via  41d9707... s4:smb_server: use tsocket_address_string() for 
debugging the client address
       via  b778251... s4:wrepl_server: use tsocket_address functions to get 
the peer ip
       via  0a70788... s4:lib/registry: fix the waf build
      from  a2b8e28... s4-smbtorture: upload the full cups driver, otherwise 
windows will not allow using it.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 7ca576e5c4a0da616c2a6738859c9c989f76202e
Author: Stefan Metzmacher <[email protected]>
Date:   Tue Apr 27 16:49:00 2010 +0200

    s4:rpc_server: remove unused socket_address based functions
    
    metze

commit 9a1a00199c2603376eacfdba7e7d0d55bc64f405
Author: Stefan Metzmacher <[email protected]>
Date:   Tue Apr 27 16:36:26 2010 +0200

    s4:web_server: use tsocket_address functions to get the local ip and port
    
    metze

commit 41d970718a105a1321cf80bc1004b51b7af7cc69
Author: Stefan Metzmacher <[email protected]>
Date:   Tue Apr 27 16:05:08 2010 +0200

    s4:smb_server: use tsocket_address_string() for debugging the client address
    
    metze

commit b7782514b91b365ec07426d4adfc8f59c53c372e
Author: Stefan Metzmacher <[email protected]>
Date:   Tue Apr 27 16:17:28 2010 +0200

    s4:wrepl_server: use tsocket_address functions to get the peer ip
    
    metze

commit 0a70788e190ca00cab27c67000abf77617141b5e
Author: Stefan Metzmacher <[email protected]>
Date:   Tue Apr 27 17:04:32 2010 +0200

    s4:lib/registry: fix the waf build
    
    The pass to a source file is relative to the wscript* file.
    
    metze

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

Summary of changes:
 source4/lib/registry/wscript_build   |    2 +-
 source4/rpc_server/service_rpc.c     |   18 ------------------
 source4/smb_server/management.c      |   16 ++++++++--------
 source4/web_server/wsgi.c            |   16 +++++++++++-----
 source4/wrepl_server/wrepl_in_call.c |   21 ++++++++++++++++-----
 5 files changed, 36 insertions(+), 37 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/registry/wscript_build 
b/source4/lib/registry/wscript_build
index 2e07757..185685c 100644
--- a/source4/lib/registry/wscript_build
+++ b/source4/lib/registry/wscript_build
@@ -11,7 +11,7 @@ bld.SAMBA_SUBSYSTEM('TDR_REGF',
 
 
 bld.SAMBA_LIBRARY('registry',
-       source='interface.c ../libcli/registry/util_reg.c util.c samba.c 
patchfile_dotreg.c patchfile_preg.c patchfile.c regf.c hive.c local.c ldb.c 
dir.c rpc.c',
+       source='interface.c ../../../libcli/registry/util_reg.c util.c samba.c 
patchfile_dotreg.c patchfile_preg.c patchfile.c regf.c hive.c local.c ldb.c 
dir.c rpc.c',
        pc_files='registry.pc',
        public_deps='LIBSAMBA-UTIL CHARSET TDR_REGF ldb RPC_NDR_WINREG 
LDB_WRAP',
        public_headers='registry.h',
diff --git a/source4/rpc_server/service_rpc.c b/source4/rpc_server/service_rpc.c
index 906b02d..6f4df00 100644
--- a/source4/rpc_server/service_rpc.c
+++ b/source4/rpc_server/service_rpc.c
@@ -133,24 +133,6 @@ static void dcesrv_sock_reply_done(struct tevent_req 
*subreq)
        }
 }
 
-static struct socket_address *dcesrv_sock_get_my_addr(struct dcesrv_connection 
*dcesrv_conn, TALLOC_CTX *mem_ctx)
-{
-       struct stream_connection *srv_conn;
-       srv_conn = talloc_get_type(dcesrv_conn->transport.private_data,
-                                  struct stream_connection);
-
-       return socket_get_my_addr(srv_conn->socket, mem_ctx);
-}
-
-static struct socket_address *dcesrv_sock_get_peer_addr(struct 
dcesrv_connection *dcesrv_conn, TALLOC_CTX *mem_ctx)
-{
-       struct stream_connection *srv_conn;
-       srv_conn = talloc_get_type(dcesrv_conn->transport.private_data,
-                                  struct stream_connection);
-
-       return socket_get_peer_addr(srv_conn->socket, mem_ctx);
-}
-
 struct dcerpc_read_ncacn_packet_state {
        struct {
                struct smb_iconv_convenience *smb_iconv_c;
diff --git a/source4/smb_server/management.c b/source4/smb_server/management.c
index b8e42ae..0537359 100644
--- a/source4/smb_server/management.c
+++ b/source4/smb_server/management.c
@@ -79,9 +79,15 @@ static NTSTATUS smbsrv_tcon_information(struct irpc_message 
*msg,
 {
        struct smbsrv_connection *smb_conn = talloc_get_type(msg->private_data,
                                             struct smbsrv_connection);
+       struct tsocket_address *client_addr = 
smb_conn->connection->remote_address;
+       char *client_addr_string;
        int i=0, count=0;
        struct smbsrv_tcon *tcon;
 
+       /* This is for debugging only! */
+       client_addr_string = tsocket_address_string(client_addr, r);
+       NT_STATUS_HAVE_NO_MEMORY(client_addr_string);
+
        /* count the number of tcons */
        for (tcon=smb_conn->smb_tcons.list; tcon; tcon=tcon->next) {
                count++;
@@ -93,14 +99,8 @@ static NTSTATUS smbsrv_tcon_information(struct irpc_message 
*msg,
 
        for (tcon=smb_conn->smb_tcons.list; tcon; tcon=tcon->next) {
                struct smbsrv_tcon_info *info = &r->out.info.tcons.tcons[i];
-               struct socket_address *client_addr;
-               client_addr = 
socket_get_peer_addr(smb_conn->connection->socket, r);
-               
-               if (client_addr) {
-                       info->client_ip = client_addr->addr;
-               } else {
-                       info->client_ip = NULL;
-               }
+
+               info->client_ip    = client_addr_string;
 
                info->tid          = tcon->tid;
                info->share_name   = tcon->share_name;
diff --git a/source4/web_server/wsgi.c b/source4/web_server/wsgi.c
index 9b5e384..7ee70e1 100644
--- a/source4/web_server/wsgi.c
+++ b/source4/web_server/wsgi.c
@@ -26,6 +26,7 @@
 #include "../lib/util/dlinklist.h"
 #include "../lib/util/data_blob.h"
 #include "lib/tls/tls.h"
+#include "lib/tsocket/tsocket.h"
 
 typedef struct {
        PyObject_HEAD
@@ -320,18 +321,23 @@ static void wsgi_process_http_input(struct 
web_server_data *wdata,
 {
        PyObject *py_environ, *result, *item, *iter;
        PyObject *request_handler = (PyObject *)wdata->private_data;
-       struct socket_address *socket_address;
-
+       struct tsocket_address *my_address = web->conn->local_address;
+       const char *addr = "0.0.0.0";
+       uint16_t port = 0;
        web_request_Object *py_web = PyObject_New(web_request_Object, 
&web_request_Type);
        py_web->web = web;
 
-       socket_address = socket_get_my_addr(web->conn->socket, web);
+       if (tsocket_address_is_inet(my_address, "ip")) {
+               addr = tsocket_address_inet_addr_string(my_address, wdata);
+               port = tsocket_address_inet_port(my_address);
+       }
+
        py_environ = create_environ(tls_enabled(web->conn->socket),
                                    web->input.content_length, 
                                    web->input.headers, 
                                    web->input.post_request?"POST":"GET",
-                                   socket_address->addr,
-                                   socket_address->port, 
+                                   addr,
+                                   port,
                                    Py_InputHttpStream(web),
                                    web->input.url
                                    );
diff --git a/source4/wrepl_server/wrepl_in_call.c 
b/source4/wrepl_server/wrepl_in_call.c
index dfe2555..91a3940 100644
--- a/source4/wrepl_server/wrepl_in_call.c
+++ b/source4/wrepl_server/wrepl_in_call.c
@@ -21,7 +21,7 @@
 
 #include "includes.h"
 #include "lib/events/events.h"
-#include "lib/socket/socket.h"
+#include "lib/tsocket/tsocket.h"
 #include "smbd/service_task.h"
 #include "smbd/service_stream.h"
 #include "libcli/wrepl/winsrepl.h"
@@ -429,12 +429,23 @@ static NTSTATUS wreplsrv_in_replication(struct 
wreplsrv_in_call *call)
        }
 
        if (!call->wreplconn->partner) {
-               struct socket_address *partner_ip = 
socket_get_peer_addr(call->wreplconn->conn->socket, call);
+               struct tsocket_address *peer_addr = 
call->wreplconn->conn->remote_address;
+               char *peer_ip;
 
-               call->wreplconn->partner = 
wreplsrv_find_partner(call->wreplconn->service, partner_ip->addr);
+               if (!tsocket_address_is_inet(peer_addr, "ipv4")) {
+                       DEBUG(0,("wreplsrv_in_replication: non ipv4 peer addr 
'%s'\n",
+                               tsocket_address_string(peer_addr, call)));
+                       return NT_STATUS_INTERNAL_ERROR;
+               }
+
+               peer_ip = tsocket_address_inet_addr_string(peer_addr, call);
+               if (peer_ip == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+               }
+
+               call->wreplconn->partner = 
wreplsrv_find_partner(call->wreplconn->service, peer_ip);
                if (!call->wreplconn->partner) {
-                       DEBUG(1,("Failing WINS replication from non-partner 
%s\n",
-                                partner_ip ? partner_ip->addr : NULL));
+                       DEBUG(1,("Failing WINS replication from non-partner 
%s\n", peer_ip));
                        return wreplsrv_in_stop_assoc_ctx(call);
                }
        }


-- 
Samba Shared Repository

Reply via email to