The branch, master has been updated
       via  6d4f9fc s3:libsmb: move cli_state->desthost to 
cli_state->conn.remote_name
       via  477a8a7 s3:winbindd_cm: use controller instead of cli->desthost
       via  e0a38c3 s3:net_util: use server_name instead of cli->desthost
       via  4fb03b4 s3:net_rpc_registry: use pipe_hnd->desthost instead of 
cli->desthost
       via  1f1ca59 s3:net_rpc_printer: make use of cli_state_remote_name()
       via  419eb29 s3:net_rpc_join: make use of cli_state_remote_name()
       via  7ca20ea s3:net_rpc_join: use pipe_hnd->desthost instead of 
cli->desthost
       via  27c38df s3:net_rpc: make use of cli_state_remote_name()
       via  f88723a s3:net_rpc: use netr->desthost instead of cli->desthost
       via  3d675f1 s3:net_rap: make use of cli_state_remote_name()
       via  540cd1a s3:rpcclient: make use of cli_state_remote_name()
       via  9a638c4 s3:rpcclient: use rpc_pipe->desthost instead of 
cli->desthost
       via  49c8534 s3:cli_pipe_schannel: make use of cli_state_remote_name()
       via  efc2c31 s3:cli_pipe: make use of cli_state_remote_name()
       via  ef23fb3 s3:cli_pipe: use result->desthost instead of cli->desthost
       via  9fe30f3 s3:libsmb_server: make use of cli_state_remote_name()
       via  b5e9ada s3:libsmb/libsmb_dir: make use of cli_state_remote_name()
       via  8277260 s3:libsmb/clirap2: make use of cli_state_remote_name()
       via  390b545 s3:libsmb/clifsinfo: make use of cli_state_remote_name()
       via  ad40515 s3:libsmb/clidfs: make use of cli_state_remote_name()
       via  77fdebc s3:libsmb/cliconnect: make use of cli_state_remote_name()
       via  22cbb59 s3:libnet_join: make use of cli_state_remote_name()
       via  bb0d063 s3:lib/netapi: make use of cli_state_remote_name()
       via  9a3e15d s3:client: make use of cli_state_remote_name()
       via  ab9d99c s3:auth_server: make use of cli_state_remote_name()
       via  823ce6f s3:auth_domain: we already have the dc_name, it's the same 
as cli->desthost
       via  b87bd59 s3:libsmb: add cli_state_remote_name()
       via  b3e0b73 s3:libsmb: remove const from cli_cm_display()
       via  a560b79 s3-torture: run_locktest4(): replace cli_read_old() with 
cli_read()
       via  0986b0b s3-torture: introduce test_cli_read()
       via  48de329 s3:libsmb: move cli_state->{src_ss,dest_ss} to 
cli_state->conn.{local_ss,remote_ss}
       via  cc4b2a6 s3:net_rpc_printer: make use of cli_state_remote_sockaddr()
       via  9b40092 s3:net_rpc: make use of cli_state_remote_sockaddr()
       via  a46b265 s3:net_rpc_join: make use of cli_state_remote_sockaddr()
       via  f0c1b5d s3:net_rpc_join: pass const sockaddr_storage to 
net_rpc_join_ok()
       via  e917976 s3:net_util: pass const sockaddr_storage to 
net_make_ipc_connection_ex()
       via  f7cd20d s3:net_util: add some const to sockaddr_storage
       via  b76951b s3:auth_domain: add some const to sockaddr_storage
       via  5c7749a s3:libsmb: only pass const sockaddr_storage to 
cli_full_connection()
       via  552164c s3:smbcquotas: pass down NULL instead of a zero 
sockaddr_storage
       via  d60a1b4 s3:smbcacls: pass down NULL instead of a zero 
sockaddr_storage
       via  814449a s3:libsmb_server: pass NULL instead of a zero 
sockaddr_storage
       via  1eb8c2a s3:libsmb: only pass a const sockaddr_storage to 
cli_start_connection()
       via  6cc61d6 s3:net_time: expect const sockaddr_storage in 
cli_servertime()
       via  0cd70ec s3:libsmb: let cli_connect_nb() only expect a const 
sockaddr_storage *dest_ss
       via  7f0b4ee s3:libsmb: use cli_state_remote_sockaddr() in 
smb2cli_tcon_send()
       via  acf4b84 s3:libnet: use cli_state_remote_sockaddr() in 
libnet_DomainJoin()
       via  8bea5d6 s3:winbindd_cm: use cli_state_[local|remote]_sockaddr()
       via  fa42d2e s3:libsmb: add cli_state_[local|remote]_sockaddr()
       via  13dbd50 s3:libsmb: move cli_state->fd to cli_state->conn.fd
       via  6d1757f s3:libsmb: make use of cli_state_disconnect()
       via  103413d s3:libsmb: make use of cli_state_is_connected()
       via  cd71c57 s3:torture: use cli_state_disconnect() to close the socket 
