The branch, v3-3-test has been updated
       via  c6d4855... s3:winbindd_cm: don't invalidate the whole connection 
when just samr gave ACCCESS_DENIED
       via  855ac93... s3:rpc_server: we need to make a copy of my_name in 
serverinfo_to_SamInfo3()
       via  3ca4a7b... s3-rpc_client: fix rpccli_set_timeout to cope with 
abstract transport.
       via  b50ae28... s3:winbind: Fix an uninitialized variable (cherry picked 
from commit 0724649a8a7c04d015317d9dc2ae43ee87c1bd25)
       via  acc5e60... s3-winbindd: Fix Bug #6711: trusts to windows 2008 (2008 
r2) not working.
       via  7e4e12f... s3-winbindd: add cm_connect_lsa_tcp().
       via  bd2e674... s3-rpc_client: fix non initialized structure in 
rpccli_lsa_lookup_sids_noalloc.
       via  18ba75b... s3-rpc_client: add rpccli_lsa_lookup_sids3 wrapper.
       via  0d4d3c8... s3-rpc_client: add rpccli_lsa_lookup_names4 wrapper.
       via  afbe7c3... s3-winbindd: add and use winbindd_lookup_names().
       via  5c2c17f... s3-winbindd: add and use winbindd_lookup_sids().
       via  864c0b5... s3-rpc_client: add dcerpc_transport_t to 
cli_rpc_pipe_open_schannel().
       via  41158d1... s3-rpc_client: add dcerpc_transport_t to 
cli_rpc_pipe_open_spnego_ntlmssp and cli_rpc_pipe_open_ntlmssp.
       via  c968714... s3-rpc_client: add cli_rpc_pipe_open_noauth_transport.
      from  f31c221... WHATSNEW: Prepare release notes for Samba 3.3.9.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit c6d485583aba69b38b2972224e27edb60c3bf09a
Author: Stefan Metzmacher <[email protected]>
Date:   Thu Sep 24 21:35:38 2009 +0200

    s3:winbindd_cm: don't invalidate the whole connection when just samr gave 
ACCCESS_DENIED
    
    metze

commit 855ac932cf86272aaf02bf68e1fbf0e0a2902982
Author: Günther Deschner <[email protected]>
Date:   Wed Oct 7 14:34:05 2009 +0200

    s3:rpc_server: we need to make a copy of my_name in serverinfo_to_SamInfo3()
    
    This is important for the case the server_info already contains a 
logon_server.
    
    metze

commit 3ca4a7bb33c56aa813247d0ea51863d7ded2e5de
Author: Günther Deschner <[email protected]>
Date:   Tue Oct 6 11:10:47 2009 +0200

    s3-rpc_client: fix rpccli_set_timeout to cope with abstract transport.
    
    taken from: b7094c0b804984de8e0b50c17e7908a2685df557
    
    Guenther

commit b50ae28be07b93eef04e6e4b9eeb9fc440e21bd4
Author: Volker Lendecke <[email protected]>
Date:   Wed Sep 23 06:23:50 2009 +0200

    s3:winbind: Fix an uninitialized variable (cherry picked from commit 
0724649a8a7c04d015317d9dc2ae43ee87c1bd25)

commit acc5e6012adca290ddc067a4ed25a8161b74250e
Author: Günther Deschner <[email protected]>
Date:   Thu Sep 17 09:43:36 2009 +0200

    s3-winbindd: Fix Bug #6711: trusts to windows 2008 (2008 r2) not working.
    
    Winbindd should always try to use LSA via an schannel authenticated 
ncacn_ip_tcp
    connection when talking to AD for LSA lookup calls.
    
    In Samba <-> W2k8 interdomain trust scenarios, LookupSids3 and LookupNames4 
via an
    schannel ncacn_ip_tcp LSA connection are the *only* options to successfully 
resolve
    sids and names.
    
    Guenther
    (cherry picked from commit 6a8ef6c424c52be861ed2a9806f917a64ec892a6)

