30 files changed:
netlogon_pipe = cli_rpc_pipe_open_schannel(*cli, PI_NETLOGON,
PIPE_AUTH_LEVEL_PRIVACY, domain, &result);
} else {
netlogon_pipe = cli_rpc_pipe_open_schannel(*cli, PI_NETLOGON,
PIPE_AUTH_LEVEL_PRIVACY, domain, &result);
} else {
- netlogon_pipe = cli_rpc_pipe_open_noauth(*cli, PI_NETLOGON, &result);
+ result = cli_rpc_pipe_open_noauth(
+ *cli, &ndr_table_netlogon.syntax_id, &netlogon_pipe);
+ if (!NT_STATUS_IS_OK(result)) {
DEBUG(0,("connect_to_domain_password_server: unable to open the domain client session to \
machine %s. Error was : %s.\n", dc_name, nt_errstr(result)));
cli_shutdown(*cli);
DEBUG(0,("connect_to_domain_password_server: unable to open the domain client session to \
machine %s. Error was : %s.\n", dc_name, nt_errstr(result)));
cli_shutdown(*cli);
uint32_t total_entries = 0;
int i;
uint32_t total_entries = 0;
int i;
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SRVSVC, &status);
+ status = cli_rpc_pipe_open_noauth(cli, &ndr_table_srvsvc.syntax_id,
+ &pipe_hnd);
- if (pipe_hnd == NULL) {
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("Could not connect to srvsvc pipe: %s\n",
nt_errstr(status)));
TALLOC_FREE(frame);
DEBUG(10, ("Could not connect to srvsvc pipe: %s\n",
nt_errstr(status)));
TALLOC_FREE(frame);
NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
const struct ndr_syntax_id *abstract_syntax,
struct rpc_pipe_client **presult);
NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
const struct ndr_syntax_id *abstract_syntax,
struct rpc_pipe_client **presult);
-struct rpc_pipe_client *cli_rpc_pipe_open_noauth(struct cli_state *cli, int pipe_idx, NTSTATUS *perr);
+NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
+ const struct ndr_syntax_id *interface,
+ struct rpc_pipe_client **presult);
struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
int pipe_idx,
enum pipe_auth_level auth_level,
struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
int pipe_idx,
enum pipe_auth_level auth_level,
const char *cli_get_pipe_name(int pipe_idx);
int cli_get_pipe_idx(const RPC_IFACE *syntax);
const char *cli_get_pipe_name(int pipe_idx);
int cli_get_pipe_idx(const RPC_IFACE *syntax);
+const struct ndr_syntax_id *cli_get_iface(int pipe_idx);
void init_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags,
uint32 call_id, int data_len, int auth_len);
bool smb_io_rpc_hdr(const char *desc, RPC_HDR *rpc, prs_struct *ps, int depth);
void init_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags,
uint32 call_id, int data_len, int auth_len);
bool smb_io_rpc_hdr(const char *desc, RPC_HDR *rpc, prs_struct *ps, int depth);
/* RPC_IFACE */
typedef struct ndr_syntax_id RPC_IFACE;
/* RPC_IFACE */
typedef struct ndr_syntax_id RPC_IFACE;
+extern const struct ndr_syntax_id syntax_spoolss;
+
#define RPC_IFACE_LEN (UUID_SIZE + 4)
/* RPC_HDR - dce rpc header */
#define RPC_IFACE_LEN (UUID_SIZE + 4)
/* RPC_HDR - dce rpc header */
- p->pipe = cli_rpc_pipe_open_noauth(cli, pipe_idx, status);
- if (!p->pipe) {
+ *status = cli_rpc_pipe_open_noauth(cli, cli_get_iface(pipe_idx),
+ &p->pipe);
+ if (!NT_STATUS_IS_OK(*status)) {
TALLOC_FREE(p);
return NULL;
}
TALLOC_FREE(p);
return NULL;
}
- pipe_hnd = cli_rpc_pipe_open_noauth(*cli, PI_LSARPC, &status);
- if (!pipe_hnd) {
+ status = cli_rpc_pipe_open_noauth(*cli, &ndr_table_lsarpc.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Error connecting to LSA pipe. Error was %s\n",
nt_errstr(status)));
goto done;
DEBUG(0,("Error connecting to LSA pipe. Error was %s\n",
nt_errstr(status)));
goto done;
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &status);
- if (!pipe_hnd) {
+ status = cli_rpc_pipe_open_noauth(cli, &ndr_table_samr.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Error connecting to SAM pipe. Error was %s\n",
nt_errstr(status)));
goto done;
DEBUG(0,("Error connecting to SAM pipe. Error was %s\n",
nt_errstr(status)));
goto done;
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &status);
- if (!pipe_hnd) {
+ status = cli_rpc_pipe_open_noauth(cli, &ndr_table_samr.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Error connecting to SAM pipe. Error was %s\n",
nt_errstr(status)));
goto done;
DEBUG(0,("Error connecting to SAM pipe. Error was %s\n",
nt_errstr(status)));
goto done;
struct dcerpc_pipe *p = talloc(parent_ctx, struct dcerpc_pipe);
struct dcerpc_binding *binding;
NTSTATUS nt_status;
struct dcerpc_pipe *p = talloc(parent_ctx, struct dcerpc_pipe);
struct dcerpc_binding *binding;
NTSTATUS nt_status;
nt_status = dcerpc_parse_binding(p, binding_string, &binding);
nt_status = dcerpc_parse_binding(p, binding_string, &binding);
- idx = cli_get_pipe_idx(&table->syntax_id);
- if (idx < 0) {
- DEBUG(0, ("Unable to find interface index"));
- talloc_free(p);
- return NT_STATUS_OBJECT_PATH_INVALID;
- }
-
- p->rpc_cli = cli_rpc_pipe_open_noauth(p->cli, idx, &nt_status);
+ nt_status = cli_rpc_pipe_open_noauth(p->cli, &table->syntax_id,
+ &p->rpc_cli);
- if (p->rpc_cli == NULL) {
+ if (!NT_STATUS_IS_OK(nt_status)) {
talloc_free(p);
return nt_status;
}
talloc_free(p);
return nt_status;
}
uint32_t total_entries = 0;
/* Open the server service pipe */
uint32_t total_entries = 0;
/* Open the server service pipe */
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SRVSVC, &nt_status);
- if (!pipe_hnd) {
+ nt_status = cli_rpc_pipe_open_noauth(cli, &ndr_table_srvsvc.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(1, ("net_share_enum_rpc pipe open fail!\n"));
return -1;
}
DEBUG(1, ("net_share_enum_rpc pipe open fail!\n"));
return -1;
}
ZERO_STRUCTP(ipc_srv);
ipc_srv->cli = ipc_cli;
ZERO_STRUCTP(ipc_srv);
ipc_srv->cli = ipc_cli;
- pipe_hnd = cli_rpc_pipe_open_noauth(ipc_srv->cli,
- PI_LSARPC,
- &nt_status);
- if (!pipe_hnd) {
+ nt_status = cli_rpc_pipe_open_noauth(
+ ipc_srv->cli, &ndr_table_lsarpc.syntax_id, &pipe_hnd);
+ if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(1, ("cli_nt_session_open fail!\n"));
errno = ENOTSUP;
cli_shutdown(ipc_srv->cli);
DEBUG(1, ("cli_nt_session_open fail!\n"));
errno = ENOTSUP;
cli_shutdown(ipc_srv->cli);
* will just fail. So we do it anonymously, there's no other
* way.
*/
* will just fail. So we do it anonymously, there's no other
* way.
*/
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &result);
+ result = cli_rpc_pipe_open_noauth(
+ cli, &ndr_table_samr.syntax_id, &pipe_hnd);
+ if (!NT_STATUS_IS_OK(result)) {
if (lp_client_lanman_auth()) {
/* Use the old RAP method. */
if (!cli_oem_change_password(cli, user_name, new_passwd, old_passwd)) {
if (lp_client_lanman_auth()) {
/* Use the old RAP method. */
if (!cli_oem_change_password(cli, user_name, new_passwd, old_passwd)) {
result = NT_STATUS_UNSUCCESSFUL;
/* OK, this is ugly, but... try an anonymous pipe. */
result = NT_STATUS_UNSUCCESSFUL;
/* OK, this is ugly, but... try an anonymous pipe. */
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &result);
+ result = cli_rpc_pipe_open_noauth(cli, &ndr_table_samr.syntax_id,
+ &pipe_hnd);
+ if ( NT_STATUS_IS_OK(result) &&
(NT_STATUS_IS_OK(result = rpccli_samr_chgpasswd_user2(
pipe_hnd, talloc_tos(), user_name,
new_passwd, old_passwd)))) {
(NT_STATUS_IS_OK(result = rpccli_samr_chgpasswd_user2(
pipe_hnd, talloc_tos(), user_name,
new_passwd, old_passwd)))) {
/* open the LSARPC_PIPE */
/* open the LSARPC_PIPE */
- lsa_pipe = cli_rpc_pipe_open_noauth( cli, PI_LSARPC, &result );
- if ( !lsa_pipe) {
+ result = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &lsa_pipe);
+ if (!NT_STATUS_IS_OK(result)) {
interface/version dce/rpc pipe identification
********************************************************************/
interface/version dce/rpc pipe identification
********************************************************************/
-static const struct ndr_syntax_id syntax_spoolss = {
- {
- 0x12345678, 0x1234, 0xabcd,
- { 0xef, 0x00 },
- { 0x01, 0x23,
- 0x45, 0x67, 0x89, 0xab }
- }, 0x01
-};
-
#define PIPE_SRVSVC "\\PIPE\\srvsvc"
#define PIPE_SAMR "\\PIPE\\samr"
#define PIPE_WINREG "\\PIPE\\winreg"
#define PIPE_SRVSVC "\\PIPE\\srvsvc"
#define PIPE_SAMR "\\PIPE\\samr"
#define PIPE_WINREG "\\PIPE\\winreg"
+/********************************************************************
+ LEGACY function to ease transition from pipe_idx to interface
+ ********************************************************************/
+const struct ndr_syntax_id *cli_get_iface(int pipe_idx)
+{
+ SMB_ASSERT((pipe_idx >= 0) && (pipe_idx < PI_MAX_PIPES));
+ return pipe_names[pipe_idx].abstr_syntax;
+}
+
/********************************************************************
Map internal value to wire value.
********************************************************************/
/********************************************************************
Map internal value to wire value.
********************************************************************/
Open a named pipe to an SMB server and bind anonymously.
****************************************************************************/
Open a named pipe to an SMB server and bind anonymously.
****************************************************************************/
-struct rpc_pipe_client *cli_rpc_pipe_open_noauth(struct cli_state *cli, int pipe_idx, NTSTATUS *perr)
+NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
+ const struct ndr_syntax_id *interface,
+ struct rpc_pipe_client **presult)
{
struct rpc_pipe_client *result;
struct cli_pipe_auth_data *auth;
{
struct rpc_pipe_client *result;
struct cli_pipe_auth_data *auth;
- *perr = cli_rpc_pipe_open(cli, pipe_names[pipe_idx].abstr_syntax,
- &result);
- if (!NT_STATUS_IS_OK(*perr)) {
- return NULL;
+ status = cli_rpc_pipe_open(cli, interface, &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
- *perr = rpccli_anon_bind_data(result, &auth);
- if (!NT_STATUS_IS_OK(*perr)) {
+ status = rpccli_anon_bind_data(result, &auth);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("rpccli_anon_bind_data returned %s\n",
DEBUG(0, ("rpccli_anon_bind_data returned %s\n",
auth->domain = talloc_strdup(auth, cli->domain);
if ((auth->user_name == NULL) || (auth->domain == NULL)) {
auth->domain = talloc_strdup(auth, cli->domain);
if ((auth->user_name == NULL) || (auth->domain == NULL)) {
- *perr = NT_STATUS_NO_MEMORY;
+ return NT_STATUS_NO_MEMORY;
- *perr = rpc_pipe_bind(result, auth);
- if (!NT_STATUS_IS_OK(*perr)) {
+ status = rpc_pipe_bind(result, auth);
+ if (!NT_STATUS_IS_OK(status)) {
- if (rpccli_is_pipe_idx(result, PI_DSSETUP)) {
+ if (ndr_syntax_id_equal(interface,
+ &ndr_table_dssetup.syntax_id)) {
/* non AD domains just don't have this pipe, avoid
* level 0 statement in that case - gd */
lvl = 3;
}
/* non AD domains just don't have this pipe, avoid
* level 0 statement in that case - gd */
lvl = 3;
}
- DEBUG(lvl, ("cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe %s failed with error %s\n",
- cli_get_pipe_name(pipe_idx), nt_errstr(*perr) ));
+ DEBUG(lvl, ("cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe "
+ "%s failed with error %s\n",
+ cli_get_pipe_name_from_iface(debug_ctx(), cli,
+ interface),
+ nt_errstr(status) ));
}
DEBUG(10,("cli_rpc_pipe_open_noauth: opened pipe %s to machine "
"%s and bound anonymously.\n", result->trans.np.pipe_name,
cli->desthost ));
}
DEBUG(10,("cli_rpc_pipe_open_noauth: opened pipe %s to machine "
"%s and bound anonymously.\n", result->trans.np.pipe_name,
cli->desthost ));
+ *presult = result;
+ return NT_STATUS_OK;
}
/****************************************************************************
}
/****************************************************************************
{
struct rpc_pipe_client *netlogon_pipe = NULL;
{
struct rpc_pipe_client *netlogon_pipe = NULL;
- netlogon_pipe = cli_rpc_pipe_open_noauth(cli, PI_NETLOGON, perr);
- if (!netlogon_pipe) {
+ *perr = cli_rpc_pipe_open_noauth(cli, &ndr_table_netlogon.syntax_id,
+ &netlogon_pipe);
+ if (!NT_STATUS_IS_OK(*perr)) {
+
+const struct ndr_syntax_id syntax_spoolss = {
+ {
+ 0x12345678, 0x1234, 0xabcd,
+ { 0xef, 0x00 },
+ { 0x01, 0x23,
+ 0x45, 0x67, 0x89, 0xab }
+ }, 0x01
+};
+
*n_fns = sizeof(api_spoolss_cmds) / sizeof(struct api_struct);
}
*n_fns = sizeof(api_spoolss_cmds) / sizeof(struct api_struct);
}
-static const struct ndr_syntax_id syntax_spoolss = {
- {
- 0x12345678, 0x1234, 0xabcd,
- { 0xef, 0x00 },
- { 0x01, 0x23,
- 0x45, 0x67, 0x89, 0xab }
- }, 0x01
-};
-
NTSTATUS rpc_spoolss_init(void)
{
return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION,
NTSTATUS rpc_spoolss_init(void)
{
return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION,
* Now start the NT Domain stuff :-).
*/
* Now start the NT Domain stuff :-).
*/
- if ( !(*pp_pipe = cli_rpc_pipe_open_noauth(the_cli, PI_SPOOLSS, &ret)) ) {
+ ret = cli_rpc_pipe_open_noauth(the_cli, &syntax_spoolss, pp_pipe);
+ if (!NT_STATUS_IS_OK(ret)) {
DEBUG(2,("spoolss_connect_to_client: unable to open the spoolss pipe on machine %s. Error was : %s.\n",
remote_machine, nt_errstr(ret)));
cli_shutdown(the_cli);
DEBUG(2,("spoolss_connect_to_client: unable to open the spoolss pipe on machine %s. Error was : %s.\n",
remote_machine, nt_errstr(ret)));
cli_shutdown(the_cli);
if ( !NT_STATUS_IS_OK(nt_status) )
return WERR_GENERAL_FAILURE;
if ( !NT_STATUS_IS_OK(nt_status) )
return WERR_GENERAL_FAILURE;
- cli2 = cli_rpc_pipe_open_noauth(cli_server2, PI_SPOOLSS, &nt_status);
- if (!cli2) {
+ nt_status = cli_rpc_pipe_open_noauth(cli_server2, &syntax_spoolss,
+ &cli2);
+ if (!NT_STATUS_IS_OK(nt_status)) {
printf("failed to open spoolss pipe on server %s (%s)\n",
servername2, nt_errstr(nt_status));
return WERR_GENERAL_FAILURE;
printf("failed to open spoolss pipe on server %s (%s)\n",
servername2, nt_errstr(nt_status));
return WERR_GENERAL_FAILURE;
- lsa_pipe = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli),
- PI_LSARPC, &status);
- if (lsa_pipe == NULL) goto done;
+ status = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli),
+ &ndr_table_lsarpc.syntax_id,
+ &lsa_pipe);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
- samr_pipe = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli),
- PI_SAMR, &status);
- if (samr_pipe == NULL) goto done;
+ status = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(cli),
+ &ndr_table_samr.syntax_id,
+ &samr_pipe);
+ if (!NT_STATUS_IS_OK(status)) {
+ goto done;
+ }
status = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False,
SEC_RIGHTS_QUERY_VALUE, &pol);
status = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False,
SEC_RIGHTS_QUERY_VALUE, &pol);
- if ((lsapipe = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &result)) == NULL) {
+ result = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &lsapipe);
+ if (!NT_STATUS_IS_OK(result)) {
fprintf(stderr, "could not initialise lsa pipe. Error was %s\n", nt_errstr(result) );
goto error;
}
fprintf(stderr, "could not initialise lsa pipe. Error was %s\n", nt_errstr(result) );
goto error;
}
if (cmd_entry->pipe_idx != -1 && cmd_entry->rpc_pipe == NULL) {
switch (pipe_default_auth_type) {
case PIPE_AUTH_TYPE_NONE:
if (cmd_entry->pipe_idx != -1 && cmd_entry->rpc_pipe == NULL) {
switch (pipe_default_auth_type) {
case PIPE_AUTH_TYPE_NONE:
- cmd_entry->rpc_pipe = cli_rpc_pipe_open_noauth(cli,
- cmd_entry->pipe_idx,
- &ntresult);
+ ntresult = cli_rpc_pipe_open_noauth(
+ cli,
+ cli_get_iface(cmd_entry->pipe_idx),
+ &cmd_entry->rpc_pipe);
break;
case PIPE_AUTH_TYPE_SPNEGO_NTLMSSP:
cmd_entry->rpc_pipe = cli_rpc_pipe_open_spnego_ntlmssp(cli,
break;
case PIPE_AUTH_TYPE_SPNEGO_NTLMSSP:
cmd_entry->rpc_pipe = cli_rpc_pipe_open_spnego_ntlmssp(cli,
pipe_default_auth_type ));
return NT_STATUS_UNSUCCESSFUL;
}
pipe_default_auth_type ));
return NT_STATUS_UNSUCCESSFUL;
}
- if (!cmd_entry->rpc_pipe) {
+ if (!NT_STATUS_IS_OK(ntresult)) {
DEBUG(0, ("Could not initialise %s. Error was %s\n",
cli_get_pipe_name(cmd_entry->pipe_idx),
nt_errstr(ntresult) ));
DEBUG(0, ("Could not initialise %s. Error was %s\n",
cli_get_pipe_name(cmd_entry->pipe_idx),
nt_errstr(ntresult) ));
/* Shouldn't we open this with schannel ? JRA. */
/* Shouldn't we open this with schannel ? JRA. */
- netlogon_pipe = cli_rpc_pipe_open_noauth(cli, PI_NETLOGON, &nt_status);
- if (!netlogon_pipe) {
+ nt_status = cli_rpc_pipe_open_noauth(
+ cli, &ndr_table_netlogon.syntax_id, &netlogon_pipe);
+ if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0,("modify_trust_password: unable to open the domain client session to machine %s. Error was : %s.\n",
dc_name, nt_errstr(nt_status)));
cli_shutdown(cli);
DEBUG(0,("modify_trust_password: unable to open the domain client session to machine %s. Error was : %s.\n",
dc_name, nt_errstr(nt_status)));
cli_shutdown(cli);
SAFE_FREE(srv_cn_escaped);
SAFE_FREE(printername_escaped);
SAFE_FREE(srv_cn_escaped);
SAFE_FREE(printername_escaped);
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SPOOLSS, &nt_status);
- if (!pipe_hnd) {
+ nt_status = cli_rpc_pipe_open_noauth(cli, &syntax_spoolss, &pipe_hnd);
+ if (!NT_STATUS_IS_OK(nt_status)) {
d_fprintf(stderr, "Unable to open a connnection to the spoolss pipe on %s\n",
servername);
SAFE_FREE(prt_dn);
d_fprintf(stderr, "Unable to open a connnection to the spoolss pipe on %s\n",
servername);
SAFE_FREE(prt_dn);
NTSTATUS result = NT_STATUS_OK;
union lsa_PolicyInformation *info = NULL;
NTSTATUS result = NT_STATUS_OK;
union lsa_PolicyInformation *info = NULL;
- lsa_pipe = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &result);
- if (!lsa_pipe) {
+ result = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &lsa_pipe);
+ if (!NT_STATUS_IS_OK(result)) {
d_fprintf(stderr, "Could not initialise lsa pipe\n");
return result;
}
d_fprintf(stderr, "Could not initialise lsa pipe\n");
return result;
}
c->opt_password,
&nt_status);
} else {
c->opt_password,
&nt_status);
} else {
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, pipe_idx, &nt_status);
+ nt_status = cli_rpc_pipe_open_noauth(
+ cli, cli_get_iface(pipe_idx),
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("Could not initialise pipe %s. Error was %s\n",
cli_get_pipe_name(pipe_idx),
nt_errstr(nt_status) ));
DEBUG(0, ("Could not initialise pipe %s. Error was %s\n",
cli_get_pipe_name(pipe_idx),
nt_errstr(nt_status) ));
NTSTATUS result;
uint32 sec_channel_type;
NTSTATUS result;
uint32 sec_channel_type;
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_NETLOGON, &result);
- if (!pipe_hnd) {
+ result = cli_rpc_pipe_open_noauth(cli, &ndr_table_netlogon.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(result)) {
DEBUG(0,("rpc_oldjoin_internals: netlogon pipe open to machine %s failed. "
"error was %s\n",
cli->desthost,
DEBUG(0,("rpc_oldjoin_internals: netlogon pipe open to machine %s failed. "
"error was %s\n",
cli->desthost,
POLICY_HND lsa_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
POLICY_HND lsa_pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &result);
- if (!pipe_hnd) {
+ result = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(result)) {
- lsa_pipe = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(pipe_hnd),
- PI_LSARPC, &result);
- if (!lsa_pipe) {
+ result = cli_rpc_pipe_open_noauth(rpc_pipe_np_smb_conn(pipe_hnd),
+ &ndr_table_lsarpc.syntax_id,
+ &lsa_pipe);
+ if (!NT_STATUS_IS_OK(result)) {
d_fprintf(stderr, "Couldn't open LSA pipe. Error was %s\n",
nt_errstr(result) );
return result;
d_fprintf(stderr, "Couldn't open LSA pipe. Error was %s\n",
nt_errstr(result) );
return result;
- netr = cli_rpc_pipe_open_noauth(cli, PI_NETLOGON, &status);
- if (!netr) {
+ status = cli_rpc_pipe_open_noauth(cli, &ndr_table_netlogon.syntax_id,
+ &netr);
+ if (!NT_STATUS_IS_OK(status)) {
* Call LsaOpenPolicy and LsaQueryInfo
*/
* Call LsaOpenPolicy and LsaQueryInfo
*/
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &nt_status);
- if (!pipe_hnd) {
+ nt_status = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("Could not initialise lsa pipe. Error was %s\n", nt_errstr(nt_status) ));
cli_shutdown(cli);
talloc_destroy(mem_ctx);
DEBUG(0, ("Could not initialise lsa pipe. Error was %s\n", nt_errstr(nt_status) ));
cli_shutdown(cli);
talloc_destroy(mem_ctx);
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &nt_status);
- if (!pipe_hnd) {
+ nt_status = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("Could not initialise lsa pipe. Error was %s\n",
nt_errstr(nt_status) ));
cli_shutdown(cli);
DEBUG(0, ("Could not initialise lsa pipe. Error was %s\n",
nt_errstr(nt_status) ));
cli_shutdown(cli);
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &nt_status);
- if (!pipe_hnd) {
+ nt_status = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("Could not initialise lsa pipe. Error was %s\n",
nt_errstr(nt_status) ));
cli_shutdown(cli);
DEBUG(0, ("Could not initialise lsa pipe. Error was %s\n",
nt_errstr(nt_status) ));
cli_shutdown(cli);
/*
* Open \PIPE\samr and get needed policy handles
*/
/*
* Open \PIPE\samr and get needed policy handles
*/
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &nt_status);
- if (!pipe_hnd) {
+ nt_status = cli_rpc_pipe_open_noauth(cli, &ndr_table_samr.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("Could not initialise samr pipe. Error was %s\n", nt_errstr(nt_status)));
cli_shutdown(cli);
talloc_destroy(mem_ctx);
DEBUG(0, ("Could not initialise samr pipe. Error was %s\n", nt_errstr(nt_status)));
cli_shutdown(cli);
talloc_destroy(mem_ctx);
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &result);
- if (!pipe_hnd) {
+ result = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(result)) {
DEBUG(0, ("Error connecting to LSA pipe. Error was %s\n",
nt_errstr(result) ));
goto done;
DEBUG(0, ("Error connecting to LSA pipe. Error was %s\n",
nt_errstr(result) ));
goto done;
}
/* Create domain user */
}
/* Create domain user */
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SAMR, &result);
- if (!pipe_hnd) {
+ result = cli_rpc_pipe_open_noauth(cli, &ndr_table_samr.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(result)) {
DEBUG(0, ("Error connecting to SAM pipe. Error was %s\n",
nt_errstr(result) ));
goto done;
DEBUG(0, ("Error connecting to SAM pipe. Error was %s\n",
nt_errstr(result) ));
goto done;
/* Now check the whole process from top-to-bottom */
/* Now check the whole process from top-to-bottom */
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_NETLOGON, &result);
- if (!pipe_hnd) {
+ result = cli_rpc_pipe_open_noauth(cli, &ndr_table_netlogon.syntax_id,
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(result)) {
DEBUG(0,("Error connecting to NETLOGON pipe. Error was %s\n",
nt_errstr(result) ));
goto done;
DEBUG(0,("Error connecting to NETLOGON pipe. Error was %s\n",
nt_errstr(result) ));
goto done;
return NT_STATUS_NO_MEMORY;
}
return NT_STATUS_NO_MEMORY;
}
- pipe_hnd = cli_rpc_pipe_open_noauth(ctx->cli, cmd->pipe_idx, &status);
- if (pipe_hnd == NULL) {
+ status = cli_rpc_pipe_open_noauth(ctx->cli,
+ cli_get_iface(cmd->pipe_idx),
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(status)) {
d_fprintf(stderr, "Could not open pipe: %s\n",
nt_errstr(status));
return status;
d_fprintf(stderr, "Could not open pipe: %s\n",
nt_errstr(status));
return status;
- lsa_pipe = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &result);
- if (lsa_pipe == NULL) {
+ result = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &lsa_pipe);
+ if (!NT_STATUS_IS_OK(result)) {
d_fprintf(stderr, "Could not initialise lsa pipe\n");
return result;
}
d_fprintf(stderr, "Could not initialise lsa pipe\n");
return result;
}
- pipe_hnd = cli_rpc_pipe_open_noauth(cli_tmp, pipe_num, &nt_status);
- if (!pipe_hnd) {
+ nt_status = cli_rpc_pipe_open_noauth(cli_tmp, cli_get_iface(pipe_num),
+ &pipe_hnd);
+ if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("couldn't not initialize pipe\n"));
cli_shutdown(cli_tmp);
SAFE_FREE(server_name);
DEBUG(0, ("couldn't not initialize pipe\n"));
cli_shutdown(cli_tmp);
SAFE_FREE(server_name);
- cs->lsapipe = cli_rpc_pipe_open_noauth(cs->cli,
- PI_LSARPC,
- &nt_status);
+ nt_status = cli_rpc_pipe_open_noauth(cs->cli,
+ &ndr_table_lsarpc.syntax_id,
+ &cs->lsapipe);
- if (cs->lsapipe == NULL) {
+ if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(2,("create_cs: open LSA pipe failed. Error was %s\n", nt_errstr(nt_status)));
cs->failed_connect = true;
cs->err = nt_status;
DEBUG(2,("create_cs: open LSA pipe failed. Error was %s\n", nt_errstr(nt_status)));
cs->failed_connect = true;
cs->err = nt_status;
return cli_nt_error(cli);
}
return cli_nt_error(cli);
}
- p = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &status);
- if (p == NULL) {
+ status = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &p);
+ if (!NT_STATUS_IS_OK(status)) {
return cli_nt_error(cli);
}
return cli_nt_error(cli);
}
- p = cli_rpc_pipe_open_noauth(cli, PI_LSARPC, &status);
- if (p == NULL) {
+ status = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc.syntax_id,
+ &p);
+ if (!NT_STATUS_IS_OK(status)) {
if (!cli_ipc) {
NTSTATUS ret;
cli_ipc = connect_one("IPC$");
if (!cli_ipc) {
NTSTATUS ret;
cli_ipc = connect_one("IPC$");
- global_pipe_hnd = cli_rpc_pipe_open_noauth(cli_ipc, PI_LSARPC, &ret);
- if (!global_pipe_hnd) {
+ ret = cli_rpc_pipe_open_noauth(cli_ipc,
+ &ndr_table_lsarpc.syntax_id,
+ &global_pipe_hnd);
+ if (!NT_STATUS_IS_OK(ret)) {
- pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SRVSVC, &status);
+ status = cli_rpc_pipe_open_noauth(cli, &ndr_table_srvsvc.syntax_id,
+ &pipe_hnd);
- if (pipe_hnd == NULL) {
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("Could not connect to srvsvc pipe: %s\n",
nt_errstr(status)));
TALLOC_FREE(mem_ctx);
DEBUG(10, ("Could not connect to srvsvc pipe: %s\n",
nt_errstr(status)));
TALLOC_FREE(mem_ctx);
DEBUG(5, ("set_dc_type_and_flags_connect: domain %s\n", domain->name ));
DEBUG(5, ("set_dc_type_and_flags_connect: domain %s\n", domain->name ));
- cli = cli_rpc_pipe_open_noauth(domain->conn.cli, PI_DSSETUP,
- &result);
+ result = cli_rpc_pipe_open_noauth(domain->conn.cli,
+ &ndr_table_dssetup.syntax_id,
+ &cli);
+ if (!NT_STATUS_IS_OK(result)) {
DEBUG(5, ("set_dc_type_and_flags_connect: Could not bind to "
"PI_DSSETUP on domain %s: (%s)\n",
domain->name, nt_errstr(result)));
DEBUG(5, ("set_dc_type_and_flags_connect: Could not bind to "
"PI_DSSETUP on domain %s: (%s)\n",
domain->name, nt_errstr(result)));
- cli = cli_rpc_pipe_open_noauth(domain->conn.cli, PI_LSARPC, &result);
+ result = cli_rpc_pipe_open_noauth(domain->conn.cli,
+ &ndr_table_lsarpc.syntax_id, &cli);
+ if (!NT_STATUS_IS_OK(result)) {
DEBUG(5, ("set_dc_type_and_flags_connect: Could not bind to "
"PI_LSARPC on domain %s: (%s)\n",
domain->name, nt_errstr(result)));
DEBUG(5, ("set_dc_type_and_flags_connect: Could not bind to "
"PI_LSARPC on domain %s: (%s)\n",
domain->name, nt_errstr(result)));
anonymous:
/* Finally fall back to anonymous. */
anonymous:
/* Finally fall back to anonymous. */
- conn->samr_pipe = cli_rpc_pipe_open_noauth(conn->cli, PI_SAMR,
- &result);
+ result = cli_rpc_pipe_open_noauth(conn->cli, &ndr_table_samr.syntax_id,
+ &conn->samr_pipe);
- if (conn->samr_pipe == NULL) {
- result = NT_STATUS_PIPE_NOT_AVAILABLE;
+ if (!NT_STATUS_IS_OK(result)) {
- conn->lsa_pipe = cli_rpc_pipe_open_noauth(conn->cli, PI_LSARPC,
- &result);
- if (conn->lsa_pipe == NULL) {
+ result = cli_rpc_pipe_open_noauth(conn->cli,
+ &ndr_table_lsarpc.syntax_id,
+ &conn->lsa_pipe);
+ if (!NT_STATUS_IS_OK(result)) {
result = NT_STATUS_PIPE_NOT_AVAILABLE;
goto done;
}
result = NT_STATUS_PIPE_NOT_AVAILABLE;
goto done;
}
- netlogon_pipe = cli_rpc_pipe_open_noauth(conn->cli, PI_NETLOGON,
- &result);
- if (netlogon_pipe == NULL) {
+ result = cli_rpc_pipe_open_noauth(conn->cli,
+ &ndr_table_netlogon.syntax_id,
+ &netlogon_pipe);
+ if (!NT_STATUS_IS_OK(result)) {