on SIGALRM
       via  5bd80b2 s3:smbtree: try to fix completely broken logic in 
get_workgroups()
      from  efbe160 s3:loadparm: fix the reload of the configuration: also 
reload activated registry shares

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


- Log -----------------------------------------------------------------
commit 6d4f9fc251fabc2951356db968e72b65ebf8c027
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:53:51 2011 +0200

    s3:libsmb: move cli_state->desthost to cli_state->conn.remote_name
    
    metze
    
    Autobuild-User: Stefan Metzmacher <[email protected]>
    Autobuild-Date: Fri Jul 22 18:17:41 CEST 2011 on sn-devel-104

commit 477a8a7e479952640703ca2f30dc6e184a57edb1
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:52:55 2011 +0200

    s3:winbindd_cm: use controller instead of cli->desthost
    
    The should have the same value.
    
    metze

commit e0a38c3a36311de5579ddc5eafb8868a68563928
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:52:11 2011 +0200

    s3:net_util: use server_name instead of cli->desthost
    
    They should be the same.
    
    metze

commit 4fb03b4edd6efeae6eb240a7814882254b6b4517
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:51:19 2011 +0200

    s3:net_rpc_registry: use pipe_hnd->desthost instead of cli->desthost
    
    metze

commit 1f1ca59a0445d495f4e29f722b65f23e622b1838
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:50:43 2011 +0200

    s3:net_rpc_printer: make use of cli_state_remote_name()
    
    metze

commit 419eb293f7cbc89651fb13de5745bf51778fb7b5
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:49:28 2011 +0200

    s3:net_rpc_join: make use of cli_state_remote_name()
    
    metze

commit 7ca20eadf45f13048413da144df3ab9860ede7a6
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:48:38 2011 +0200

    s3:net_rpc_join: use pipe_hnd->desthost instead of cli->desthost
    
    metze

commit 27c38dfb445565a160cfcb3b80c73bb7ad05ece3
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:48:02 2011 +0200

    s3:net_rpc: make use of cli_state_remote_name()
    
    metze

commit f88723ab2784d5f035802d1040e7d3e7ac1a8656
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:47:35 2011 +0200

    s3:net_rpc: use netr->desthost instead of cli->desthost
    
    metze

commit 3d675f1219ada8d6438f411ee433038a1c91838c
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:46:16 2011 +0200

    s3:net_rap: make use of cli_state_remote_name()
    
    metze

commit 540cd1ac96023646f3facc636538ccef124917be
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:45:51 2011 +0200

    s3:rpcclient: make use of cli_state_remote_name()
    
    metze

commit 9a638c4c5af04ce9a93b174849347302d5da3184
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:45:12 2011 +0200

    s3:rpcclient: use rpc_pipe->desthost instead of cli->desthost
    
    metze

commit 49c8534ae41222ef1fa6be0f3a1d77098a40abdb
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:44:28 2011 +0200

    s3:cli_pipe_schannel: make use of cli_state_remote_name()
    
    metze

commit efc2c3159ebc8c42bbb78fd07e4c21b6e74e45ba
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:44:02 2011 +0200

    s3:cli_pipe: make use of cli_state_remote_name()
    
    metze

commit ef23fb3412d167fd69e4512639fb2b783bd08185
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:43:27 2011 +0200

    s3:cli_pipe: use result->desthost instead of cli->desthost
    
    metze

commit 9fe30f3c91234436c0f4a019d3c1545b41184d9b
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:34:29 2011 +0200

    s3:libsmb_server: make use of cli_state_remote_name()
    
    metze

commit b5e9ada632491f56f1f8a1997473a6851284db5e
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:33:51 2011 +0200

    s3:libsmb/libsmb_dir: make use of cli_state_remote_name()
    
    metze

commit 8277260ae78619793c8c404a75936cf423b15cfe
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:33:16 2011 +0200

    s3:libsmb/clirap2: make use of cli_state_remote_name()
    
    metze

commit 390b54554c9f7cad68ef96d705e7829f156eb74f
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:31:51 2011 +0200

    s3:libsmb/clifsinfo: make use of cli_state_remote_name()
    
    metze

commit ad40515d1771212d856d790a61aed46048908130
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:31:18 2011 +0200

    s3:libsmb/clidfs: make use of cli_state_remote_name()
    
    metze

commit 77fdebc5e53a0a86debba5e55c590b1d98f801d2
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:29:58 2011 +0200

    s3:libsmb/cliconnect: make use of cli_state_remote_name()
    
    metze

commit 22cbb59c37e770437668aa23329e5b5a7420bf20
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:28:27 2011 +0200

    s3:libnet_join: make use of cli_state_remote_name()

commit bb0d063f01368c874774276ddb599e606c92ee49
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:19:00 2011 +0200

    s3:lib/netapi: make use of cli_state_remote_name()
    
    metze