commit 7e4e12f120c666f31af042ab59fd9478017740ea
Author: Günther Deschner <[email protected]>
Date:   Sat Sep 12 23:30:39 2009 +0200

    s3-winbindd: add cm_connect_lsa_tcp().
    
    Guenther
    (cherry picked from commit 58f2deb94024f002e3c3df47f45454edc97f47e1)

commit bd2e674cc3ab0fb6f1d988b0b19b6ad5544512b3
Author: Günther Deschner <[email protected]>
Date:   Thu Sep 17 09:42:49 2009 +0200

    s3-rpc_client: fix non initialized structure in 
rpccli_lsa_lookup_sids_noalloc.
    
    Guenther
    (cherry picked from commit a4b5c792c55ef90648a528d279beec32f86a9b22)

commit 18ba75b763a2fec8f7b05af0444212990753fe1b
Author: Günther Deschner <[email protected]>
Date:   Sun Sep 13 00:28:49 2009 +0200

    s3-rpc_client: add rpccli_lsa_lookup_sids3 wrapper.
    
    Guenther
    (cherry picked from commit 2f9adf04e4b3e16c046cb371a428a8a70d5de041)

commit 0d4d3c8e1e5312a820fcaede65471566e75e272c
Author: Günther Deschner <[email protected]>
Date:   Fri Sep 11 19:35:14 2009 +0200

    s3-rpc_client: add rpccli_lsa_lookup_names4 wrapper.
    
    Guenther
    (cherry picked from commit ff968712bab6c2635ef74723c6f52b0fdac4b424)

commit afbe7c3605edcb8f7dfc64399681f23fa947fe57
Author: Günther Deschner <[email protected]>
Date:   Thu Sep 17 08:06:34 2009 +0200

    s3-winbindd: add and use winbindd_lookup_names().
    
    Guenther
    (cherry picked from commit 99c3fc19587431efda1ae6161453d84673b32071)

commit 5c2c17ffd62010f4590502f40aee9e40997a647a
Author: Günther Deschner <[email protected]>
Date:   Thu Sep 17 07:59:25 2009 +0200

    s3-winbindd: add and use winbindd_lookup_sids().
    
    Guenther
    (cherry picked from commit f0b52b8c3133e3696db361d9d0e7d1fff0fab991)

commit 864c0b58aec55e37cf304b28c762a5259fc0ec67
Author: Günther Deschner <[email protected]>
Date:   Thu Sep 10 22:23:21 2009 +0200

    s3-rpc_client: add dcerpc_transport_t to cli_rpc_pipe_open_schannel().
    
    Guenther
    (cherry picked from commit bea8e5fa6038d5abd2ec1e12f9005c4a04abb79f)

commit 41158d10cdad5b923d0bfa608f73c0daf8ccd352
Author: Günther Deschner <[email protected]>
Date:   Mon Oct 5 17:41:06 2009 +0200

    s3-rpc_client: add dcerpc_transport_t to cli_rpc_pipe_open_spnego_ntlmssp 
and cli_rpc_pipe_open_ntlmssp.
    
    Guenther

commit c968714f7910ba90c2e989e46d18c265d9f9b549
Author: Günther Deschner <[email protected]>
Date:   Tue Nov 4 18:40:24 2008 +0100

    s3-rpc_client: add cli_rpc_pipe_open_noauth_transport.
    
    Guenther
    (cherry picked from commit 87f61a144b8d25c90b847940ca03ced1f77b036c)

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

