]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3-rpc_client: add dcerpc_transport_t to cli_rpc_pipe_open_spnego_ntlmssp and cli_rpc...
authorGünther Deschner <gd@samba.org>
Mon, 5 Oct 2009 15:41:06 +0000 (17:41 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 8 Oct 2009 07:34:39 +0000 (09:34 +0200)
Guenther

source/include/proto.h
source/libsmb/passchange.c
source/rpc_client/cli_pipe.c
source/rpcclient/rpcclient.c
source/utils/net.h
source/utils/net_rpc.c
source/utils/net_rpc_samsync.c
source/winbindd/winbindd_cm.c

index 42fb7aa7c1a92627d466e8c2686e4a7d1fd15e12..b8a4edaa7d1053f000e6e906557c4ec2e346afdf 100644 (file)
@@ -6994,6 +6994,7 @@ NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli,
                                            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,
@@ -7001,6 +7002,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,
index 299d98d1d8891421c49959c6a9ae8e7e405d5758..e202d19db44568f1f277ba60f184092da49a224b 100644 (file)
@@ -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,
index 507ada3744a4cf2a5ac953103c55accd8423936c..04bb87f6ecdaccc71020d437b0330bd7f7ed76c3 100644 (file)
@@ -3032,6 +3032,7 @@ NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
 
 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,
@@ -3043,7 +3044,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, NCACN_NP, interface, &result);
+       status = cli_rpc_pipe_open(cli, transport, interface, &result);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
@@ -3085,6 +3086,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,
                                   const char *username,
@@ -3093,6 +3095,7 @@ NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
 {
        return cli_rpc_pipe_open_ntlmssp_internal(cli,
                                                interface,
+                                               transport,
                                                PIPE_AUTH_TYPE_NTLMSSP,
                                                auth_level,
                                                domain,
@@ -3108,6 +3111,7 @@ NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
 
 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,
@@ -3116,6 +3120,7 @@ NTSTATUS cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
 {
        return cli_rpc_pipe_open_ntlmssp_internal(cli,
                                                interface,
+                                               transport,
                                                PIPE_AUTH_TYPE_SPNEGO_NTLMSSP,
                                                auth_level,
                                                domain,
@@ -3282,7 +3287,8 @@ static NTSTATUS get_schannel_session_key_auth_ntlmssp(struct cli_state *cli,
        NTSTATUS status;
 
        status = cli_rpc_pipe_open_spnego_ntlmssp(
-               cli, &ndr_table_netlogon.syntax_id, PIPE_AUTH_LEVEL_PRIVACY,
+               cli, &ndr_table_netlogon.syntax_id, NCACN_NP,
+               PIPE_AUTH_LEVEL_PRIVACY,
                domain, username, password, &netlogon_pipe);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
index 421c681489ccbb52ed1ded3ce965617e1a34d2c1..0db9a7922431e7af95f1dd311391036f7ae1bddd 100644 (file)
@@ -587,6 +587,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
                        case PIPE_AUTH_TYPE_SPNEGO_NTLMSSP:
                                ntresult = cli_rpc_pipe_open_spnego_ntlmssp(
                                        cli, cmd_entry->interface,
+                                       NCACN_NP,
                                        pipe_default_auth_level,
                                        lp_workgroup(),
                                        get_cmdline_auth_info_username(),
@@ -596,6 +597,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
                        case PIPE_AUTH_TYPE_NTLMSSP:
                                ntresult = cli_rpc_pipe_open_ntlmssp(
                                        cli, cmd_entry->interface,
+                                       NCACN_NP,
                                        pipe_default_auth_level,
                                        lp_workgroup(),
                                        get_cmdline_auth_info_username(),
index d88f962d41e6d8b1c5e7d6d325695c149e455cd4..86e8b1ca15b89e675e3e3dcba383896434b00259 100644 (file)
@@ -157,6 +157,7 @@ enum netdom_domain_t { ND_TYPE_NT4, ND_TYPE_AD };
 #define NET_FLAGS_NO_PIPE                      0x00000020      /* don't open an RPC pipe */
 #define NET_FLAGS_SIGN                         0x00000040      /* sign RPC connection */
 #define NET_FLAGS_SEAL                         0x00000080      /* seal RPC connection */
+#define NET_FLAGS_TCP                          0x00000100      /* use ncacn_ip_tcp */
 
 /* net share operation modes */
 #define NET_MODE_SHARE_MIGRATE 1
index 74a610ea31bc2dd7ccfe6b2bd08e962604cf2189..220c825628106e49325acd1465b2363ba2c289ad 100644 (file)
@@ -169,6 +169,8 @@ int run_rpc_command(struct net_context *c,
                        if (conn_flags & NET_FLAGS_SEAL) {
                                nt_status = cli_rpc_pipe_open_ntlmssp(
                                        cli, interface,
+                                       (conn_flags & NET_FLAGS_TCP) ?
+                                       NCACN_IP_TCP : NCACN_NP,
                                        PIPE_AUTH_LEVEL_PRIVACY,
                                        lp_workgroup(), c->opt_user_name,
                                        c->opt_password, &pipe_hnd);
index 6b23db74cba7d95f7bd8a0e1b05f19f9a35ba1b3..e4013ce6e8599876702cbc049df1ea93ec41a64d 100644 (file)
@@ -502,7 +502,7 @@ int rpc_vampire_keytab(struct net_context *c, int argc, const char **argv)
                                      rpc_vampire_keytab_internals, argc, argv);
        } else {
                ret = run_rpc_command(c, cli, &ndr_table_drsuapi.syntax_id,
-                                     NET_FLAGS_SEAL,
+                                     NET_FLAGS_SEAL | NET_FLAGS_TCP,
                                      rpc_vampire_keytab_ds_internals, argc, argv);
        }
 
index 0c53112adb9bf3e6fadd8765c34ed9fbd11c5032..8bbe8611a713043415481c611b8c6929992da681 100644 (file)
@@ -2038,6 +2038,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
           authenticated SAMR pipe with sign & seal. */
        result = cli_rpc_pipe_open_spnego_ntlmssp(conn->cli,
                                                  &ndr_table_samr.syntax_id,
+                                                 NCACN_NP,
                                                  PIPE_AUTH_LEVEL_PRIVACY,
                                                  domain_name,
                                                  machine_account,
@@ -2178,7 +2179,7 @@ NTSTATUS cm_connect_lsa(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
        /* We have an authenticated connection. Use a NTLMSSP SPNEGO
         * authenticated LSA pipe with sign & seal. */
        result = cli_rpc_pipe_open_spnego_ntlmssp
-               (conn->cli, &ndr_table_lsarpc.syntax_id,
+               (conn->cli, &ndr_table_lsarpc.syntax_id, NCACN_NP,
                 PIPE_AUTH_LEVEL_PRIVACY,
                 conn->cli->domain, conn->cli->user_name, conn_pwd,
                 &conn->lsa_pipe);