commit 9a3e15df7ea6b3dd187490ca455d066b9d6b0ef6
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:16:20 2011 +0200

    s3:client: make use of cli_state_remote_name()
    
    metze

commit ab9d99cece8e450309f4d1c604ce99cfce062fc9
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:15:56 2011 +0200

    s3:auth_server: make use of cli_state_remote_name()
    
    metze

commit 823ce6f50f054aa2c9e769357fa30538e2cc9d0e
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:10:51 2011 +0200

    s3:auth_domain: we already have the dc_name, it's the same as cli->desthost
    
    metze

commit b87bd59ecb5e36db4e18c621bbb3cca9268fed0b
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:09:54 2011 +0200

    s3:libsmb: add cli_state_remote_name()
    
    metze

commit b3e0b7328041093a2006de7adda2ec62ddd7deda
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 16:05:54 2011 +0200

    s3:libsmb: remove const from cli_cm_display()
    
    metze

commit a560b793ca15738c2f09e4a9c17031c6f467ee5f
Author: Björn Baumbach <[email protected]>
Date:   Fri Jul 22 11:18:30 2011 +0200

    s3-torture: run_locktest4(): replace cli_read_old() with cli_read()
    
    Signed-off-by: Stefan Metzmacher <[email protected]>

commit 0986b0bed78c90c2b688cc9d98e5daa8c471cdc2
Author: Björn Baumbach <[email protected]>
Date:   Fri Jul 22 10:48:35 2011 +0200

    s3-torture: introduce test_cli_read()
    
    test_cli_read calls cli_read and returns success or failure
    
    Signed-off-by: Stefan Metzmacher <[email protected]>

commit 48de32936389612240203d3d12016d8730aeb64c
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 13:43:02 2011 +0200

    s3:libsmb: move cli_state->{src_ss,dest_ss} to 
cli_state->conn.{local_ss,remote_ss}
    
    metze

commit cc4b2a6dc31cd2e1609d18da27ea8f3caadeaf28
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 13:42:38 2011 +0200

    s3:net_rpc_printer: make use of cli_state_remote_sockaddr()
    
    metze

commit 9b40092cbd2ee9b9942a4f5ee6041354cffc9227
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 13:42:20 2011 +0200

    s3:net_rpc: make use of cli_state_remote_sockaddr()
    
    metze

commit a46b26556356d20e569ccdb408dd13214e85cf5d
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 13:44:36 2011 +0200

    s3:net_rpc_join: make use of cli_state_remote_sockaddr()
    
    metze

commit f0c1b5dad20392cdd051fefbb64a32c1fcb3bfc8
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 13:41:09 2011 +0200

    s3:net_rpc_join: pass const sockaddr_storage to net_rpc_join_ok()
    
    metze

commit e91797689b99e255ffdf02b765f349861c97e445
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 13:40:19 2011 +0200

    s3:net_util: pass const sockaddr_storage to net_make_ipc_connection_ex()
    
    metze

commit f7cd20d43cab0b21a93e9f4a86eb0e114e667b4b
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 13:05:43 2011 +0200

    s3:net_util: add some const to sockaddr_storage
    
    metze

commit b76951ba8f6456bdaa5ddd90faede60e2833c4df
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 13:04:32 2011 +0200

    s3:auth_domain: add some const to sockaddr_storage
    
    metze

commit 5c7749ac244aa8b83b05599d4bdd13fac2fc2416
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 13:03:19 2011 +0200

    s3:libsmb: only pass const sockaddr_storage to cli_full_connection()
    
    No direct or indirect caller needs this to be set.
    
    metze

commit 552164c7bc74495c636a2d034aed2aa3e60b45aa
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 12:31:05 2011 +0200

    s3:smbcquotas: pass down NULL instead of a zero sockaddr_storage
    
    metze

commit d60a1b4bb03b8c7a1186b031004fca7926b3e857
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 12:29:57 2011 +0200

    s3:smbcacls: pass down NULL instead of a zero sockaddr_storage
    
    metze

commit 814449ab019e8ffea07a6d4c6609fb3512869cbe
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 12:25:44 2011 +0200

    s3:libsmb_server: pass NULL instead of a zero sockaddr_storage
    
    metze

commit 1eb8c2ae22e667f3319afb0b32164cc80bb25cd0
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 12:01:27 2011 +0200

    s3:libsmb: only pass a const sockaddr_storage to cli_start_connection()
    
    Let the caller use cli_state_remote_sockaddr() if needed.
    
    metze

commit 6cc61d63413d143bddcd6d252103ead7dbadcb7c
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 11:56:14 2011 +0200

    s3:net_time: expect const sockaddr_storage in cli_servertime()
    
    We don't want to modify the value.
    
    metze

commit 0cd70ec169724c021bbae05432a02f0dbffd260f
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 11:54:03 2011 +0200

    s3:libsmb: let cli_connect_nb() only expect a const sockaddr_storage 