Summary of changes:
 source/auth/auth_domain.c         |    2 +-
 source/include/proto.h            |   26 +++++
 source/libnet/libnet_join.c       |    3 +-
 source/libsmb/passchange.c        |    1 +
 source/rpc_client/cli_lsarpc.c    |  191 ++++++++++++++++++++++++++-------
 source/rpc_client/cli_pipe.c      |   65 ++++++++----
 source/rpc_client/init_netlogon.c |    2 +-
 source/rpcclient/rpcclient.c      |    3 +
 source/utils/net.h                |    1 +
 source/utils/net_rpc.c            |    4 +-
 source/utils/net_rpc_join.c       |    5 +-
 source/utils/net_rpc_samsync.c    |    2 +-
 source/winbindd/winbindd.h        |    3 +
 source/winbindd/winbindd_ads.c    |   64 +++---------
 source/winbindd/winbindd_cm.c     |   84 ++++++++++++++-
 source/winbindd/winbindd_proto.h  |   19 ++++
 source/winbindd/winbindd_rpc.c    |  215 +++++++++++++++++++++++++-----------
 17 files changed, 502 insertions(+), 188 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/auth/auth_domain.c b/source/auth/auth_domain.c
index f11dbe6..45150ab 100644
--- a/source/auth/auth_domain.c
+++ b/source/auth/auth_domain.c
@@ -175,7 +175,7 @@ static NTSTATUS connect_to_domain_password_server(struct 
cli_state **cli,
        if (lp_client_schannel()) {
                /* We also setup the creds chain in the open_schannel call. */
                result = cli_rpc_pipe_open_schannel(
-                       *cli, &ndr_table_netlogon.syntax_id,
+                       *cli, &ndr_table_netlogon.syntax_id, NCACN_NP,
                        PIPE_AUTH_LEVEL_PRIVACY, domain, &netlogon_pipe);
        } else {
                result = cli_rpc_pipe_open_noauth(
diff --git a/source/include/proto.h b/source/include/proto.h
index ec8637b..8dbab9a 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -6891,6 +6891,14 @@ NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client 
*cli,
                                char ***pdomains,
                                char ***pnames,
                                enum lsa_SidType **ptypes);
+NTSTATUS rpccli_lsa_lookup_sids3(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct policy_handle *pol,
+                                int num_sids,
+                                const DOM_SID *sids,
+                                char ***pdomains,
+                                char ***pnames,
+                                enum lsa_SidType **ptypes);
 NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
                                 POLICY_HND *pol, int num_names,
@@ -6899,6 +6907,15 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client 
*cli,
                                 int level,
                                 DOM_SID **sids,
                                 enum lsa_SidType **types);
+NTSTATUS rpccli_lsa_lookup_names4(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct policy_handle *pol, int num_names,
+                                 const char **names,
+                                 const char ***dom_names,
+                                 int level,
+                                 DOM_SID **sids,
+                                 enum lsa_SidType **types);
+
 bool fetch_domain_sid( char *domain, char *remote_machine, DOM_SID *psid);
 
 /* The following definitions come from rpc_client/cli_netlogon.c  */
@@ -6988,8 +7005,13 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, 
const char *socket_path,
 NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
                                  const struct ndr_syntax_id *interface,
                                  struct rpc_pipe_client **presult);
+NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli,
+                                           enum dcerpc_transport_t transport,
+                                           const struct ndr_syntax_id 
*interface,
+                                           struct rpc_pipe_client **presult);
 NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
                                   const struct ndr_syntax_id *interface,
+                                  enum dcerpc_transport_t transport,
                                   enum pipe_auth_level auth_level,
                                   const char *domain,
                                   const char *username,
@@ -6997,6 +7019,7 @@ NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
                                   struct rpc_pipe_client **presult);
 NTSTATUS cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
                                          const struct ndr_syntax_id *interface,
+                                         enum dcerpc_transport_t transport,
                                          enum pipe_auth_level auth_level,
                                          const char *domain,
                                          const char *username,
@@ -7008,12 +7031,14 @@ NTSTATUS get_schannel_session_key(struct cli_state *cli,
                                  struct rpc_pipe_client **presult);
 NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
                                             const struct ndr_syntax_id 
*interface,
+                                            enum dcerpc_transport_t transport,
                                             enum pipe_auth_level auth_level,
                                             const char *domain,
                                             const struct dcinfo *pdc,
                                             struct rpc_pipe_client **presult);
 NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
                                                 const struct ndr_syntax_id 
*interface,
+                                                enum dcerpc_transport_t 
transport,
                                                 enum pipe_auth_level 
