s3-rpc_client: add dcerpc_transport_t to cli_rpc_pipe_open_spnego_ntlmssp and cli_rpc...
authorGünther Deschner <gd@samba.org>
Thu, 10 Sep 2009 20:23:21 +0000 (22:23 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 11 Sep 2009 07:59:04 +0000 (09:59 +0200)
Guenther

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

index ddb8dddbedf52dc1fbf38c1c29efc4eaeb48c787..297d3fb05d5db835c6535eff4ba2a01ec58f7496 100644 (file)
@@ -5317,6 +5317,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,
@@ -5324,6 +5325,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 c83247a3c53a79bcb479dabcec4a5a1091a4fa6d..ab951618fe698d315789847c15df10d68db40ada 100644 (file)
@@ -176,6 +176,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,
                                                   domain, user,
                                                   old_passwd,
index 7aaee413f9339fd0ded150a4f46ebf1e9cdb9f27..fbf5c9a7812d43fc22a339e39653c87e97b7cf80 100644 (file)
@@ -3700,6 +3700,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,
@@ -3711,7 +3712,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;
        }
@@ -3753,6 +3754,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,
@@ -3761,6 +3763,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,
@@ -3776,6 +3779,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,
@@ -3784,6 +3788,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,
@@ -3952,7 +3957,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 348965299276057441ba3034946a3f94878c6661..60fda23a1997137b08beae8c79ea4d2bce698820 100644 (file)
@@ -650,6 +650,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,
+                                       default_transport,
                                        pipe_default_auth_level,
                                        lp_workgroup(),
                                        get_cmdline_auth_info_username(auth_info),
@@ -659,6 +660,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
                        case PIPE_AUTH_TYPE_NTLMSSP:
                                ntresult = cli_rpc_pipe_open_ntlmssp(
                                        cli, cmd_entry->interface,
+                                       default_transport,
                                        pipe_default_auth_level,
                                        lp_workgroup(),
                                        get_cmdline_auth_info_username(auth_info),
index c12c45e10ffe4ea9ac8470a84e1a3708e46d2af1..765b61bd564d118fa4d0e7bc34c139ff241fdac3 100644 (file)
@@ -170,6 +170,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 73f8b0b979de5ae81ea95a7bc991fcbabe8c547d..1513cf561ffc0774bdeaf5a388ad5f3d76c7ea27 100644 (file)
@@ -170,6 +170,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 d7a5bc15c386b6166b4a0b9441f4d6f0f8012f4a..89568eef94d2e565140ecb08a8ccd4b24b036bab 100644 (file)
@@ -502,7 +502,7 @@ int rpc_vampire_keytab(struct net_context *c, int argc, const char **argv)
                return -1;
        } 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);
                if (ret != 0 && dc_info.is_mixed_mode) {
                        printf(_("Fallback to NT4 vampire on Mixed-Mode AD "
index 50742c171537f245bd5bd5a1c8375443270c816e..fd35e20b654f98dda344a1e5ecc615a2cb54d7dd 100644 (file)
@@ -2055,6 +2055,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,
@@ -2193,7 +2194,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->cli->password,
                 &conn->lsa_pipe);