*dest_ss
    
    Only one caller expects this value to be set,
    which now calls cli_state_remote_sockaddr() to get the value.
    
    metze

commit 7f0b4eed3b85fd061351078e464586460745f225
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 11:24:45 2011 +0200

    s3:libsmb: use cli_state_remote_sockaddr() in smb2cli_tcon_send()
    
    metze

commit acf4b84cbf55dc3899a5005e73c1f55fbf8e5347
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 11:23:48 2011 +0200

    s3:libnet: use cli_state_remote_sockaddr() in libnet_DomainJoin()
    
    metze

commit 8bea5d64029f4903bf403dc574588af3eace3680
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 11:21:29 2011 +0200

    s3:winbindd_cm: use cli_state_[local|remote]_sockaddr()
    
    metze

commit fa42d2e2627dc9669b6fe99eec9a4c22b6963b9a
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 10:29:18 2011 +0200

    s3:libsmb: add cli_state_[local|remote]_sockaddr()
    
    metze

commit 13dbd5021b8f661e4fe38099e1aed03e5b0c02d6
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 09:39:52 2011 +0200

    s3:libsmb: move cli_state->fd to cli_state->conn.fd
    
    metze

commit 6d1757f1893e8f15c645eca44377de2f5a67232a
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 09:39:23 2011 +0200

    s3:libsmb: make use of cli_state_disconnect()
    
    metze

commit 103413da8bd60f1d0dce7c1338db8d6ace312828
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 09:38:42 2011 +0200

    s3:libsmb: make use of cli_state_is_connected()
    
    metze

commit cd71c5746b7fb40349b13b6a3f80f85a7b1a4fa8
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 09:34:29 2011 +0200

    s3:torture: use cli_state_disconnect() to close the socket on SIGALRM
    
    metze

commit 5bd80b20a1e7d2ad2cd5c426f3729ed0ba96cbb1
Author: Stefan Metzmacher <[email protected]>
Date:   Fri Jul 22 12:48:09 2011 +0200

    s3:smbtree: try to fix completely broken logic in get_workgroups()
    
    metze

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

Summary of changes:
 source3/auth/auth_domain.c             |    6 ++--
 source3/auth/auth_server.c             |   13 +++++-----
 source3/client/client.c                |    2 +-
 source3/include/client.h               |    9 +++----
 source3/lib/netapi/cm.c                |    9 +++++-
 source3/libnet/libnet_join.c           |    9 +++++--
 source3/libsmb/async_smb.c             |   21 +++++-----------
 source3/libsmb/cliconnect.c            |   29 ++++++++++-------------
 source3/libsmb/clidfs.c                |   23 ++++++++++++------
 source3/libsmb/clientgen.c             |   39 ++++++++++++++++++++-----------
 source3/libsmb/clierror.c              |    8 +++---
 source3/libsmb/clifsinfo.c             |    2 +-
 source3/libsmb/clirap2.c               |    9 ++++---
 source3/libsmb/libsmb_dir.c            |    4 +-
 source3/libsmb/libsmb_server.c         |   13 +++++-----
 source3/libsmb/proto.h                 |   13 ++++++----
 source3/libsmb/smb2cli_base.c          |   12 +++++-----
 source3/libsmb/smb2cli_tcon.c          |    2 +-
 source3/rpc_client/cli_pipe.c          |   14 +++++-----
 source3/rpc_client/cli_pipe_schannel.c |   12 +++++-----
 source3/rpcclient/rpcclient.c          |    6 ++--
 source3/torture/torture.c              |   38 ++++++++++++++++++++++++------
 source3/utils/net_proto.h              |   21 +++++++++--------
 source3/utils/net_rap.c                |    4 +-
 source3/utils/net_rpc.c                |    7 +++--
 source3/utils/net_rpc_join.c           |   16 +++++++-----
 source3/utils/net_rpc_printer.c        |   18 +++++++++-----
 source3/utils/net_rpc_registry.c       |    4 +-
 source3/utils/net_time.c               |    6 +++-
 source3/utils/net_util.c               |   20 ++++++++--------
 source3/utils/smbcacls.c               |    5 +---
 source3/utils/smbcquotas.c             |    5 +---
 source3/utils/smbtree.c                |   38 ++++++++++++++++++------------
 source3/winbindd/winbindd_cm.c         |   22 +++++-------------
 34 files changed, 253 insertions(+), 206 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c