auth_level,
                                                 const char *domain,
                                                 const char *username,
@@ -7021,6 +7046,7 @@ NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct 
cli_state *cli,
                                                 struct rpc_pipe_client 
**presult);
 NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
                                    const struct ndr_syntax_id *interface,
+                                   enum dcerpc_transport_t transport,
                                    enum pipe_auth_level auth_level,
                                    const char *domain,
                                    struct rpc_pipe_client **presult);
diff --git a/source/libnet/libnet_join.c b/source/libnet/libnet_join.c
index 9029d61..915c66b 100644
--- a/source/libnet/libnet_join.c
+++ b/source/libnet/libnet_join.c
@@ -1070,7 +1070,8 @@ NTSTATUS libnet_join_ok(const char *netbios_domain_name,
        }
 
        status = cli_rpc_pipe_open_schannel_with_key(
-               cli, &ndr_table_netlogon.syntax_id, PIPE_AUTH_LEVEL_PRIVACY,
+               cli, &ndr_table_netlogon.syntax_id, NCACN_NP,
+               PIPE_AUTH_LEVEL_PRIVACY,
                netbios_domain_name, netlogon_pipe->dc, &pipe_hnd);
 
        cli_shutdown(cli);
diff --git a/source/libsmb/passchange.c b/source/libsmb/passchange.c
index 299d98d..e202d19 100644
--- a/source/libsmb/passchange.c
+++ b/source/libsmb/passchange.c
@@ -152,6 +152,7 @@ NTSTATUS remote_password_change(const char *remote_machine, 
const char *user_nam
        if (!pass_must_change) {
                result = cli_rpc_pipe_open_ntlmssp(cli,
                                                   &ndr_table_samr.syntax_id,
+                                                  NCACN_NP,
                                                   PIPE_AUTH_LEVEL_PRIVACY,
                                                   "", /* what domain... ? */
                                                   user_name,
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c
index 577df64..b2ae167 100644
--- a/source/rpc_client/cli_lsarpc.c
+++ b/source/rpc_client/cli_lsarpc.c
@@ -126,7 +126,8 @@ static NTSTATUS rpccli_lsa_lookup_sids_noalloc(struct 
rpc_pipe_client *cli,
                                               const DOM_SID *sids,
                                               char **domains,
                                               char **names,
-                                              enum lsa_SidType *types)
+                                              enum lsa_SidType *types,
+                                              bool use_lookupsids3)
 {
        NTSTATUS result = NT_STATUS_OK;
        TALLOC_CTX *tmp_ctx = NULL;
@@ -159,13 +160,43 @@ static NTSTATUS rpccli_lsa_lookup_sids_noalloc(struct 
rpc_pipe_client *cli,
                }
        }
 
-       result = rpccli_lsa_LookupSids(cli, mem_ctx,
-                                      pol,
-                                      &sid_array,
-                                      &ref_domains,
-                                      &lsa_names,
-                                      level,
-                                      &count);
+       if (use_lookupsids3) {
+               struct lsa_TransNameArray2 lsa_names2;
+               uint32_t n;
+
+               ZERO_STRUCT(lsa_names2);
+
+               result = rpccli_lsa_LookupSids3(cli, mem_ctx,
+                                               &sid_array,
+                                               &ref_domains,
+                                               &lsa_names2,
+                                               level,
+                                               &count,
+                                               0,
+                                               0);
+
+               if (!NT_STATUS_IS_ERR(result)) {
+                       lsa_names.count = lsa_names2.count;
+                       lsa_names.names = talloc_array(mem_ctx, struct 
lsa_TranslatedName, lsa_names.count);
+                       if (!lsa_names.names) {
+                               return NT_STATUS_NO_MEMORY;
+                       }
+                       for (n=0; n < lsa_names.count; n++) {
+                               lsa_names.names[n].sid_type     = 
lsa_names2.names[n].sid_type;
+                               lsa_names.names[n].name         = 
lsa_names2.names[n].name;
+                               lsa_names.names[n].sid_index    = 
lsa_names2.names[n].sid_index;
+                       }
+               }
+
+       } else {
+               result = rpccli_lsa_LookupSids(cli, mem_ctx,
+                                              pol,
+                                              &sid_array,
+                                              &ref_domains,
+                                              &lsa_names,
+                                              level,
+                                              &count);
+       }
 
        DEBUG(10, ("LSA_LOOKUPSIDS returned '%s', mapped count = %d'\n",
                   nt_errstr(result), count));
@@ -245,14 +276,15 @@ done:
  * at 20480 for win2k3, but we keep it at a save 1000 for now. */
 #define LOOKUP_SIDS_HUNK_SIZE 1000
 
-NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli,
-                               TALLOC_CTX *mem_ctx,
-                               POLICY_HND *pol,
-                               int num_sids,
-                               const DOM_SID *sids,
-                               char ***pdomains,
-                               char ***pnames,
-                               enum lsa_SidType **ptypes)
+static NTSTATUS rpccli_lsa_lookup_sids_generic(struct rpc_pipe_client *cli,
+                                              TALLOC_CTX *mem_ctx,
+                                              struct policy_handle *pol,
+                                              int num_sids,
+                                              const DOM_SID *sids,
+                                              char ***pdomains,
+                                              char ***pnames,
+                                              enum lsa_SidType **ptypes,
+                                              bool use_lookupsids3)
 {
        NTSTATUS result = NT_STATUS_OK;
        int sids_left = 0;
@@ -311,7 +343,8 @@ NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli,
                                                             hunk_sids,
                                                             hunk_domains,
                                                             hunk_names,
-                                                            hunk_types);
+                                                            hunk_types,
+                                                            use_lookupsids3);
 
                if (!NT_STATUS_IS_OK(hunk_result) &&
                    !NT_STATUS_EQUAL(hunk_result, STATUS_SOME_UNMAPPED) &&
@@ -352,25 +385,54 @@ fail:
        return result;
 }
 
