diff options
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_netlogon.c | 21 | ||||
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 25 | ||||
-rw-r--r-- | source3/rpc_client/cli_spoolss.c | 10 |
3 files changed, 25 insertions, 31 deletions
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index 7b8cd19174..97bc4c65b7 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -514,7 +514,7 @@ NTSTATUS cli_netlogon_sam_logon(struct cli_state *cli, TALLOC_CTX *mem_ctx, 0, /* param_ctrl */ 0xdead, 0xbeef, /* LUID? */ username, cli->clnt_name_slash, - cli->sess_key, lm_owf_user_pwd, + (const char *)cli->sess_key, lm_owf_user_pwd, nt_owf_user_pwd); break; @@ -685,31 +685,20 @@ NTSTATUS cli_net_srv_pwset(struct cli_state *cli, TALLOC_CTX *mem_ctx, NET_Q_SRV_PWSET q_s; uint16 sec_chan_type = 2; NTSTATUS nt_status; - char *mach_acct; gen_next_creds( cli, &new_clnt_cred); prs_init(&qbuf , 1024, mem_ctx, MARSHALL); prs_init(&rbuf, 0, mem_ctx, UNMARSHALL); - /* create and send a MSRPC command with api NET_SRV_PWSET */ - - mach_acct = talloc_asprintf(mem_ctx, "%s$", machine_name); - - if (!mach_acct) { - DEBUG(0,("talloc_asprintf failed!\n")); - nt_status = NT_STATUS_NO_MEMORY; - goto done; - } - DEBUG(4,("cli_net_srv_pwset: srv:%s acct:%s sc: %d mc: %s clnt %s %x\n", - cli->srv_name_slash, mach_acct, sec_chan_type, machine_name, + cli->srv_name_slash, cli->mach_acct, sec_chan_type, machine_name, credstr(new_clnt_cred.challenge.data), new_clnt_cred.timestamp.time)); /* store the parameters */ - init_q_srv_pwset(&q_s, cli->srv_name_slash, cli->sess_key, - mach_acct, sec_chan_type, machine_name, - &new_clnt_cred, (char *)hashed_mach_pwd); + init_q_srv_pwset(&q_s, cli->srv_name_slash, (const char *)cli->sess_key, + cli->mach_acct, sec_chan_type, machine_name, + &new_clnt_cred, hashed_mach_pwd); /* turn parameters into data stream */ if(!net_io_q_srv_pwset("", &q_s, &qbuf, 0)) { diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index ebe54c2c06..dedbf017a9 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -264,7 +264,7 @@ static BOOL rpc_auth_pipe(struct cli_state *cli, prs_struct *rdata, DATA_BLOB ntlmssp_verf = data_blob(NULL, auth_len); /* save the reply away, for use a little later */ - prs_copy_data_out(ntlmssp_verf.data, &auth_verf, auth_len); + prs_copy_data_out((char *)ntlmssp_verf.data, &auth_verf, auth_len); return (NT_STATUS_IS_OK(ntlmssp_client_store_response(cli->ntlmssp_pipe_state, @@ -287,7 +287,7 @@ static BOOL rpc_auth_pipe(struct cli_state *cli, prs_struct *rdata, return False; } sig = data_blob(NULL, auth_len); - prs_copy_data_out(sig.data, &auth_verf, auth_len); + prs_copy_data_out((char *)sig.data, &auth_verf, auth_len); } /* @@ -306,12 +306,12 @@ static BOOL rpc_auth_pipe(struct cli_state *cli, prs_struct *rdata, return False; } nt_status = ntlmssp_client_unseal_packet(cli->ntlmssp_pipe_state, - reply_data, data_len, + (unsigned char *)reply_data, data_len, &sig); } else if (cli->pipe_auth_flags & AUTH_PIPE_SIGN) { nt_status = ntlmssp_client_check_packet(cli->ntlmssp_pipe_state, - reply_data, data_len, + (const unsigned char *)reply_data, data_len, &sig); } @@ -684,10 +684,10 @@ static NTSTATUS create_rpc_bind_req(struct cli_state *cli, prs_struct *rpc_out, /* Auth len in the rpc header doesn't include auth_header. */ auth_len = request.length; - prs_copy_data_in(&auth_info, request.data, request.length); + prs_copy_data_in(&auth_info, (char *)request.data, request.length); DEBUG(5, ("NTLMSSP Negotiate:\n")); - dump_data(5, request.data, request.length); + dump_data(5, (const char *)request.data, request.length); data_blob_free(&request); @@ -751,6 +751,7 @@ static NTSTATUS create_rpc_bind_req(struct cli_state *cli, prs_struct *rpc_out, return NT_STATUS_NO_MEMORY; } } + prs_mem_free(&auth_info); return NT_STATUS_OK; } @@ -810,7 +811,7 @@ static NTSTATUS create_rpc_bind_resp(struct cli_state *cli, * Append the auth data to the outgoing buffer. */ - if(!prs_copy_data_in(rpc_out, ntlmssp_reply.data, ntlmssp_reply.length)) { + if(!prs_copy_data_in(rpc_out, (char *)ntlmssp_reply.data, ntlmssp_reply.length)) { DEBUG(0,("create_rpc_bind_req: failed to grow parse struct to add auth.\n")); data_blob_free(&ntlmssp_reply); return NT_STATUS_NO_MEMORY; @@ -1016,7 +1017,7 @@ BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num, /* write auth footer onto the packet */ real_auth_len = sign_blob.length; - prs_copy_data_in(&sec_blob, sign_blob.data, sign_blob.length); + prs_copy_data_in(&sec_blob, (char *)sign_blob.data, sign_blob.length); data_blob_free(&sign_blob); } @@ -1492,7 +1493,9 @@ NTSTATUS cli_nt_establish_netlogon(struct cli_state *cli, int sec_chan, const uchar trust_password[16]) { NTSTATUS result; - uint32 neg_flags = 0x000001ff; + /* The 7 here seems to be required to get Win2k not to downgrade us + to NT4. Actually, anything other than 1ff would seem to do... */ + uint32 neg_flags = 0x000701ff; int fnum; cli_nt_netlogon_netsec_session_close(cli); @@ -1585,7 +1588,9 @@ NTSTATUS cli_nt_setup_netsec(struct cli_state *cli, int sec_chan, const uchar trust_password[16]) { NTSTATUS result; - uint32 neg_flags = 0x000001ff; + /* The 7 here seems to be required to get Win2k not to downgrade us + to NT4. Actually, anything other than 1ff would seem to do... */ + uint32 neg_flags = 0x000701ff; cli->pipe_auth_flags = 0; if (lp_client_schannel() == False) { diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c index 6392620497..8f5f2413de 100644 --- a/source3/rpc_client/cli_spoolss.c +++ b/source3/rpc_client/cli_spoolss.c @@ -720,7 +720,7 @@ WERROR cli_spoolss_getprinterdriver(struct cli_state *cli, TALLOC_CTX *mem_ctx, uint32 offered, uint32 *needed, POLICY_HND *pol, uint32 level, - const char *env, PRINTER_DRIVER_CTR *ctr) + const char *env, int version, PRINTER_DRIVER_CTR *ctr) { prs_struct qbuf, rbuf; SPOOL_Q_GETPRINTERDRIVER2 q; @@ -742,7 +742,7 @@ WERROR cli_spoolss_getprinterdriver(struct cli_state *cli, prs_init(&qbuf, MAX_PDU_FRAG_LEN, mem_ctx, MARSHALL); prs_init(&rbuf, 0, mem_ctx, UNMARSHALL); - make_spoolss_q_getprinterdriver2(&q, pol, env, level, 2, 2, + make_spoolss_q_getprinterdriver2(&q, pol, env, level, version, 2, &buffer, offered); /* Marshall data and send request */ @@ -2027,7 +2027,7 @@ WERROR cli_spoolss_setprinterdata(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Initialise input parameters */ make_spoolss_q_setprinterdata( - &q, hnd, value->valuename, value->type, value->data_p, value->size); + &q, hnd, value->valuename, value->type, (char *)value->data_p, value->size); /* Marshall data and send request */ @@ -2072,7 +2072,7 @@ WERROR cli_spoolss_setprinterdataex(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Initialise input parameters */ make_spoolss_q_setprinterdataex( - &q, hnd, keyname, value->valuename, value->type, value->data_p, + &q, hnd, keyname, value->valuename, value->type, (char *)value->data_p, value->size); /* Marshall data and send request */ @@ -2215,7 +2215,7 @@ WERROR cli_spoolss_enumprinterdataex(struct cli_state *cli, TALLOC_CTX *mem_ctx, rpcstr_pull(name, v->valuename.buffer, sizeof(name), -1, STR_TERMINATE); - regval_ctr_addvalue(ctr, name, v->type, v->data, v->data_len); + regval_ctr_addvalue(ctr, name, v->type, (const char *)v->data, v->data_len); } done: |