index 7eb020d..a4e798e 100644
--- a/source3/auth/auth_domain.c
+++ b/source3/auth/auth_domain.c
@@ -116,7 +116,7 @@ void attempt_machine_password_change(void)
 static NTSTATUS connect_to_domain_password_server(struct cli_state **cli,
                                                const char *domain,
                                                const char *dc_name,
-                                               struct sockaddr_storage *dc_ss, 
+                                               const struct sockaddr_storage 
*dc_ss,
                                                struct rpc_pipe_client 
**pipe_ret)
 {
         NTSTATUS result;
@@ -262,7 +262,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
                                        uchar chal[8],
                                        struct auth_serversupplied_info 
**server_info,
                                        const char *dc_name,
-                                       struct sockaddr_storage *dc_ss)
+                                       const struct sockaddr_storage *dc_ss)
 
 {
        struct netr_SamInfo3 *info3 = NULL;
@@ -299,7 +299,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
 
        /* store a successful connection */
 
-       saf_store( domain, cli->desthost );
+       saf_store(domain, dc_name);
 
         /*
          * If this call succeeds, we now have lots of info about the user
diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c
index 1b7993b..3d775c2 100644
--- a/source3/auth/auth_server.c
+++ b/source3/auth/auth_server.c
@@ -297,12 +297,12 @@ static NTSTATUS check_smbserver_security(const struct 
auth_context *auth_context
 
        if ((cli->sec_mode & NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) == 0) {
                if (user_info->password_state != AUTH_PASSWORD_PLAIN) {
-                       DEBUG(1,("password server %s is plaintext, but we are 
encrypted. This just can't work :-(\n", cli->desthost));
+                       DEBUG(1,("password server %s is plaintext, but we are 
encrypted. This just can't work :-(\n", cli_state_remote_name(cli)));
                        return NT_STATUS_LOGON_FAILURE;         
                }
        } else {
                if (memcmp(cli->secblob.data, auth_context->challenge.data, 8) 
!= 0) {
-                       DEBUG(1,("the challenge that the password server (%s) 
supplied us is not the one we gave our client. This just can't work :-(\n", 
cli->desthost));
+                       DEBUG(1,("the challenge that the password server (%s) 
supplied us is not the one we gave our client. This just can't work :-(\n", 
cli_state_remote_name(cli)));
                        return NT_STATUS_LOGON_FAILURE;         
                }
        }
@@ -357,7 +357,7 @@ static NTSTATUS check_smbserver_security(const struct 
auth_context *auth_context
 
                        if (!cli->is_guestlogin) {
                                DEBUG(0,("server_validate: password server %s 
allows users as non-guest \
-with a bad password.\n", cli->desthost));
+with a bad password.\n", cli_state_remote_name(cli)));
                                DEBUG(0,("server_validate: This is broken (and 
insecure) behaviour. Please do not \
 use this machine as the password server.\n"));
                                cli_ulogoff(cli);
@@ -379,7 +379,7 @@ use this machine as the password server.\n"));
 
                if(bad_password_server) {
                        DEBUG(0,("server_validate: [1] password server %s 
allows users as non-guest \
-with a bad password.\n", cli->desthost));
+with a bad password.\n", cli_state_remote_name(cli)));
                        DEBUG(0,("server_validate: [1] This is broken (and 
insecure) behaviour. Please do not \
 use this machine as the password server.\n"));
                        return NT_STATUS_LOGON_FAILURE;
@@ -418,12 +418,13 @@ use this machine as the password server.\n"));
 
        if (!NT_STATUS_IS_OK(nt_status)) {
                DEBUG(1,("password server %s rejected the password: %s\n",
-                        cli->desthost, nt_errstr(nt_status)));
+                        cli_state_remote_name(cli), nt_errstr(nt_status)));
        }
 
        /* if logged in as guest then reject */
        if (cli->is_guestlogin) {
-               DEBUG(1,("password server %s gave us guest only\n", 
cli->desthost));
+               DEBUG(1,("password server %s gave us guest only\n",
+                        cli_state_remote_name(cli)));
                nt_status = NT_STATUS_LOGON_FAILURE;
        }
 
diff --git a/source3/client/client.c b/source3/client/client.c
index 8c797e5..142eea2 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -4431,7 +4431,7 @@ static int cmd_show_connect( void )
                return 1;
        }
 
-       d_printf("//%s/%s\n", targetcli->desthost, targetcli->share);
+       d_printf("//%s/%s\n", cli_state_remote_name(targetcli), 
targetcli->share);
        return 0;
 }
 