-/** Lookup a list of names */
+NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli,
+                               TALLOC_CTX *mem_ctx,
+                               struct policy_handle *pol,
+                               int num_sids,
+                               const DOM_SID *sids,
+                               char ***pdomains,
+                               char ***pnames,
+                               enum lsa_SidType **ptypes)
+{
+       return rpccli_lsa_lookup_sids_generic(cli, mem_ctx, pol, num_sids, sids,
+                                             pdomains, pnames, ptypes, false);
+}
 
-NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
+NTSTATUS rpccli_lsa_lookup_sids3(struct rpc_pipe_client *cli,
                                 TALLOC_CTX *mem_ctx,
-                                POLICY_HND *pol, int num_names,
-                                const char **names,
-                                const char ***dom_names,
-                                int level,
-                                DOM_SID **sids,
-                                enum lsa_SidType **types)
+                                struct policy_handle *pol,
+                                int num_sids,
+                                const DOM_SID *sids,
+                                char ***pdomains,
+                                char ***pnames,
+                                enum lsa_SidType **ptypes)
+{
+       return rpccli_lsa_lookup_sids_generic(cli, mem_ctx, pol, num_sids, sids,
+                                             pdomains, pnames, ptypes, true);
+}
+
+/** Lookup a list of names */
+
+static NTSTATUS rpccli_lsa_lookup_names_generic(struct rpc_pipe_client *cli,
+                                               TALLOC_CTX *mem_ctx,
+                                               struct policy_handle *pol, int 
num_names,
+                                               const char **names,
+                                               const char ***dom_names,
+                                               int level,
+                                               DOM_SID **sids,
+                                               enum lsa_SidType **types,
+                                               bool use_lookupnames4)
 {
        NTSTATUS result;
        int i;
        struct lsa_String *lsa_names = NULL;
        struct lsa_RefDomainList *domains = NULL;
        struct lsa_TransSidArray sid_array;
+       struct lsa_TransSidArray3 sid_array3;
        uint32_t count = 0;
 
        ZERO_STRUCT(sid_array);
+       ZERO_STRUCT(sid_array3);
 
        lsa_names = TALLOC_ARRAY(mem_ctx, struct lsa_String, num_names);
        if (!lsa_names) {
@@ -381,14 +443,26 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client 
*cli,
                init_lsa_String(&lsa_names[i], names[i]);
        }
 
-       result = rpccli_lsa_LookupNames(cli, mem_ctx,
-                                       pol,
-                                       num_names,
-                                       lsa_names,
-                                       &domains,
-                                       &sid_array,
-                                       level,
-                                       &count);
+       if (use_lookupnames4) {
+               result = rpccli_lsa_LookupNames4(cli, mem_ctx,
+                                                num_names,
+                                                lsa_names,
+                                                &domains,
+                                                &sid_array3,
+                                                level,
+                                                &count,
+                                                0,
+                                                0);
+       } else {
+               result = rpccli_lsa_LookupNames(cli, mem_ctx,
+                                               pol,
+                                               num_names,
+                                               lsa_names,
+                                               &domains,
+                                               &sid_array,
+                                               level,
+                                               &count);
+       }
 
        if (!NT_STATUS_IS_OK(result) && NT_STATUS_V(result) !=
            NT_STATUS_V(STATUS_SOME_UNMAPPED)) {
@@ -435,10 +509,17 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client 
*cli,
        }
 
        for (i = 0; i < num_names; i++) {
-               uint32_t dom_idx = sid_array.sids[i].sid_index;
-               uint32_t dom_rid = sid_array.sids[i].rid;
+               uint32_t dom_idx;
                DOM_SID *sid = &(*sids)[i];
 
+               if (use_lookupnames4) {
+                       dom_idx         = sid_array3.sids[i].sid_index;
+                       (*types)[i]     = sid_array3.sids[i].sid_type;
+               } else {
+                       dom_idx         = sid_array.sids[i].sid_index;
+                       (*types)[i]     = sid_array.sids[i].sid_type;
+               }
+
                /* Translate optimised sid through domain index array */
 
                if (dom_idx == 0xffffffff) {
@@ -448,14 +529,16 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client 
*cli,
                        continue;
                }
 
-               sid_copy(sid, domains->domains[dom_idx].sid);
+               if (use_lookupnames4) {
+                       sid_copy(sid, sid_array3.sids[i].sid);
+               } else {
+                       sid_copy(sid, domains->domains[dom_idx].sid);
 
-               if (dom_rid != 0xffffffff) {
-                       sid_append_rid(sid, dom_rid);
+                       if (sid_array.sids[i].rid != 0xffffffff) {
+                               sid_append_rid(sid, sid_array.sids[i].rid);
+                       }
                }
 
-               (*types)[i] = sid_array.sids[i].sid_type;
-
                if (dom_names == NULL) {
                        continue;
                }
@@ -467,3 +550,31 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client 
*cli,
 
        return result;
 }
+
+NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
+                                TALLOC_CTX *mem_ctx,
+                                struct policy_handle *pol, int num_names,
+                                const char **names,
+                                const char ***dom_names,
+                                int level,
+                                DOM_SID **sids,
+                                enum lsa_SidType **types)
+{
+       return rpccli_lsa_lookup_names_generic(cli, mem_ctx, pol, num_names,
+                                              names, dom_names, level, sids,
+                                              types, false);
+}
+
+NTSTATUS rpccli_lsa_lookup_names4(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 struct policy_handle *pol, int num_names,
+                                 const char **names,
+                                 const char ***dom_names,
+                                 int level,
+                                 DOM_SID **sids,
+                                 enum lsa_SidType **types)
+{
+       return rpccli_lsa_lookup_names_generic(cli, mem_ctx, pol, num_names,
+                                              names, dom_names, level, sids,
+                                              types, true);
+}
diff --git a/source/rpc_client/cli_pipe.c b/source/rpc_client/cli_pipe.c
index 2e2767b..be84c39 100644
--- a/source/rpc_client/cli_pipe.c
+++ b/source/rpc_client/cli_pipe.c
@@ -2319,11 +2319,15 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
        prs_mem_free(&rbuf);
        return NT_STATUS_OK;
 }