diff --git a/source3/include/client.h b/source3/include/client.h
index 26b8fcb..34d99d4 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -51,14 +51,11 @@ struct cli_state {
         * A list of subsidiary connections for DFS.
         */
         struct cli_state *prev, *next;
-       int fd;
        int protocol;
        int sec_mode;
        int rap_error;
        NTSTATUS raw_status; /* maybe via NT_STATUS_DOS() */
 
-       char *desthost;
-
        /* The credentials used to open the cli_state connection. */
        char *domain;
        char *user_name;
@@ -75,8 +72,6 @@ struct cli_state {
 
        char *share;
        char *dev;
-       struct sockaddr_storage src_ss;
-       struct sockaddr_storage dest_ss;
 
        DATA_BLOB secblob; /* cryptkey or negTokenInit */
        uint32 sesskey;
@@ -125,6 +120,10 @@ struct cli_state {
        char *dfs_mountpoint;
 
        struct {
+               int fd;
+               struct sockaddr_storage local_ss;
+               struct sockaddr_storage remote_ss;
+               const char *remote_name;
                struct tevent_queue *outgoing;
                struct tevent_req **pending;
        } conn;
diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c
index d41a5ca..251e98c 100644
--- a/source3/lib/netapi/cm.c
+++ b/source3/lib/netapi/cm.c
@@ -48,7 +48,9 @@ static struct client_ipc_connection *ipc_cm_find(
        struct client_ipc_connection *p;
 
        for (p = priv_ctx->ipc_connections; p; p = p->next) {
-               if (strequal(p->cli->desthost, server_name)) {
+               const char *remote_name = cli_state_remote_name(p->cli);
+
+               if (strequal(remote_name, server_name)) {
                        return p;
                }
        }
@@ -164,12 +166,15 @@ static NTSTATUS pipe_cm_find(struct client_ipc_connection 
*ipc,
        struct client_pipe_connection *p;
 
        for (p = ipc->pipe_connections; p; p = p->next) {
+               const char *ipc_remote_name;
 
                if (!rpc_pipe_np_smb_conn(p->pipe)) {
                        return NT_STATUS_PIPE_EMPTY;
                }
 
-               if (strequal(ipc->cli->desthost, p->pipe->desthost)
+               ipc_remote_name = cli_state_remote_name(ipc->cli);
+
+               if (strequal(ipc_remote_name, p->pipe->desthost)
                    && ndr_syntax_id_equal(&p->pipe->abstract_syntax,
                                           interface)) {
                        *presult = p->pipe;
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 16c068c..1532299 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -1210,7 +1210,8 @@ NTSTATUS libnet_join_ok(const char *netbios_domain_name,
 
                DEBUG(0,("libnet_join_ok: failed to get schannel session "
                        "key from server %s for domain %s. Error was %s\n",
-               cli->desthost, netbios_domain_name, nt_errstr(status)));
+                       cli_state_remote_name(cli),
+                       netbios_domain_name, nt_errstr(status)));
                cli_shutdown(cli);
                return status;
        }
@@ -1231,7 +1232,8 @@ NTSTATUS libnet_join_ok(const char *netbios_domain_name,
                DEBUG(0,("libnet_join_ok: failed to open schannel session "
                        "on netlogon pipe to server %s for domain %s. "
                        "Error was %s\n",
-                       cli->desthost, netbios_domain_name, nt_errstr(status)));
+                       cli_state_remote_name(cli),
+                       netbios_domain_name, nt_errstr(status)));
                return status;
        }
 
@@ -2007,7 +2009,8 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
 
        create_local_private_krb5_conf_for_domain(
                r->out.dns_domain_name, r->out.netbios_domain_name,
-               NULL, &cli->dest_ss, cli->desthost);
+               NULL, cli_state_remote_sockaddr(cli),
+               cli_state_remote_name(cli));
 
        if (r->out.domain_is_ad && r->in.account_ou &&
            !(r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_UNSECURE)) {
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 462a6dc..87614bd 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -215,7 +215,7 @@ bool cli_smb_req_set_pending(struct tevent_req *req)
         * We're the first ones, add the read_smb request that waits for the
         * answer from the server
         */
-       subreq = read_smb_send(cli->conn.pending, state->ev, cli->fd);
+       subreq = read_smb_send(cli->conn.pending, state->ev, cli->conn.fd);
        if (subreq == NULL) {
                cli_smb_req_unset_pending(req);
                return false;
@@ -382,7 +382,7 @@ static NTSTATUS cli_smb_req_iov_send(struct tevent_req *req,
        struct tevent_req *subreq;
        NTSTATUS status;
 
-       if (state->cli->fd == -1) {
+       if (!cli_state_is_connected(state->cli)) {
                return NT_STATUS_CONNECTION_INVALID;
        }
 
@@ -431,7 +431,7 @@ static NTSTATUS cli_smb_req_iov_send(struct tevent_req *req,
                iov_count = 1;
        }
        subreq = writev_send(state, state->ev, state->cli->conn.outgoing,
-                            state->cli->fd, false, iov, iov_count);
+                            state->cli->conn.fd, false, iov, iov_count);
        if (subreq == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -489,10 +489,7 @@ static void cli_smb_sent(struct tevent_req *subreq)
        nwritten = writev_recv(subreq, &err);
        TALLOC_FREE(subreq);
        if (nwritten == -1) {
-               if (state->cli->fd != -1) {
-                       close(state->cli->fd);
-                       state->cli->fd = -1;
-               }
+               cli_state_disconnect(state->cli);
                tevent_req_nterror(req, map_nt_error_from_unix(err));
                return;
        }
@@ -537,10 +534,7 @@ static void cli_smb_received(struct tevent_req *subreq)
        received = read_smb_recv(subreq, talloc_tos(), &inbuf, &err);
        TALLOC_FREE(subreq);
        if (received == -1) {
-               if (cli->fd != -1) {
-                       close(cli->fd);
-                       cli->fd = -1;
-               }
+               cli_state_disconnect(cli);
                status = map_nt_error_from_unix(err);
                goto fail;
        }
@@ -620,8 +614,7 @@ static void cli_smb_received(struct tevent_req *subreq)
                DEBUG(10, ("cli_check_sign_mac failed\n"));
                TALLOC_FREE(inbuf);
                status = NT_STATUS_ACCESS_DENIED;
-               close(cli->fd);
-               cli->fd = -1;
+               cli_state_disconnect(cli);
                goto fail;
        }
 
@@ -656,7 +649,7 @@ static void cli_smb_received(struct tevent_req *subreq)
                 */
                state = tevent_req_data(cli->conn.pending[0],
                                        struct cli_smb_state);
-               subreq = read_smb_send(cli->conn.pending, state->ev, cli->fd);
+               subreq = read_smb_send(cli->conn.pending, state->ev, 
cli->conn.fd);
                if (subreq == NULL) {
                        status = NT_STATUS_NO_MEMORY;
                        goto fail;
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 6a7931b..4f703b3 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1850,6 +1850,7 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state 
*cli, const char *user,
 
        if (cli->got_kerberos_mechanism && cli->use_kerberos) {
                ADS_STATUS rc;
+               const char *remote_name = cli_state_remote_name(cli);
 
                if (pass && *pass) {
                        int ret;
@@ -1873,15 +1874,15 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state 
*cli, const char *user,
                }
 
                if (principal == NULL &&
-                       !is_ipaddress(cli->desthost) &&
+                       !is_ipaddress(remote_name) &&
                        !strequal(STAR_SMBSERVER,
-                               cli->desthost)) {
+                                 remote_name)) {
                        char *realm = NULL;
                        char *host = NULL;
                        DEBUG(3,("cli_session_setup_spnego: using target "
                                 "hostname not SPNEGO principal\n"));
 
-                       host = strchr_m(cli->desthost, '.');
+                       host = strchr_m(remote_name, '.');
                        if (dest_realm) {
                                realm = SMB_STRDUP(dest_realm);
                                if (!realm) {
@@ -1891,7 +1892,7 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state 
*cli, const char *user,
                        } else {
                                if (host) {
                                        /* DNS name. */
-                                       realm = 
kerberos_get_realm_from_hostname(cli->desthost);
+                                       realm = 
kerberos_get_realm_from_hostname(remote_name);
                                } else {
                                        /* NetBIOS name - use our realm. */
                                        realm = 
kerberos_get_default_realm_from_ccache();
@@ -1909,13 +1910,13 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state 
*cli, const char *user,
                                        "desthost %s. Using default "
                                        "smb.conf realm %s\n",
                                        dest_realm ? dest_realm : "<null>",
-                                       cli->desthost,
+                                       remote_name,
                                        realm));
                        }
 
                        principal = talloc_asprintf(talloc_tos(),
                                                    "cifs/%s@%s",
-                                                   cli->desthost,
+                                                   remote_name,
                                                    realm);
                        if (!principal) {
                                SAFE_FREE(realm);
@@ -2277,7 +2278,7 @@ struct tevent_req *cli_tcon_andx_create(TALLOC_CTX 
*mem_ctx,
         * Add the sharename
         */
        tmp = talloc_asprintf_strupper_m(talloc_tos(), "\\\\%s\\%s",
-                                        cli->desthost, share);
+                                        cli_state_remote_name(cli), share);
        if (tmp == NULL) {
                TALLOC_FREE(req);
                return NULL;
@@ -2839,7 +2840,7 @@ fail:
        return status;
 }
 
-NTSTATUS cli_connect_nb(const char *host, struct sockaddr_storage *pss,
+NTSTATUS cli_connect_nb(const char *host, const struct sockaddr_storage 
*dest_ss,
                        uint16_t port, int name_type, const char *myname,
                        int signing_state, struct cli_state **pcli)
 {
@@ -2864,8 +2865,8 @@ NTSTATUS cli_connect_nb(const char *host, struct 
sockaddr_storage *pss,
                }
        }
 
-       status = cli_connect_sock(host, name_type, pss, myname, port, 20, &fd,
-                                 &port);
+       status = cli_connect_sock(host, name_type, dest_ss, myname, port,
+                                 20, &fd, &port);
        if (!NT_STATUS_IS_OK(status)) {
                goto fail;
        }
@@ -2875,10 +2876,6 @@ NTSTATUS cli_connect_nb(const char *host, struct 
sockaddr_storage *pss,
                goto fail;
        }
 
-       if (pss != NULL) {
-               *pss = cli->dest_ss;
-       }
-
        *pcli = cli;
        status = NT_STATUS_OK;
 fail:
@@ -2896,7 +2893,7 @@ fail:
 NTSTATUS cli_start_connection(struct cli_state **output_cli, 
                              const char *my_name, 
                              const char *dest_host, 
-                             struct sockaddr_storage *dest_ss, int port,
+                             const struct sockaddr_storage *dest_ss, int port,
                              int signing_state, int flags)
 {
        NTSTATUS nt_status;
@@ -2951,7 +2948,7 @@ NTSTATUS cli_start_connection(struct cli_state 
**output_cli,
 NTSTATUS cli_full_connection(struct cli_state **output_cli, 
                             const char *my_name, 
                             const char *dest_host, 
-                            struct sockaddr_storage *dest_ss, int port,
+                            const struct sockaddr_storage *dest_ss, int port,
                             const char *service, const char *service_type,
                             const char *user, const char *domain, 
                             const char *password, int flags,
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index d677f9e..97458e5 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -322,7 +322,10 @@ static struct cli_state *cli_cm_find(struct cli_state *cli,
 
        /* Search to the start of the list. */
        for (p = cli; p; p = DLIST_PREV(p)) {
-               if (strequal(server, p->desthost) &&
+               const char *remote_name =
+                       cli_state_remote_name(p);
+
+               if (strequal(server, remote_name) &&
                                strequal(share,p->share)) {
                        return p;
                }
@@ -330,7 +333,10 @@ static struct cli_state *cli_cm_find(struct cli_state *cli,
 
        /* Search to the end of the list. */
        for (p = cli->next; p; p = p->next) {
-               if (strequal(server, p->desthost) &&
+               const char *remote_name =
+                       cli_state_remote_name(p);
+
+               if (strequal(server, remote_name) &&
                                strequal(share,p->share)) {
                        return p;
                }
@@ -394,13 +400,13 @@ NTSTATUS cli_cm_open(TALLOC_CTX *ctx,
 /****************************************************************************
 ****************************************************************************/
 
-void cli_cm_display(const struct cli_state *cli)
+void cli_cm_display(struct cli_state *cli)
 {
        int i;
 
        for (i=0; cli; cli = cli->next,i++ ) {
                d_printf("%d:\tserver=%s, share=%s\n",
-                       i, cli->desthost, cli->share );
+                       i, cli_state_remote_name(cli), cli->share);
        }
 }
 
@@ -567,7 +573,7 @@ static char *cli_dfs_make_full_path(TALLOC_CTX *ctx,
        }
        return talloc_asprintf(ctx, "%c%s%c%s%c%s",
                        path_sep,
-                       cli->desthost,
+                       cli_state_remote_name(cli),
                        path_sep,
                        cli->share,
                        path_sep,
@@ -847,7 +853,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
 
        status = cli_cm_open(ctx,
                             rootcli,
-                            rootcli->desthost,
+                            cli_state_remote_name(rootcli),
                             "IPC$",
                             dfs_auth_info,
                             false,
@@ -1026,6 +1032,7 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
        uint16 cnum;
        char *newextrapath = NULL;
        NTSTATUS status;
+       const char *remote_name = cli_state_remote_name(cli);
 
        if (!cli || !sharename) {
                return false;
@@ -1041,7 +1048,7 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
 
        /* send a trans2_query_path_info to check for a referral */
 
-       fullpath = talloc_asprintf(ctx, "\\%s\\%s", cli->desthost, sharename );
+       fullpath = talloc_asprintf(ctx, "\\%s\\%s", remote_name, sharename);
        if (!fullpath) {
                return false;
        }
@@ -1089,7 +1096,7 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
 
        /* check that this is not a self-referral */
 
-       if (strequal(cli->desthost, *pp_newserver) &&
+       if (strequal(remote_name, *pp_newserver) &&
                        strequal(sharename, *pp_newshare)) {
                return false;
        }
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index c394197..559be92 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -163,7 +163,7 @@ NTSTATUS cli_init_creds(struct cli_state *cli, const char 
*username, const char
 
 struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
                                   int fd,
-                                  const char *desthost,
+                                  const char *remote_name,
                                   int signing_state)
 {
        struct cli_state *cli = NULL;
@@ -187,7 +187,6 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,
        if (!cli->dfs_mountpoint) {
                goto error;
        }
-       cli->fd = -1;
        cli->raw_status = NT_STATUS_INTERNAL_ERROR;
        cli->protocol = PROTOCOL_NT1;
        cli->timeout = 20000; /* Timeout is in milliseconds. */
@@ -239,23 +238,23 @@ struct cli_state *cli_state_create(TALLOC_CTX *mem_ctx,


-- 
Samba Shared Repository

Reply via email to