-
-unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli,
+unsigned int rpccli_set_timeout(struct rpc_pipe_client *rpc_cli,
                                unsigned int timeout)
 {
-       return cli_set_timeout(cli->trans.np.cli, timeout);
+       struct cli_state *cli = rpc_pipe_np_smb_conn(rpc_cli);
+
+       if (cli == NULL) {
+               return 0;
+       }
+       return cli_set_timeout(cli, timeout);
 }
 
 bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16])
@@ -2931,34 +2935,35 @@ static NTSTATUS rpc_pipe_open_np(struct cli_state *cli,
  ****************************************************************************/
 
 static NTSTATUS cli_rpc_pipe_open(struct cli_state *cli,
+                                 enum dcerpc_transport_t transport,
                                  const struct ndr_syntax_id *interface,
                                  struct rpc_pipe_client **presult)
 {
-       if (ndr_syntax_id_equal(interface, &ndr_table_drsuapi.syntax_id)) {
-               /*
-                * We should have a better way to figure out this drsuapi
-                * speciality...
-                */
+       switch (transport) {
+       case NCACN_IP_TCP:
                return rpc_pipe_open_tcp(NULL, cli->desthost, interface,
                                         presult);
+       case NCACN_NP:
+               return rpc_pipe_open_np(cli, interface, presult);
+       default:
+               return NT_STATUS_NOT_IMPLEMENTED;
        }
-
-       return rpc_pipe_open_np(cli, interface, presult);
 }
 
 /****************************************************************************
  Open a named pipe to an SMB server and bind anonymously.
  ****************************************************************************/
 
-NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
-                                 const struct ndr_syntax_id *interface,
-                                 struct rpc_pipe_client **presult)
+NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli,
+                                           enum dcerpc_transport_t transport,
+                                           const struct ndr_syntax_id 
*interface,
+                                           struct rpc_pipe_client **presult)
 {
        struct rpc_pipe_client *result;
        struct cli_pipe_auth_data *auth;
        NTSTATUS status;
 
-       status = cli_rpc_pipe_open(cli, interface, &result);
+       status = cli_rpc_pipe_open(cli, transport, interface, &result);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
@@ -3015,11 +3020,23 @@ NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
 }
 
 /****************************************************************************
+ ****************************************************************************/
+
+NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
+                                 const struct ndr_syntax_id *interface,
+                                 struct rpc_pipe_client **presult)
+{
+       return cli_rpc_pipe_open_noauth_transport(cli, NCACN_NP,
+                                                 interface, presult);
+}
+
+/****************************************************************************
  Open a named pipe to an SMB server and bind using NTLMSSP or SPNEGO NTLMSSP
  ****************************************************************************/
 
 static NTSTATUS cli_rpc_pipe_open_ntlmssp_internal(struct cli_state *cli,
                                                   const struct ndr_syntax_id 
*interface,
+                                                  enum dcerpc_transport_t 
transport,
                                                   enum pipe_auth_type 
auth_type,
                                                   enum pipe_auth_level 
auth_level,
                                                   const char *domain,
@@ -3031,7 +3048,7 @@ static NTSTATUS cli_rpc_pipe_open_ntlmssp_internal(struct 
cli_state *cli,
        struct cli_pipe_auth_data *auth;
        NTSTATUS status;
 
-       status = cli_rpc_pipe_open(cli, interface, &result);
+       status = cli_rpc_pipe_open(cli, transport, interface, &result);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
@@ -3073,6 +3090,7 @@ static NTSTATUS cli_rpc_pipe_open_ntlmssp_internal(struct 
cli_state *cli,
 
 NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
                                   const struct ndr_syntax_id *interface,
+                                  enum dcerpc_transport_t transport,
                                   enum pipe_auth_level auth_level,
                                   const char *domain,


-- 
Samba Shared Repository

Reply via email to