summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-12-07 20:23:41 +0000
committerLuke Leighton <lkcl@samba.org>1998-12-07 20:23:41 +0000
commit9c848ec329a6ce86cffb2304746590116d9292f0 (patch)
treeafdaf2f6b16df02b5183618a5d9e422bddfedfe7 /source3/rpc_client
parent312f4f3960a9b1938ae133678cd8567be1331b99 (diff)
downloadsamba-9c848ec329a6ce86cffb2304746590116d9292f0.tar.gz
samba-9c848ec329a6ce86cffb2304746590116d9292f0.tar.bz2
samba-9c848ec329a6ce86cffb2304746590116d9292f0.zip
removed nt_pipe_fnum from struct cli_state. need to be able to call
LsaLookupSids etc from within SamrQueryAliasMembers, for example. fnum is now a parameter to client functions. thanks to mike black for starting the ball rolling. (This used to be commit bee8f7fa6b0f7f995f71303f4e14a4aaed0c2437)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_login.c22
-rw-r--r--source3/rpc_client/cli_lsarpc.c20
-rw-r--r--source3/rpc_client/cli_netlogon.c39
-rw-r--r--source3/rpc_client/cli_pipe.c54
-rw-r--r--source3/rpc_client/cli_reg.c70
-rw-r--r--source3/rpc_client/cli_samr.c192
-rw-r--r--source3/rpc_client/cli_srvsvc.c20
-rw-r--r--source3/rpc_client/cli_wkssvc.c4
8 files changed, 212 insertions, 209 deletions
diff --git a/source3/rpc_client/cli_login.c b/source3/rpc_client/cli_login.c
index c7a542577f..4520607898 100644
--- a/source3/rpc_client/cli_login.c
+++ b/source3/rpc_client/cli_login.c
@@ -29,7 +29,7 @@ extern int DEBUGLEVEL;
Initialize domain session credentials.
****************************************************************************/
-BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16])
+BOOL cli_nt_setup_creds(struct cli_state *cli, uint16 fnum, unsigned char mach_pwd[16])
{
DOM_CHAL clnt_chal;
DOM_CHAL srv_chal;
@@ -41,7 +41,7 @@ BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16])
generate_random_buffer( clnt_chal.data, 8, False);
/* send a client challenge; receive a server challenge */
- if (!cli_net_req_chal(cli, &clnt_chal, &srv_chal))
+ if (!cli_net_req_chal(cli, fnum, &clnt_chal, &srv_chal))
{
DEBUG(0,("cli_nt_setup_creds: request challenge failed\n"));
return False;
@@ -64,7 +64,7 @@ BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16])
* Receive an auth-2 challenge response and check it.
*/
- if (!cli_net_auth2(cli, SEC_CHAN_WKSTA, 0x000001ff, &srv_chal))
+ if (!cli_net_auth2(cli, fnum, SEC_CHAN_WKSTA, 0x000001ff, &srv_chal))
{
DEBUG(0,("cli_nt_setup_creds: auth2 challenge failed\n"));
return False;
@@ -77,7 +77,7 @@ BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16])
Set machine password.
****************************************************************************/
-BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd)
+BOOL cli_nt_srv_pwset(struct cli_state *cli, uint16 fnum, unsigned char *new_hashof_mach_pwd)
{
unsigned char processed_new_pwd[16];
@@ -91,7 +91,7 @@ BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd)
cred_hash3( processed_new_pwd, new_hashof_mach_pwd, cli->sess_key, 1);
/* send client srv_pwset challenge */
- return cli_net_srv_pwset(cli, processed_new_pwd);
+ return cli_net_srv_pwset(cli, fnum, processed_new_pwd);
}
/****************************************************************************
@@ -100,7 +100,7 @@ NT login - interactive.
password equivalents, protected by the session key) is inherently insecure
given the current design of the NT Domain system. JRA.
****************************************************************************/
-BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username,
+BOOL cli_nt_login_interactive(struct cli_state *cli, uint16 fnum, char *domain, char *username,
uint32 luid_low, char *password,
NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3)
{
@@ -139,7 +139,7 @@ BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *usernam
memset(nt_owf_user_pwd, '\0', sizeof(nt_owf_user_pwd));
/* Send client sam-logon request - update credentials on success. */
- ret = cli_net_sam_logon(cli, ctr, user_info3);
+ ret = cli_net_sam_logon(cli, fnum, ctr, user_info3);
memset(ctr->auth.id1.lm_owf.data, '\0', sizeof(lm_owf_user_pwd));
memset(ctr->auth.id1.nt_owf.data, '\0', sizeof(nt_owf_user_pwd));
@@ -153,7 +153,7 @@ NT login - network.
password equivalents over the network. JRA.
****************************************************************************/
-BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username,
+BOOL cli_nt_login_network(struct cli_state *cli, uint16 fnum, char *domain, char *username,
uint32 luid_low, char lm_chal[8], char lm_chal_resp[24],
char nt_chal_resp[24],
NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3)
@@ -170,16 +170,16 @@ BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username,
(uchar *)lm_chal, (uchar *)lm_chal_resp, (uchar *)nt_chal_resp);
/* Send client sam-logon request - update credentials on success. */
- return cli_net_sam_logon(cli, ctr, user_info3);
+ return cli_net_sam_logon(cli, fnum, ctr, user_info3);
}
/****************************************************************************
NT Logoff.
****************************************************************************/
-BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr)
+BOOL cli_nt_logoff(struct cli_state *cli, uint16 fnum, NET_ID_INFO_CTR *ctr)
{
DEBUG(5,("cli_nt_logoff: %d\n", __LINE__));
/* Send client sam-logoff request - update credentials on success. */
- return cli_net_sam_logoff(cli, ctr);
+ return cli_net_sam_logoff(cli, fnum, ctr);
}
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index f0c9bdfe16..81bff830dd 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -35,7 +35,7 @@ extern int DEBUGLEVEL;
/****************************************************************************
do a LSA Open Policy
****************************************************************************/
-BOOL lsa_open_policy(struct cli_state *cli,
+BOOL lsa_open_policy(struct cli_state *cli, uint16 fnum,
char *server_name, POLICY_HND *hnd,
BOOL sec_qos)
{
@@ -69,7 +69,7 @@ BOOL lsa_open_policy(struct cli_state *cli,
lsa_io_q_open_pol("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, LSA_OPENPOLICY, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, LSA_OPENPOLICY, &buf, &rbuf))
{
LSA_R_OPEN_POL r_o;
BOOL p;
@@ -101,7 +101,7 @@ BOOL lsa_open_policy(struct cli_state *cli,
/****************************************************************************
do a LSA Lookup Names
****************************************************************************/
-BOOL lsa_lookup_names(struct cli_state *cli,
+BOOL lsa_lookup_names(struct cli_state *cli, uint16 fnum,
POLICY_HND *hnd,
int num_names,
const char **names,
@@ -129,7 +129,7 @@ BOOL lsa_lookup_names(struct cli_state *cli,
lsa_io_q_lookup_names("", &q_l, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, LSA_LOOKUPNAMES, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, LSA_LOOKUPNAMES, &buf, &rbuf))
{
LSA_R_LOOKUP_NAMES r_l;
DOM_R_REF ref;
@@ -219,7 +219,7 @@ BOOL lsa_lookup_names(struct cli_state *cli,
/****************************************************************************
do a LSA Lookup SIDs
****************************************************************************/
-BOOL lsa_lookup_sids(struct cli_state *cli,
+BOOL lsa_lookup_sids(struct cli_state *cli, uint16 fnum,
POLICY_HND *hnd,
int num_sids,
DOM_SID **sids,
@@ -247,7 +247,7 @@ BOOL lsa_lookup_sids(struct cli_state *cli,
lsa_io_q_lookup_sids("", &q_l, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, LSA_LOOKUPSIDS, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, LSA_LOOKUPSIDS, &buf, &rbuf))
{
LSA_R_LOOKUP_SIDS r_l;
DOM_R_REF ref;
@@ -338,7 +338,7 @@ BOOL lsa_lookup_sids(struct cli_state *cli,
/****************************************************************************
do a LSA Query Info Policy
****************************************************************************/
-BOOL lsa_query_info_pol(struct cli_state *cli,
+BOOL lsa_query_info_pol(struct cli_state *cli, uint16 fnum,
POLICY_HND *hnd, uint16 info_class,
fstring domain_name, DOM_SID *domain_sid)
{
@@ -366,7 +366,7 @@ BOOL lsa_query_info_pol(struct cli_state *cli,
lsa_io_q_query("", &q_q, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, LSA_QUERYINFOPOLICY, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, LSA_QUERYINFOPOLICY, &buf, &rbuf))
{
LSA_R_QUERY_INFO r_q;
BOOL p;
@@ -451,7 +451,7 @@ BOOL lsa_query_info_pol(struct cli_state *cli,
/****************************************************************************
do a LSA Close
****************************************************************************/
-BOOL lsa_close(struct cli_state *cli, POLICY_HND *hnd)
+BOOL lsa_close(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd)
{
prs_struct rbuf;
prs_struct buf;
@@ -474,7 +474,7 @@ BOOL lsa_close(struct cli_state *cli, POLICY_HND *hnd)
lsa_io_q_close("", &q_c, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, LSA_CLOSE, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, LSA_CLOSE, &buf, &rbuf))
{
LSA_R_CLOSE r_c;
BOOL p;
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index 099c81496a..750265483c 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -57,7 +57,7 @@ static void gen_next_creds( struct cli_state *cli, DOM_CRED *new_clnt_cred)
/****************************************************************************
do a LSA Logon Control2
****************************************************************************/
-BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level)
+BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint16 nt_pipe_fnum, uint32 status_level)
{
prs_struct rbuf;
prs_struct buf;
@@ -79,7 +79,7 @@ BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level)
net_io_q_logon_ctrl2("", &q_l, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, NET_LOGON_CTRL2, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, nt_pipe_fnum, NET_LOGON_CTRL2, &buf, &rbuf))
{
NET_R_LOGON_CTRL2 r_l;
@@ -110,7 +110,7 @@ Ensure that the server credential returned matches the session key
encrypt of the server challenge originally received. JRA.
****************************************************************************/
-BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan,
+BOOL cli_net_auth2(struct cli_state *cli, uint16 nt_pipe_fnum, uint16 sec_chan,
uint32 neg_flags, DOM_CHAL *srv_chal)
{
prs_struct rbuf;
@@ -135,7 +135,7 @@ BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan,
net_io_q_auth_2("", &q_a, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, NET_AUTH2, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, nt_pipe_fnum, NET_AUTH2, &buf, &rbuf))
{
NET_R_AUTH_2 r_a;
@@ -197,7 +197,7 @@ LSA Request Challenge. Sends our challenge to server, then gets
server response. These are used to generate the credentials.
****************************************************************************/
-BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal)
+BOOL cli_net_req_chal(struct cli_state *cli, uint16 nt_pipe_fnum, DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal)
{
prs_struct rbuf;
prs_struct buf;
@@ -222,7 +222,7 @@ BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_
net_io_q_req_chal("", &q_c, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, NET_REQCHAL, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, nt_pipe_fnum, NET_REQCHAL, &buf, &rbuf))
{
NET_R_REQ_CHAL r_c;
BOOL ok;
@@ -256,7 +256,7 @@ BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_
LSA Server Password Set.
****************************************************************************/
-BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16])
+BOOL cli_net_srv_pwset(struct cli_state *cli, uint16 nt_pipe_fnum, uint8 hashed_mach_pwd[16])
{
prs_struct rbuf;
prs_struct buf;
@@ -284,7 +284,7 @@ BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16])
net_io_q_srv_pwset("", &q_s, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, NET_SRVPWSET, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, nt_pipe_fnum, NET_SRVPWSET, &buf, &rbuf))
{
NET_R_SRV_PWSET r_s;
@@ -321,7 +321,7 @@ password ?).\n", cli->desthost ));
LSA SAM Logon - interactive or network.
****************************************************************************/
-BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr,
+BOOL cli_net_sam_logon(struct cli_state *cli, uint16 nt_pipe_fnum, NET_ID_INFO_CTR *ctr,
NET_USER_INFO_3 *user_info3)
{
DOM_CRED new_clnt_cred;
@@ -355,7 +355,7 @@ BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr,
net_io_q_sam_logon("", &q_s, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, NET_SAMLOGON, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, nt_pipe_fnum, NET_SAMLOGON, &buf, &rbuf))
{
NET_R_SAM_LOGON r_s;
@@ -407,7 +407,7 @@ send a different info level. Right now though, I'm not sure
what that needs to be (I need to see one on the wire before
I can be sure). JRA.
****************************************************************************/
-BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr)
+BOOL cli_net_sam_logoff(struct cli_state *cli, uint16 nt_pipe_fnum, NET_ID_INFO_CTR *ctr)
{
DOM_CRED new_clnt_cred;
DOM_CRED dummy_rtn_creds;
@@ -439,7 +439,7 @@ BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr)
net_io_q_sam_logoff("", &q_s, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, NET_SAMLOGOFF, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, nt_pipe_fnum, NET_SAMLOGOFF, &buf, &rbuf))
{
NET_R_SAM_LOGOFF r_s;
@@ -480,6 +480,7 @@ static BOOL modify_trust_password( char *domain, char *remote_machine,
unsigned char orig_trust_passwd_hash[16],
unsigned char new_trust_passwd_hash[16])
{
+ uint16 nt_pipe_fnum;
struct cli_state cli;
struct nmb_name calling, called;
@@ -563,35 +564,35 @@ Error was : %s.\n", remote_machine, cli_errstr(&cli) ));
* Now start the NT Domain stuff :-).
*/
- if(cli_nt_session_open(&cli, PIPE_NETLOGON) == False) {
+ if(cli_nt_session_open(&cli, PIPE_NETLOGON, &nt_pipe_fnum) == False) {
DEBUG(0,("modify_trust_password: unable to open the domain client session to \
machine %s. Error was : %s.\n", remote_machine, cli_errstr(&cli)));
- cli_nt_session_close(&cli);
+ cli_nt_session_close(&cli, nt_pipe_fnum);
cli_ulogoff(&cli);
cli_shutdown(&cli);
return False;
}
- if(cli_nt_setup_creds(&cli, orig_trust_passwd_hash) == False) {
+ if(cli_nt_setup_creds(&cli, nt_pipe_fnum, orig_trust_passwd_hash) == False) {
DEBUG(0,("modify_trust_password: unable to setup the PDC credentials to machine \
%s. Error was : %s.\n", remote_machine, cli_errstr(&cli)));
- cli_nt_session_close(&cli);
+ cli_nt_session_close(&cli, nt_pipe_fnum);
cli_ulogoff(&cli);
cli_shutdown(&cli);
return False;
}
- if( cli_nt_srv_pwset( &cli,new_trust_passwd_hash ) == False) {
+ if( cli_nt_srv_pwset( &cli, nt_pipe_fnum, new_trust_passwd_hash ) == False) {
DEBUG(0,("modify_trust_password: unable to change password for machine %s in domain \
%s to Domain controller %s. Error was %s.\n", global_myname, domain, remote_machine,
cli_errstr(&cli)));
- cli_close(&cli, cli.nt_pipe_fnum);
+ cli_nt_session_close(&cli, nt_pipe_fnum);
cli_ulogoff(&cli);
cli_shutdown(&cli);
return False;
}
- cli_nt_session_close(&cli);
+ cli_nt_session_close(&cli, nt_pipe_fnum);
cli_ulogoff(&cli);
cli_shutdown(&cli);
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 712e608847..9d2ee533d6 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -46,7 +46,7 @@ static uint32 get_rpc_call_id(void)
uses SMBreadX to get rest of rpc data
********************************************************************/
-static BOOL rpc_read(struct cli_state *cli,
+static BOOL rpc_read(struct cli_state *cli, uint16 nt_pipe_fnum,
prs_struct *rdata, uint32 data_to_read,
uint32 rdata_offset)
{
@@ -83,7 +83,7 @@ static BOOL rpc_read(struct cli_state *cli,
DEBUG(5,("rpc_read: grow buffer to %d\n", rdata->data->data_used));
}
- num_read = cli_read(cli, cli->nt_pipe_fnum, data, file_offset, size);
+ num_read = cli_read(cli, nt_pipe_fnum, data, file_offset, size);
DEBUG(5,("rpc_read: read offset: %d read: %d to read: %d\n",
file_offset, num_read, data_to_read));
@@ -250,7 +250,7 @@ static BOOL rpc_auth_pipe(struct cli_state *cli, prs_struct *rdata,
****************************************************************************/
-static BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd,
+static BOOL rpc_api_pipe(struct cli_state *cli, uint16 nt_pipe_fnum, uint16 cmd,
prs_struct *param , prs_struct *data,
prs_struct *rparam, prs_struct *rdata)
{
@@ -281,9 +281,9 @@ static BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd,
/* create setup parameters. */
setup[0] = cmd;
- setup[1] = cli->nt_pipe_fnum; /* pipe file handle. got this from an SMBOpenX. */
+ setup[1] = nt_pipe_fnum; /* pipe file handle. got this from an SMBOpenX. */
- DEBUG(5,("rpc_api_pipe: cmd:%x fnum:%x\n", cmd, cli->nt_pipe_fnum));
+ DEBUG(5,("rpc_api_pipe: cmd:%x fnum:%x\n", cmd, nt_pipe_fnum));
/* send the data: receive a response. */
if (!cli_api_pipe(cli, "\\PIPE\\\0\0\0", 8,
@@ -337,7 +337,7 @@ static BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd,
/* err status is only informational: the _real_ check is on the length */
if (len > 0) /* || err == (0x80000000 | STATUS_BUFFER_OVERFLOW)) */
{
- if (!rpc_read(cli, rdata, len, rdata->data->data_used))
+ if (!rpc_read(cli, nt_pipe_fnum, rdata, len, rdata->data->data_used))
{
return False;
}
@@ -363,7 +363,7 @@ static BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd,
prs_init(&hps, 0x8, 4, 0, True);
- num_read = cli_read(cli, cli->nt_pipe_fnum, hps.data->data, 0, 0x18);
+ num_read = cli_read(cli, nt_pipe_fnum, hps.data->data, 0, 0x18);
DEBUG(5,("rpc_api_pipe: read header (size:%d)\n", num_read));
if (num_read != 0x18) return False;
@@ -385,7 +385,7 @@ static BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd,
return False;
}
- if (!rpc_read(cli, rdata, len, rdata->data->data_used))
+ if (!rpc_read(cli, nt_pipe_fnum, rdata, len, rdata->data->data_used))
{
return False;
}
@@ -604,7 +604,7 @@ static BOOL create_rpc_request(prs_struct *rhdr, uint8 op_num, int data_len,
/****************************************************************************
send a request on an rpc pipe.
****************************************************************************/
-BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num,
+BOOL rpc_api_pipe_req(struct cli_state *cli, uint16 nt_pipe_fnum, uint8 op_num,
prs_struct *data, prs_struct *rdata)
{
/* fudge this, at the moment: create the header; memcpy the data. oops. */
@@ -680,7 +680,7 @@ BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num,
prs_init(&dataa, mem_buf_len(hdr.data), 4, 0x0, False);
mem_buf_copy(dataa.data->data, hdr.data, 0, mem_buf_len(hdr.data));
- ret = rpc_api_pipe(cli, 0x0026, NULL, &dataa, &rparam, rdata);
+ ret = rpc_api_pipe(cli, nt_pipe_fnum, 0x0026, NULL, &dataa, &rparam, rdata);
prs_mem_free(&hdr_auth );
prs_mem_free(&auth_verf);
@@ -695,7 +695,8 @@ BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num,
do an rpc bind
****************************************************************************/
-static BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint16 device_state)
+static BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, uint16 nt_pipe_fnum,
+ char *pipe_name, uint16 device_state)
{
BOOL state_set = False;
char param[2];
@@ -707,14 +708,14 @@ static BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, char *pipe_name, uint1
if (pipe_name == NULL) return False;
DEBUG(5,("Set Handle state Pipe[%x]: %s - device state:%x\n",
- cli->nt_pipe_fnum, pipe_name, device_state));
+ nt_pipe_fnum, pipe_name, device_state));
/* create parameters: device state */
SSVAL(param, 0, device_state);
/* create setup parameters. */
setup[0] = 0x0001;
- setup[1] = cli->nt_pipe_fnum; /* pipe file handle. got this from an SMBOpenX. */
+ setup[1] = nt_pipe_fnum; /* pipe file handle. got this from an SMBOpenX. */
/* send the data on \PIPE\ */
if (cli_api_pipe(cli, "\\PIPE\\\0\0\0", 8,
@@ -833,7 +834,8 @@ static BOOL check_bind_response(RPC_HDR_BA *hdr_ba, char *pipe_name, RPC_IFACE *
do an rpc bind
****************************************************************************/
-static BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name,
+static BOOL rpc_pipe_bind(struct cli_state *cli, uint16 nt_pipe_fnum,
+ char *pipe_name,
RPC_IFACE *abstract, RPC_IFACE *transfer,
char *my_name)
{
@@ -855,7 +857,7 @@ static BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name,
return False;
}
- DEBUG(5,("Bind RPC Pipe[%x]: %s\n", cli->nt_pipe_fnum, pipe_name));
+ DEBUG(5,("Bind RPC Pipe[%x]: %s\n", nt_pipe_fnum, pipe_name));
if (!valid_pipe_name(pipe_name, abstract, transfer)) return False;
@@ -882,7 +884,7 @@ static BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name,
mem_buf_copy(data.data->data, hdr.data, 0, mem_buf_len(hdr.data));
/* send data on \PIPE\. receive a response */
- if (rpc_api_pipe(cli, 0x0026, NULL, &data, &rparam, &rdata))
+ if (rpc_api_pipe(cli, nt_pipe_fnum, 0x0026, NULL, &data, &rparam, &rdata))
{
RPC_HDR_BA hdr_ba;
RPC_HDR_AUTH rhdr_auth;
@@ -984,7 +986,7 @@ static BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name,
prs_init(&dataa, mem_buf_len(hdra.data), 4, 0x0, False);
mem_buf_copy(dataa.data->data, hdra.data, 0, mem_buf_len(hdra.data));
- if (cli_write(cli, cli->nt_pipe_fnum, 0x0008,
+ if (cli_write(cli, nt_pipe_fnum, 0x0008,
dataa.data->data, 0,
dataa.data->data_used) < 0)
{
@@ -1029,7 +1031,7 @@ void cli_nt_set_ntlmssp_flgs(struct cli_state *cli, uint32 ntlmssp_flgs)
open a session
****************************************************************************/
-BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name)
+BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, uint16* nt_pipe_fnum)
{
RPC_IFACE abstract;
RPC_IFACE transfer;
@@ -1045,7 +1047,7 @@ BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name)
return False;
}
- cli->nt_pipe_fnum = (uint16)fnum;
+ *nt_pipe_fnum = (uint16)fnum;
}
else
{
@@ -1056,14 +1058,14 @@ BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name)
return False;
}
- cli->nt_pipe_fnum = (uint16)fnum;
+ *nt_pipe_fnum = (uint16)fnum;
/**************** Set Named Pipe State ***************/
- if (!rpc_pipe_set_hnd_state(cli, pipe_name, 0x4300))
+ if (!rpc_pipe_set_hnd_state(cli, *nt_pipe_fnum, pipe_name, 0x4300))
{
DEBUG(0,("cli_nt_session_open: pipe hnd state failed. Error was %s\n",
cli_errstr(cli)));
- cli_close(cli, cli->nt_pipe_fnum);
+ cli_close(cli, *nt_pipe_fnum);
return False;
}
@@ -1071,13 +1073,13 @@ BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name)
/******************* bind request on pipe *****************/
- if (!rpc_pipe_bind(cli, pipe_name,
+ if (!rpc_pipe_bind(cli, *nt_pipe_fnum, pipe_name,
&abstract, &transfer,
global_myname))
{
DEBUG(0,("cli_nt_session_open: rpc bind failed. Error was %s\n",
cli_errstr(cli)));
- cli_close(cli, cli->nt_pipe_fnum);
+ cli_close(cli, *nt_pipe_fnum);
return False;
}
@@ -1104,7 +1106,7 @@ BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name)
close the session
****************************************************************************/
-void cli_nt_session_close(struct cli_state *cli)
+void cli_nt_session_close(struct cli_state *cli, uint16 nt_pipe_fnum)
{
- cli_close(cli, cli->nt_pipe_fnum);
+ cli_close(cli, nt_pipe_fnum);
}
diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c
index 61e38a8d96..b3d2f6e864 100644
--- a/source3/rpc_client/cli_reg.c
+++ b/source3/rpc_client/cli_reg.c
@@ -34,7 +34,7 @@ extern int DEBUGLEVEL;
/****************************************************************************
do a REG Open Policy
****************************************************************************/
-BOOL do_reg_connect(struct cli_state *cli, char *full_keyname, char *key_name,
+BOOL do_reg_connect(struct cli_state *cli, uint16 fnum, char *full_keyname, char *key_name,
POLICY_HND *reg_hnd)
{
BOOL res = True;
@@ -61,7 +61,7 @@ BOOL do_reg_connect(struct cli_state *cli, char *full_keyname, char *key_name,
{
case HKEY_LOCAL_MACHINE:
{
- res = res ? do_reg_open_hklm(cli,
+ res = res ? do_reg_open_hklm(cli, fnum,
0x84E0, 0x02000000,
reg_hnd) : False;
break;
@@ -69,7 +69,7 @@ BOOL do_reg_connect(struct cli_state *cli, char *full_keyname, char *key_name,
case HKEY_USERS:
{
- res = res ? do_reg_open_hku(cli,
+ res = res ? do_reg_open_hku(cli, fnum,
0x84E0, 0x02000000,
reg_hnd) : False;
break;
@@ -87,7 +87,7 @@ BOOL do_reg_connect(struct cli_state *cli, char *full_keyname, char *key_name,
/****************************************************************************
do a REG Open Policy
****************************************************************************/
-BOOL do_reg_open_hklm(struct cli_state *cli, uint16 unknown_0, uint32 level,
+BOOL do_reg_open_hklm(struct cli_state *cli, uint16 fnum, uint16 unknown_0, uint32 level,
POLICY_HND *hnd)
{
prs_struct rbuf;
@@ -110,7 +110,7 @@ BOOL do_reg_open_hklm(struct cli_state *cli, uint16 unknown_0, uint32 level,
reg_io_q_open_hklm("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_OPEN_HKLM, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_OPEN_HKLM, &buf, &rbuf))
{
REG_R_OPEN_HKLM r_o;
BOOL p;
@@ -144,7 +144,7 @@ BOOL do_reg_open_hklm(struct cli_state *cli, uint16 unknown_0, uint32 level,
/****************************************************************************
do a REG Open HKU
****************************************************************************/
-BOOL do_reg_open_hku(struct cli_state *cli, uint16 unknown_0, uint32 level,
+BOOL do_reg_open_hku(struct cli_state *cli, uint16 fnum, uint16 unknown_0, uint32 level,
POLICY_HND *hnd)
{
prs_struct rbuf;
@@ -167,7 +167,7 @@ BOOL do_reg_open_hku(struct cli_state *cli, uint16 unknown_0, uint32 level,
reg_io_q_open_hku("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_OPEN_HKU, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_OPEN_HKU, &buf, &rbuf))
{
REG_R_OPEN_HKU r_o;
BOOL p;
@@ -203,7 +203,7 @@ do a REG Unknown 0xB command. sent after a create key or create value.
this might be some sort of "sync" or "refresh" command, sent after
modification of the registry...
****************************************************************************/
-BOOL do_reg_flush_key(struct cli_state *cli, POLICY_HND *hnd)
+BOOL do_reg_flush_key(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd)
{
prs_struct rbuf;
prs_struct buf;
@@ -225,7 +225,7 @@ BOOL do_reg_flush_key(struct cli_state *cli, POLICY_HND *hnd)
reg_io_q_flush_key("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_FLUSH_KEY, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_FLUSH_KEY, &buf, &rbuf))
{
REG_R_FLUSH_KEY r_o;
BOOL p;
@@ -257,7 +257,7 @@ BOOL do_reg_flush_key(struct cli_state *cli, POLICY_HND *hnd)
/****************************************************************************
do a REG Query Key
****************************************************************************/
-BOOL do_reg_query_key(struct cli_state *cli, POLICY_HND *hnd,
+BOOL do_reg_query_key(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
char *class, uint32 *class_len,
uint32 *num_subkeys, uint32 *max_subkeylen,
uint32 *max_subkeysize, uint32 *num_values,
@@ -284,7 +284,7 @@ BOOL do_reg_query_key(struct cli_state *cli, POLICY_HND *hnd,
reg_io_q_query_key("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_QUERY_KEY, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_QUERY_KEY, &buf, &rbuf))
{
REG_R_QUERY_KEY r_o;
BOOL p;
@@ -327,7 +327,7 @@ BOOL do_reg_query_key(struct cli_state *cli, POLICY_HND *hnd,
/****************************************************************************
do a REG Unknown 1A
****************************************************************************/
-BOOL do_reg_unknown_1a(struct cli_state *cli, POLICY_HND *hnd, uint32 *unk)
+BOOL do_reg_unknown_1a(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd, uint32 *unk)
{
prs_struct rbuf;
prs_struct buf;
@@ -349,7 +349,7 @@ BOOL do_reg_unknown_1a(struct cli_state *cli, POLICY_HND *hnd, uint32 *unk)
reg_io_q_unk_1a("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_UNK_1A, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_UNK_1A, &buf, &rbuf))
{
REG_R_UNK_1A r_o;
BOOL p;
@@ -382,7 +382,7 @@ BOOL do_reg_unknown_1a(struct cli_state *cli, POLICY_HND *hnd, uint32 *unk)
/****************************************************************************
do a REG Query Info
****************************************************************************/
-BOOL do_reg_query_info(struct cli_state *cli, POLICY_HND *hnd,
+BOOL do_reg_query_info(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
char *type, uint32 *unk_0, uint32 *unk_1)
{
prs_struct rbuf;
@@ -405,7 +405,7 @@ BOOL do_reg_query_info(struct cli_state *cli, POLICY_HND *hnd,
reg_io_q_info("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_INFO, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_INFO, &buf, &rbuf))
{
REG_R_INFO r_o;
BOOL p;
@@ -440,7 +440,7 @@ BOOL do_reg_query_info(struct cli_state *cli, POLICY_HND *hnd,
/****************************************************************************
do a REG Set Key Security
****************************************************************************/
-BOOL do_reg_set_key_sec(struct cli_state *cli, POLICY_HND *hnd,
+BOOL do_reg_set_key_sec(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
uint32 sec_buf_size, SEC_DESC *sec_buf)
{
prs_struct rbuf;
@@ -463,7 +463,7 @@ BOOL do_reg_set_key_sec(struct cli_state *cli, POLICY_HND *hnd,
reg_io_q_set_key_sec("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_SET_KEY_SEC, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_SET_KEY_SEC, &buf, &rbuf))
{
REG_R_SET_KEY_SEC r_o;
BOOL p;
@@ -488,7 +488,7 @@ BOOL do_reg_set_key_sec(struct cli_state *cli, POLICY_HND *hnd,
/****************************************************************************
do a REG Query Key Security
****************************************************************************/
-BOOL do_reg_get_key_sec(struct cli_state *cli, POLICY_HND *hnd,
+BOOL do_reg_get_key_sec(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
uint32 *sec_buf_size, SEC_DESC_BUF *sec_buf)
{
prs_struct rbuf;
@@ -511,7 +511,7 @@ BOOL do_reg_get_key_sec(struct cli_state *cli, POLICY_HND *hnd,
reg_io_q_get_key_sec("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_GET_KEY_SEC, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_GET_KEY_SEC, &buf, &rbuf))
{
REG_R_GET_KEY_SEC r_o;
BOOL p;
@@ -557,7 +557,7 @@ BOOL do_reg_get_key_sec(struct cli_state *cli, POLICY_HND *hnd,
/****************************************************************************
do a REG Delete Value
****************************************************************************/
-BOOL do_reg_delete_val(struct cli_state *cli, POLICY_HND *hnd, char *val_name)
+BOOL do_reg_delete_val(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd, char *val_name)
{
prs_struct rbuf;
prs_struct buf;
@@ -579,7 +579,7 @@ BOOL do_reg_delete_val(struct cli_state *cli, POLICY_HND *hnd, char *val_name)
reg_io_q_delete_val("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_DELETE_VALUE, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_DELETE_VALUE, &buf, &rbuf))
{
REG_R_DELETE_VALUE r_o;
BOOL p;
@@ -611,7 +611,7 @@ BOOL do_reg_delete_val(struct cli_state *cli, POLICY_HND *hnd, char *val_name)
/****************************************************************************
do a REG Delete Key
****************************************************************************/
-BOOL do_reg_delete_key(struct cli_state *cli, POLICY_HND *hnd, char *key_name)
+BOOL do_reg_delete_key(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd, char *key_name)
{
prs_struct rbuf;
prs_struct buf;
@@ -633,7 +633,7 @@ BOOL do_reg_delete_key(struct cli_state *cli, POLICY_HND *hnd, char *key_name)
reg_io_q_delete_key("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_DELETE_KEY, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_DELETE_KEY, &buf, &rbuf))
{
REG_R_DELETE_KEY r_o;
BOOL p;
@@ -665,7 +665,7 @@ BOOL do_reg_delete_key(struct cli_state *cli, POLICY_HND *hnd, char *key_name)
/****************************************************************************
do a REG Create Key
****************************************************************************/
-BOOL do_reg_create_key(struct cli_state *cli, POLICY_HND *hnd,
+BOOL do_reg_create_key(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
char *key_name, char *key_class,
SEC_ACCESS *sam_access,
POLICY_HND *key)
@@ -704,7 +704,7 @@ BOOL do_reg_create_key(struct cli_state *cli, POLICY_HND *hnd,
reg_io_q_create_key("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_CREATE_KEY, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_CREATE_KEY, &buf, &rbuf))
{
REG_R_CREATE_KEY r_o;
BOOL p;
@@ -739,7 +739,7 @@ BOOL do_reg_create_key(struct cli_state *cli, POLICY_HND *hnd,
/****************************************************************************
do a REG Enum Key
****************************************************************************/
-BOOL do_reg_enum_key(struct cli_state *cli, POLICY_HND *hnd,
+BOOL do_reg_enum_key(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
int key_index, char *key_name,
uint32 *unk_1, uint32 *unk_2,
time_t *mod_time)
@@ -764,7 +764,7 @@ BOOL do_reg_enum_key(struct cli_state *cli, POLICY_HND *hnd,
reg_io_q_enum_key("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_ENUM_KEY, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_ENUM_KEY, &buf, &rbuf))
{
REG_R_ENUM_KEY r_o;
BOOL p;
@@ -800,7 +800,7 @@ BOOL do_reg_enum_key(struct cli_state *cli, POLICY_HND *hnd,
/****************************************************************************
do a REG Create Value
****************************************************************************/
-BOOL do_reg_create_val(struct cli_state *cli, POLICY_HND *hnd,
+BOOL do_reg_create_val(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
char *val_name, uint32 type, BUFFER3 *data)
{
prs_struct rbuf;
@@ -823,7 +823,7 @@ BOOL do_reg_create_val(struct cli_state *cli, POLICY_HND *hnd,
reg_io_q_create_val("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_CREATE_VALUE, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_CREATE_VALUE, &buf, &rbuf))
{
REG_R_CREATE_VALUE r_o;
BOOL p;
@@ -855,7 +855,7 @@ BOOL do_reg_create_val(struct cli_state *cli, POLICY_HND *hnd,
/****************************************************************************
do a REG Enum Value
****************************************************************************/
-BOOL do_reg_enum_val(struct cli_state *cli, POLICY_HND *hnd,
+BOOL do_reg_enum_val(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
int val_index, int max_valnamelen, int max_valbufsize,
fstring val_name,
uint32 *val_type, BUFFER2 *value)
@@ -880,7 +880,7 @@ BOOL do_reg_enum_val(struct cli_state *cli, POLICY_HND *hnd,
reg_io_q_enum_val("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_ENUM_VALUE, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_ENUM_VALUE, &buf, &rbuf))
{
REG_R_ENUM_VALUE r_o;
BOOL p;
@@ -915,7 +915,7 @@ BOOL do_reg_enum_val(struct cli_state *cli, POLICY_HND *hnd,
/****************************************************************************
do a REG Open Key
****************************************************************************/
-BOOL do_reg_open_entry(struct cli_state *cli, POLICY_HND *hnd,
+BOOL do_reg_open_entry(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd,
char *key_name, uint32 unk_0,
POLICY_HND *key_hnd)
{
@@ -939,7 +939,7 @@ BOOL do_reg_open_entry(struct cli_state *cli, POLICY_HND *hnd,
reg_io_q_open_entry("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_OPEN_ENTRY, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_OPEN_ENTRY, &buf, &rbuf))
{
REG_R_OPEN_ENTRY r_o;
BOOL p;
@@ -972,7 +972,7 @@ BOOL do_reg_open_entry(struct cli_state *cli, POLICY_HND *hnd,
/****************************************************************************
do a REG Close
****************************************************************************/
-BOOL do_reg_close(struct cli_state *cli, POLICY_HND *hnd)
+BOOL do_reg_close(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd)
{
prs_struct rbuf;
prs_struct buf;
@@ -995,7 +995,7 @@ BOOL do_reg_close(struct cli_state *cli, POLICY_HND *hnd)
reg_io_q_close("", &q_c, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, REG_CLOSE, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, REG_CLOSE, &buf, &rbuf))
{
REG_R_CLOSE r_c;
BOOL p;
diff --git a/source3/rpc_client/cli_samr.c b/source3/rpc_client/cli_samr.c
index e950269ec3..7c89dfcc02 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -36,7 +36,7 @@ extern int DEBUGLEVEL;
/****************************************************************************
do a SAMR create domain alias
****************************************************************************/
-BOOL create_samr_domain_alias(struct cli_state *cli,
+BOOL create_samr_domain_alias(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain,
const char *acct_name, const char *acct_desc,
uint32 *rid)
@@ -48,7 +48,7 @@ BOOL create_samr_domain_alias(struct cli_state *cli,
if (pol_open_domain == NULL || acct_name == NULL || acct_desc == NULL) return False;
/* send create alias */
- if (!samr_create_dom_alias(cli,
+ if (!samr_create_dom_alias(cli, fnum,
pol_open_domain,
acct_name,
&pol_open_alias, rid))
@@ -63,7 +63,7 @@ BOOL create_samr_domain_alias(struct cli_state *cli,
make_samr_alias_info3(&ctr.alias.info3, acct_desc);
/* send set alias info */
- if (!samr_set_aliasinfo(cli,
+ if (!samr_set_aliasinfo(cli, fnum,
&pol_open_alias,
&ctr))
{
@@ -71,13 +71,13 @@ BOOL create_samr_domain_alias(struct cli_state *cli,
ret = False;
}
- return samr_close(cli, &pol_open_alias) && ret;
+ return samr_close(cli, fnum,&pol_open_alias) && ret;
}
/****************************************************************************
do a SAMR create domain group
****************************************************************************/
-BOOL create_samr_domain_group(struct cli_state *cli,
+BOOL create_samr_domain_group(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain,
const char *acct_name, const char *acct_desc,
uint32 *rid)
@@ -89,7 +89,7 @@ BOOL create_samr_domain_group(struct cli_state *cli,
if (pol_open_domain == NULL || acct_name == NULL || acct_desc == NULL) return False;
/* send create group*/
- if (!samr_create_dom_group(cli,
+ if (!samr_create_dom_group(cli, fnum,
pol_open_domain,
acct_name,
&pol_open_group, rid))
@@ -105,7 +105,7 @@ BOOL create_samr_domain_group(struct cli_state *cli,
make_samr_group_info4(&ctr.group.info4, acct_desc);
/* send user groups query */
- if (!samr_set_groupinfo(cli,
+ if (!samr_set_groupinfo(cli, fnum,
&pol_open_group,
&ctr))
{
@@ -113,13 +113,13 @@ BOOL create_samr_domain_group(struct cli_state *cli,
ret = False;
}
- return samr_close(cli, &pol_open_group) && ret;
+ return samr_close(cli, fnum,&pol_open_group) && ret;
}
/****************************************************************************
do a SAMR query user groups
****************************************************************************/
-BOOL get_samr_query_usergroups(struct cli_state *cli,
+BOOL get_samr_query_usergroups(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain, uint32 user_rid,
uint32 *num_groups, DOM_GID *gid)
{
@@ -129,7 +129,7 @@ BOOL get_samr_query_usergroups(struct cli_state *cli,
if (pol_open_domain == NULL || num_groups == NULL || gid == NULL) return False;
/* send open domain (on user sid) */
- if (!samr_open_user(cli,
+ if (!samr_open_user(cli, fnum,
pol_open_domain,
0x02011b, user_rid,
&pol_open_user))
@@ -138,7 +138,7 @@ BOOL get_samr_query_usergroups(struct cli_state *cli,
}
/* send user groups query */
- if (!samr_query_usergroups(cli,
+ if (!samr_query_usergroups(cli, fnum,
&pol_open_user,
num_groups, gid))
{
@@ -146,13 +146,13 @@ BOOL get_samr_query_usergroups(struct cli_state *cli,
ret = False;
}
- return samr_close(cli, &pol_open_user) && ret;
+ return samr_close(cli, fnum,&pol_open_user) && ret;
}
/****************************************************************************
do a SAMR delete group
****************************************************************************/
-BOOL delete_samr_dom_group(struct cli_state *cli,
+BOOL delete_samr_dom_group(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain,
uint32 group_rid)
{
@@ -161,7 +161,7 @@ BOOL delete_samr_dom_group(struct cli_state *cli,
if (pol_open_domain == NULL) return False;
/* send open domain (on group rid) */
- if (!samr_open_group(cli, pol_open_domain,
+ if (!samr_open_group(cli, fnum,pol_open_domain,
0x00000010, group_rid,
&pol_open_group))
{
@@ -169,11 +169,11 @@ BOOL delete_samr_dom_group(struct cli_state *cli,
}
/* send group delete */
- if (!samr_delete_dom_group(cli, &pol_open_group))
+ if (!samr_delete_dom_group(cli, fnum,&pol_open_group))
{
DEBUG(5,("delete_samr_dom_group: error in delete domain group\n"));
- samr_close(cli, &pol_open_group);
+ samr_close(cli, fnum,&pol_open_group);
return False;
}
@@ -184,7 +184,7 @@ BOOL delete_samr_dom_group(struct cli_state *cli,
/****************************************************************************
do a SAMR query group members
****************************************************************************/
-BOOL get_samr_query_groupmem(struct cli_state *cli,
+BOOL get_samr_query_groupmem(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain,
uint32 group_rid, uint32 *num_mem,
uint32 *rid, uint32 *attr)
@@ -195,7 +195,7 @@ BOOL get_samr_query_groupmem(struct cli_state *cli,
if (pol_open_domain == NULL || num_mem == NULL || rid == NULL || attr == NULL) return False;
/* send open domain (on group sid) */
- if (!samr_open_group(cli, pol_open_domain,
+ if (!samr_open_group(cli, fnum,pol_open_domain,
0x00000010, group_rid,
&pol_open_group))
{
@@ -203,20 +203,20 @@ BOOL get_samr_query_groupmem(struct cli_state *cli,
}
/* send group info query */
- if (!samr_query_groupmem(cli, &pol_open_group, num_mem, rid, attr))
+ if (!samr_query_groupmem(cli, fnum,&pol_open_group, num_mem, rid, attr))
{
DEBUG(5,("samr_query_group: error in query group members\n"));
ret = False;
}
- return samr_close(cli, &pol_open_group) && ret;
+ return samr_close(cli, fnum,&pol_open_group) && ret;
}
/****************************************************************************
do a SAMR delete alias
****************************************************************************/
-BOOL delete_samr_dom_alias(struct cli_state *cli,
+BOOL delete_samr_dom_alias(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain,
uint32 alias_rid)
{
@@ -225,18 +225,18 @@ BOOL delete_samr_dom_alias(struct cli_state *cli,
if (pol_open_domain == NULL) return False;
/* send open domain (on alias rid) */
- if (!samr_open_alias(cli, pol_open_domain,
+ if (!samr_open_alias(cli, fnum,pol_open_domain,
0x000f001f, alias_rid, &pol_open_alias))
{
return False;
}
/* send alias delete */
- if (!samr_delete_dom_alias(cli, &pol_open_alias))
+ if (!samr_delete_dom_alias(cli, fnum,&pol_open_alias))
{
DEBUG(5,("delete_samr_dom_alias: error in delete domain alias\n"));
- samr_close(cli, &pol_open_alias);
+ samr_close(cli, fnum,&pol_open_alias);
return False;
}
@@ -247,7 +247,7 @@ BOOL delete_samr_dom_alias(struct cli_state *cli,
/****************************************************************************
do a SAMR query alias members
****************************************************************************/
-BOOL get_samr_query_aliasmem(struct cli_state *cli,
+BOOL get_samr_query_aliasmem(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain,
uint32 alias_rid, uint32 *num_mem, DOM_SID2 *sid)
{
@@ -257,7 +257,7 @@ BOOL get_samr_query_aliasmem(struct cli_state *cli,
if (pol_open_domain == NULL || num_mem == NULL || sid == NULL) return False;
/* send open domain (on alias sid) */
- if (!samr_open_alias(cli, pol_open_domain,
+ if (!samr_open_alias(cli, fnum, pol_open_domain,
0x000f001f, alias_rid,
&pol_open_alias))
{
@@ -265,20 +265,20 @@ BOOL get_samr_query_aliasmem(struct cli_state *cli,
}
/* send alias info query */
- if (!samr_query_aliasmem(cli, &pol_open_alias, num_mem, sid))
+ if (!samr_query_aliasmem(cli, fnum, &pol_open_alias, num_mem, sid))
{
DEBUG(5,("samr_query_alias: error in query alias members\n"));
ret = False;
}
- return samr_close(cli, &pol_open_alias) && ret;
+ return samr_close(cli, fnum,&pol_open_alias) && ret;
}
/****************************************************************************
do a SAMR query user info
****************************************************************************/
-BOOL get_samr_query_userinfo(struct cli_state *cli,
+BOOL get_samr_query_userinfo(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain,
uint32 info_level,
uint32 user_rid, SAM_USER_INFO_21 *usr)
@@ -291,7 +291,7 @@ BOOL get_samr_query_userinfo(struct cli_state *cli,
bzero(usr, sizeof(*usr));
/* send open domain (on user sid) */
- if (!samr_open_user(cli,
+ if (!samr_open_user(cli, fnum,
pol_open_domain,
0x02011b, user_rid,
&pol_open_user))
@@ -300,7 +300,7 @@ BOOL get_samr_query_userinfo(struct cli_state *cli,
}
/* send user info query */
- if (!samr_query_userinfo(cli,
+ if (!samr_query_userinfo(cli, fnum,
&pol_open_user,
info_level, (void*)usr))
{
@@ -309,13 +309,13 @@ BOOL get_samr_query_userinfo(struct cli_state *cli,
ret = False;
}
- return samr_close(cli, &pol_open_user) && ret;
+ return samr_close(cli, fnum,&pol_open_user) && ret;
}
/****************************************************************************
do a SAMR query group info
****************************************************************************/
-BOOL get_samr_query_groupinfo(struct cli_state *cli,
+BOOL get_samr_query_groupinfo(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol_open_domain,
uint32 info_level,
uint32 group_rid, GROUP_INFO_CTR *ctr)
@@ -328,7 +328,7 @@ BOOL get_samr_query_groupinfo(struct cli_state *cli,
bzero(ctr, sizeof(*ctr));
/* send open domain (on group sid) */
- if (!samr_open_group(cli,
+ if (!samr_open_group(cli, fnum,
pol_open_domain,
0x00000010, group_rid, &pol_open_group))
{
@@ -336,7 +336,7 @@ BOOL get_samr_query_groupinfo(struct cli_state *cli,
}
/* send group info query */
- if (!samr_query_groupinfo(cli,
+ if (!samr_query_groupinfo(cli, fnum,
&pol_open_group,
info_level, ctr))
{
@@ -345,13 +345,13 @@ BOOL get_samr_query_groupinfo(struct cli_state *cli,
ret = False;
}
- return samr_close(cli, &pol_open_group) && ret;
+ return samr_close(cli, fnum,&pol_open_group) && ret;
}
/****************************************************************************
do a SAMR change user password command
****************************************************************************/
-BOOL samr_chgpasswd_user(struct cli_state *cli,
+BOOL samr_chgpasswd_user(struct cli_state *cli, uint16 fnum,
char *srv_name, char *user_name,
char nt_newpass[516], uchar nt_oldhash[16],
char lm_newpass[516], uchar lm_oldhash[16])
@@ -378,7 +378,7 @@ BOOL samr_chgpasswd_user(struct cli_state *cli,
samr_io_q_chgpasswd_user("", &q_e, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_CHGPASSWD_USER, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_CHGPASSWD_USER, &data, &rdata))
{
SAMR_R_CHGPASSWD_USER r_e;
BOOL p;
@@ -408,7 +408,7 @@ BOOL samr_chgpasswd_user(struct cli_state *cli,
/****************************************************************************
do a SAMR unknown 0x38 command
****************************************************************************/
-BOOL samr_unknown_38(struct cli_state *cli, char *srv_name)
+BOOL samr_unknown_38(struct cli_state *cli, uint16 fnum, char *srv_name)
{
prs_struct data;
prs_struct rdata;
@@ -429,7 +429,7 @@ BOOL samr_unknown_38(struct cli_state *cli, char *srv_name)
samr_io_q_unknown_38("", &q_e, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_UNKNOWN_38, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_UNKNOWN_38, &data, &rdata))
{
SAMR_R_UNKNOWN_38 r_e;
BOOL p;
@@ -460,7 +460,7 @@ BOOL samr_unknown_38(struct cli_state *cli, char *srv_name)
/****************************************************************************
do a SAMR unknown 0x8 command
****************************************************************************/
-BOOL samr_query_dom_info(struct cli_state *cli,
+BOOL samr_query_dom_info(struct cli_state *cli, uint16 fnum,
POLICY_HND *domain_pol, uint16 switch_value)
{
prs_struct data;
@@ -485,7 +485,7 @@ BOOL samr_query_dom_info(struct cli_state *cli,
samr_io_q_query_dom_info("", &q_e, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_QUERY_DOMAIN_INFO, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_DOMAIN_INFO, &data, &rdata))
{
SAMR_R_QUERY_DOMAIN_INFO r_e;
BOOL p;
@@ -515,7 +515,7 @@ BOOL samr_query_dom_info(struct cli_state *cli,
/****************************************************************************
do a SAMR enumerate groups
****************************************************************************/
-BOOL samr_enum_dom_groups(struct cli_state *cli,
+BOOL samr_enum_dom_groups(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol, uint32 size,
struct acct_info **sam,
int *num_sam_groups)
@@ -542,7 +542,7 @@ BOOL samr_enum_dom_groups(struct cli_state *cli,
samr_io_q_enum_dom_groups("", &q_e, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_ENUM_DOM_GROUPS, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_ENUM_DOM_GROUPS, &data, &rdata))
{
SAMR_R_ENUM_DOM_GROUPS r_e;
BOOL p;
@@ -609,7 +609,7 @@ BOOL samr_enum_dom_groups(struct cli_state *cli,
/****************************************************************************
do a SAMR enumerate aliases
****************************************************************************/
-BOOL samr_enum_dom_aliases(struct cli_state *cli,
+BOOL samr_enum_dom_aliases(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol, uint32 size,
struct acct_info **sam,
int *num_sam_aliases)
@@ -636,7 +636,7 @@ BOOL samr_enum_dom_aliases(struct cli_state *cli,
samr_io_q_enum_dom_aliases("", &q_e, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_ENUM_DOM_ALIASES, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_ENUM_DOM_ALIASES, &data, &rdata))
{
SAMR_R_ENUM_DOM_ALIASES r_e;
BOOL p;
@@ -697,7 +697,7 @@ BOOL samr_enum_dom_aliases(struct cli_state *cli,
/****************************************************************************
do a SAMR enumerate users
****************************************************************************/
-BOOL samr_enum_dom_users(struct cli_state *cli,
+BOOL samr_enum_dom_users(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol, uint16 num_entries, uint16 unk_0,
uint16 acb_mask, uint16 unk_1, uint32 size,
struct acct_info **sam,
@@ -727,7 +727,7 @@ BOOL samr_enum_dom_users(struct cli_state *cli,
samr_io_q_enum_dom_users("", &q_e, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_ENUM_DOM_USERS, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_ENUM_DOM_USERS, &data, &rdata))
{
SAMR_R_ENUM_DOM_USERS r_e;
BOOL p;
@@ -788,7 +788,7 @@ BOOL samr_enum_dom_users(struct cli_state *cli,
/****************************************************************************
do a SAMR Connect
****************************************************************************/
-BOOL samr_connect(struct cli_state *cli,
+BOOL samr_connect(struct cli_state *cli, uint16 fnum,
char *srv_name, uint32 unknown_0,
POLICY_HND *connect_pol)
{
@@ -815,7 +815,7 @@ BOOL samr_connect(struct cli_state *cli,
samr_io_q_connect("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_CONNECT, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_CONNECT, &data, &rdata))
{
SAMR_R_CONNECT r_o;
BOOL p;
@@ -846,7 +846,7 @@ BOOL samr_connect(struct cli_state *cli,
/****************************************************************************
do a SAMR Open User
****************************************************************************/
-BOOL samr_open_user(struct cli_state *cli,
+BOOL samr_open_user(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol, uint32 unk_0, uint32 rid,
POLICY_HND *user_pol)
{
@@ -873,7 +873,7 @@ BOOL samr_open_user(struct cli_state *cli,
samr_io_q_open_user("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_OPEN_USER, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_OPEN_USER, &data, &rdata))
{
SAMR_R_OPEN_USER r_o;
BOOL p;
@@ -904,7 +904,7 @@ BOOL samr_open_user(struct cli_state *cli,
/****************************************************************************
do a SAMR Open Alias
****************************************************************************/
-BOOL samr_open_alias(struct cli_state *cli,
+BOOL samr_open_alias(struct cli_state *cli, uint16 fnum,
POLICY_HND *domain_pol,
uint32 flags, uint32 rid,
POLICY_HND *alias_pol)
@@ -931,7 +931,7 @@ BOOL samr_open_alias(struct cli_state *cli,
samr_io_q_open_alias("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_OPEN_ALIAS, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_OPEN_ALIAS, &data, &rdata))
{
SAMR_R_OPEN_ALIAS r_o;
BOOL p;
@@ -962,7 +962,7 @@ BOOL samr_open_alias(struct cli_state *cli,
/****************************************************************************
do a SAMR Delete Alias Member
****************************************************************************/
-BOOL samr_del_aliasmem(struct cli_state *cli,
+BOOL samr_del_aliasmem(struct cli_state *cli, uint16 fnum,
POLICY_HND *alias_pol, DOM_SID *sid)
{
prs_struct data;
@@ -987,7 +987,7 @@ BOOL samr_del_aliasmem(struct cli_state *cli,
samr_io_q_del_aliasmem("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_DEL_ALIASMEM, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_DEL_ALIASMEM, &data, &rdata))
{
SAMR_R_DEL_ALIASMEM r_o;
BOOL p;
@@ -1017,7 +1017,7 @@ BOOL samr_del_aliasmem(struct cli_state *cli,
/****************************************************************************
do a SAMR Add Alias Member
****************************************************************************/
-BOOL samr_add_aliasmem(struct cli_state *cli,
+BOOL samr_add_aliasmem(struct cli_state *cli, uint16 fnum,
POLICY_HND *alias_pol, DOM_SID *sid)
{
prs_struct data;
@@ -1042,7 +1042,7 @@ BOOL samr_add_aliasmem(struct cli_state *cli,
samr_io_q_add_aliasmem("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_ADD_ALIASMEM, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_ADD_ALIASMEM, &data, &rdata))
{
SAMR_R_ADD_ALIASMEM r_o;
BOOL p;
@@ -1072,7 +1072,7 @@ BOOL samr_add_aliasmem(struct cli_state *cli,
/****************************************************************************
do a SAMR Delete Domain Alias
****************************************************************************/
-BOOL samr_delete_dom_alias(struct cli_state *cli,
+BOOL samr_delete_dom_alias(struct cli_state *cli, uint16 fnum,
POLICY_HND *alias_pol)
{
prs_struct data;
@@ -1097,7 +1097,7 @@ BOOL samr_delete_dom_alias(struct cli_state *cli,
samr_io_q_delete_dom_alias("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_DELETE_DOM_ALIAS, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_DELETE_DOM_ALIAS, &data, &rdata))
{
SAMR_R_DELETE_DOM_ALIAS r_o;
BOOL p;
@@ -1127,7 +1127,7 @@ BOOL samr_delete_dom_alias(struct cli_state *cli,
/****************************************************************************
do a SAMR Create Domain Alias
****************************************************************************/
-BOOL samr_create_dom_alias(struct cli_state *cli,
+BOOL samr_create_dom_alias(struct cli_state *cli, uint16 fnum,
POLICY_HND *domain_pol, const char *acct_name,
POLICY_HND *alias_pol, uint32 *rid)
{
@@ -1153,7 +1153,7 @@ BOOL samr_create_dom_alias(struct cli_state *cli,
samr_io_q_create_dom_alias("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_CREATE_DOM_ALIAS, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_CREATE_DOM_ALIAS, &data, &rdata))
{
SAMR_R_CREATE_DOM_ALIAS r_o;
BOOL p;
@@ -1185,7 +1185,7 @@ BOOL samr_create_dom_alias(struct cli_state *cli,
/****************************************************************************
do a SAMR Set Alias Info
****************************************************************************/
-BOOL samr_set_aliasinfo(struct cli_state *cli,
+BOOL samr_set_aliasinfo(struct cli_state *cli, uint16 fnum,
POLICY_HND *alias_pol, ALIAS_INFO_CTR *ctr)
{
prs_struct data;
@@ -1210,7 +1210,7 @@ BOOL samr_set_aliasinfo(struct cli_state *cli,
samr_io_q_set_aliasinfo("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_SET_ALIASINFO, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_SET_ALIASINFO, &data, &rdata))
{
SAMR_R_SET_ALIASINFO r_o;
BOOL p;
@@ -1240,7 +1240,7 @@ BOOL samr_set_aliasinfo(struct cli_state *cli,
/****************************************************************************
do a SAMR Open Group
****************************************************************************/
-BOOL samr_open_group(struct cli_state *cli,
+BOOL samr_open_group(struct cli_state *cli, uint16 fnum,
POLICY_HND *domain_pol,
uint32 flags, uint32 rid,
POLICY_HND *group_pol)
@@ -1267,7 +1267,7 @@ BOOL samr_open_group(struct cli_state *cli,
samr_io_q_open_group("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_OPEN_GROUP, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_OPEN_GROUP, &data, &rdata))
{
SAMR_R_OPEN_GROUP r_o;
BOOL p;
@@ -1298,7 +1298,7 @@ BOOL samr_open_group(struct cli_state *cli,
/****************************************************************************
do a SAMR Delete Group Member
****************************************************************************/
-BOOL samr_del_groupmem(struct cli_state *cli,
+BOOL samr_del_groupmem(struct cli_state *cli, uint16 fnum,
POLICY_HND *group_pol, uint32 rid)
{
prs_struct data;
@@ -1323,7 +1323,7 @@ BOOL samr_del_groupmem(struct cli_state *cli,
samr_io_q_del_groupmem("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_DEL_GROUPMEM, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_DEL_GROUPMEM, &data, &rdata))
{
SAMR_R_DEL_GROUPMEM r_o;
BOOL p;
@@ -1353,7 +1353,7 @@ BOOL samr_del_groupmem(struct cli_state *cli,
/****************************************************************************
do a SAMR Add Group Member
****************************************************************************/
-BOOL samr_add_groupmem(struct cli_state *cli,
+BOOL samr_add_groupmem(struct cli_state *cli, uint16 fnum,
POLICY_HND *group_pol, uint32 rid)
{
prs_struct data;
@@ -1378,7 +1378,7 @@ BOOL samr_add_groupmem(struct cli_state *cli,
samr_io_q_add_groupmem("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_ADD_GROUPMEM, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_ADD_GROUPMEM, &data, &rdata))
{
SAMR_R_ADD_GROUPMEM r_o;
BOOL p;
@@ -1408,7 +1408,7 @@ BOOL samr_add_groupmem(struct cli_state *cli,
/****************************************************************************
do a SAMR Delete Domain Group
****************************************************************************/
-BOOL samr_delete_dom_group(struct cli_state *cli, POLICY_HND *group_pol)
+BOOL samr_delete_dom_group(struct cli_state *cli, uint16 fnum, POLICY_HND *group_pol)
{
prs_struct data;
prs_struct rdata;
@@ -1432,7 +1432,7 @@ BOOL samr_delete_dom_group(struct cli_state *cli, POLICY_HND *group_pol)
samr_io_q_delete_dom_group("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_DELETE_DOM_GROUP, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_DELETE_DOM_GROUP, &data, &rdata))
{
SAMR_R_DELETE_DOM_GROUP r_o;
BOOL p;
@@ -1462,7 +1462,7 @@ BOOL samr_delete_dom_group(struct cli_state *cli, POLICY_HND *group_pol)
/****************************************************************************
do a SAMR Create Domain Group
****************************************************************************/
-BOOL samr_create_dom_group(struct cli_state *cli,
+BOOL samr_create_dom_group(struct cli_state *cli, uint16 fnum,
POLICY_HND *domain_pol, const char *acct_name,
POLICY_HND *group_pol, uint32 *rid)
{
@@ -1488,7 +1488,7 @@ BOOL samr_create_dom_group(struct cli_state *cli,
samr_io_q_create_dom_group("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_CREATE_DOM_GROUP, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_CREATE_DOM_GROUP, &data, &rdata))
{
SAMR_R_CREATE_DOM_GROUP r_o;
BOOL p;
@@ -1520,7 +1520,7 @@ BOOL samr_create_dom_group(struct cli_state *cli,
/****************************************************************************
do a SAMR Set Group Info
****************************************************************************/
-BOOL samr_set_groupinfo(struct cli_state *cli,
+BOOL samr_set_groupinfo(struct cli_state *cli, uint16 fnum,
POLICY_HND *group_pol, GROUP_INFO_CTR *ctr)
{
prs_struct data;
@@ -1545,7 +1545,7 @@ BOOL samr_set_groupinfo(struct cli_state *cli,
samr_io_q_set_groupinfo("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_SET_GROUPINFO, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_SET_GROUPINFO, &data, &rdata))
{
SAMR_R_SET_GROUPINFO r_o;
BOOL p;
@@ -1575,7 +1575,7 @@ BOOL samr_set_groupinfo(struct cli_state *cli,
/****************************************************************************
do a SAMR Open Domain
****************************************************************************/
-BOOL samr_open_domain(struct cli_state *cli,
+BOOL samr_open_domain(struct cli_state *cli, uint16 fnum,
POLICY_HND *connect_pol, uint32 flags, DOM_SID *sid,
POLICY_HND *domain_pol)
{
@@ -1603,7 +1603,7 @@ BOOL samr_open_domain(struct cli_state *cli,
samr_io_q_open_domain("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_OPEN_DOMAIN, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_OPEN_DOMAIN, &data, &rdata))
{
SAMR_R_OPEN_DOMAIN r_o;
BOOL p;
@@ -1634,7 +1634,7 @@ BOOL samr_open_domain(struct cli_state *cli,
/****************************************************************************
do a SAMR Query Lookup Names
****************************************************************************/
-BOOL samr_query_lookup_names(struct cli_state *cli,
+BOOL samr_query_lookup_names(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol, uint32 flags,
uint32 num_names, const char **names,
uint32 *num_rids,
@@ -1664,7 +1664,7 @@ BOOL samr_query_lookup_names(struct cli_state *cli,
samr_io_q_lookup_names("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_LOOKUP_NAMES, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_LOOKUP_NAMES, &data, &rdata))
{
SAMR_R_LOOKUP_NAMES r_o;
BOOL p;
@@ -1719,7 +1719,7 @@ BOOL samr_query_lookup_names(struct cli_state *cli,
/****************************************************************************
do a SAMR Query Lookup RIDS
****************************************************************************/
-BOOL samr_query_lookup_rids(struct cli_state *cli,
+BOOL samr_query_lookup_rids(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol, uint32 flags,
uint32 num_rids, uint32 *rids,
uint32 *num_names,
@@ -1749,7 +1749,7 @@ BOOL samr_query_lookup_rids(struct cli_state *cli,
samr_io_q_lookup_rids("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_LOOKUP_RIDS, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_LOOKUP_RIDS, &data, &rdata))
{
SAMR_R_LOOKUP_RIDS r_o;
BOOL p;
@@ -1804,7 +1804,7 @@ BOOL samr_query_lookup_rids(struct cli_state *cli,
/****************************************************************************
do a SAMR Query Alias Members
****************************************************************************/
-BOOL samr_query_aliasmem(struct cli_state *cli,
+BOOL samr_query_aliasmem(struct cli_state *cli, uint16 fnum,
POLICY_HND *alias_pol,
uint32 *num_mem, DOM_SID2 *sid)
{
@@ -1830,7 +1830,7 @@ BOOL samr_query_aliasmem(struct cli_state *cli,
samr_io_q_query_aliasmem("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_QUERY_ALIASMEM, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_ALIASMEM, &data, &rdata))
{
SAMR_R_QUERY_ALIASMEM r_o;
BOOL p;
@@ -1865,7 +1865,7 @@ BOOL samr_query_aliasmem(struct cli_state *cli,
/****************************************************************************
do a SAMR Query User Aliases
****************************************************************************/
-BOOL samr_query_useraliases(struct cli_state *cli,
+BOOL samr_query_useraliases(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol, DOM_SID *sid,
uint32 *num_aliases, uint32 *rid)
{
@@ -1891,7 +1891,7 @@ BOOL samr_query_useraliases(struct cli_state *cli,
samr_io_q_query_useraliases("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_QUERY_USERALIASES, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_USERALIASES, &data, &rdata))
{
SAMR_R_QUERY_USERALIASES r_o;
BOOL p;
@@ -1926,7 +1926,7 @@ BOOL samr_query_useraliases(struct cli_state *cli,
/****************************************************************************
do a SAMR Query Group Members
****************************************************************************/
-BOOL samr_query_groupmem(struct cli_state *cli,
+BOOL samr_query_groupmem(struct cli_state *cli, uint16 fnum,
POLICY_HND *group_pol,
uint32 *num_mem, uint32 *rid, uint32 *attr)
{
@@ -1952,7 +1952,7 @@ BOOL samr_query_groupmem(struct cli_state *cli,
samr_io_q_query_groupmem("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_QUERY_GROUPMEM, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_GROUPMEM, &data, &rdata))
{
SAMR_R_QUERY_GROUPMEM r_o;
BOOL p;
@@ -1990,7 +1990,7 @@ BOOL samr_query_groupmem(struct cli_state *cli,
/****************************************************************************
do a SAMR Query User Groups
****************************************************************************/
-BOOL samr_query_usergroups(struct cli_state *cli,
+BOOL samr_query_usergroups(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol, uint32 *num_groups, DOM_GID *gid)
{
prs_struct data;
@@ -2015,7 +2015,7 @@ BOOL samr_query_usergroups(struct cli_state *cli,
samr_io_q_query_usergroups("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_QUERY_USERGROUPS, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_USERGROUPS, &data, &rdata))
{
SAMR_R_QUERY_USERGROUPS r_o;
BOOL p;
@@ -2050,7 +2050,7 @@ BOOL samr_query_usergroups(struct cli_state *cli,
/****************************************************************************
do a SAMR Query Group Info
****************************************************************************/
-BOOL samr_query_groupinfo(struct cli_state *cli,
+BOOL samr_query_groupinfo(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol,
uint16 switch_value, GROUP_INFO_CTR* ctr)
{
@@ -2076,7 +2076,7 @@ BOOL samr_query_groupinfo(struct cli_state *cli,
samr_io_q_query_groupinfo("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_QUERY_GROUPINFO, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_GROUPINFO, &data, &rdata))
{
SAMR_R_QUERY_GROUPINFO r_o;
BOOL p;
@@ -2115,7 +2115,7 @@ BOOL samr_query_groupinfo(struct cli_state *cli,
/****************************************************************************
do a SAMR Query User Info
****************************************************************************/
-BOOL samr_query_userinfo(struct cli_state *cli,
+BOOL samr_query_userinfo(struct cli_state *cli, uint16 fnum,
POLICY_HND *pol, uint16 switch_value, void* usr)
{
prs_struct data;
@@ -2140,7 +2140,7 @@ BOOL samr_query_userinfo(struct cli_state *cli,
samr_io_q_query_userinfo("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_QUERY_USERINFO, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_USERINFO, &data, &rdata))
{
SAMR_R_QUERY_USERINFO r_o;
BOOL p;
@@ -2179,7 +2179,7 @@ BOOL samr_query_userinfo(struct cli_state *cli,
/****************************************************************************
do a SAMR Close
****************************************************************************/
-BOOL samr_close(struct cli_state *cli, POLICY_HND *hnd)
+BOOL samr_close(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd)
{
prs_struct data;
prs_struct rdata;
@@ -2203,7 +2203,7 @@ BOOL samr_close(struct cli_state *cli, POLICY_HND *hnd)
samr_io_q_close_hnd("", &q_c, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SAMR_CLOSE_HND, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SAMR_CLOSE_HND, &data, &rdata))
{
SAMR_R_CLOSE_HND r_c;
BOOL p;
diff --git a/source3/rpc_client/cli_srvsvc.c b/source3/rpc_client/cli_srvsvc.c
index d42a2985f0..86862c7a2a 100644
--- a/source3/rpc_client/cli_srvsvc.c
+++ b/source3/rpc_client/cli_srvsvc.c
@@ -34,7 +34,7 @@ extern int DEBUGLEVEL;
/****************************************************************************
do a server net conn enum
****************************************************************************/
-BOOL do_srv_net_srv_conn_enum(struct cli_state *cli,
+BOOL do_srv_net_srv_conn_enum(struct cli_state *cli, uint16 fnum,
char *server_name, char *qual_name,
uint32 switch_value, SRV_CONN_INFO_CTR *ctr,
uint32 preferred_len,
@@ -70,7 +70,7 @@ BOOL do_srv_net_srv_conn_enum(struct cli_state *cli,
srv_io_q_net_conn_enum("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SRV_NETCONNENUM, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SRV_NETCONNENUM, &data, &rdata))
{
SRV_R_NET_CONN_ENUM r_o;
BOOL p;
@@ -111,7 +111,7 @@ BOOL do_srv_net_srv_conn_enum(struct cli_state *cli,
/****************************************************************************
do a server net sess enum
****************************************************************************/
-BOOL do_srv_net_srv_sess_enum(struct cli_state *cli,
+BOOL do_srv_net_srv_sess_enum(struct cli_state *cli, uint16 fnum,
char *server_name, char *qual_name,
uint32 switch_value, SRV_SESS_INFO_CTR *ctr,
uint32 preferred_len,
@@ -147,7 +147,7 @@ BOOL do_srv_net_srv_sess_enum(struct cli_state *cli,
srv_io_q_net_sess_enum("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SRV_NETSESSENUM, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SRV_NETSESSENUM, &data, &rdata))
{
SRV_R_NET_SESS_ENUM r_o;
BOOL p;
@@ -188,7 +188,7 @@ BOOL do_srv_net_srv_sess_enum(struct cli_state *cli,
/****************************************************************************
do a server net share enum
****************************************************************************/
-BOOL do_srv_net_srv_share_enum(struct cli_state *cli,
+BOOL do_srv_net_srv_share_enum(struct cli_state *cli, uint16 fnum,
char *server_name,
uint32 switch_value, SRV_SHARE_INFO_CTR *ctr,
uint32 preferred_len,
@@ -226,7 +226,7 @@ BOOL do_srv_net_srv_share_enum(struct cli_state *cli,
srv_io_q_net_share_enum("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SRV_NETSHAREENUM, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SRV_NETSHAREENUM, &data, &rdata))
{
SRV_R_NET_SHARE_ENUM r_o;
BOOL p;
@@ -267,7 +267,7 @@ BOOL do_srv_net_srv_share_enum(struct cli_state *cli,
/****************************************************************************
do a server net file enum
****************************************************************************/
-BOOL do_srv_net_srv_file_enum(struct cli_state *cli,
+BOOL do_srv_net_srv_file_enum(struct cli_state *cli, uint16 fnum,
char *server_name, char *qual_name,
uint32 switch_value, SRV_FILE_INFO_CTR *ctr,
uint32 preferred_len,
@@ -305,7 +305,7 @@ BOOL do_srv_net_srv_file_enum(struct cli_state *cli,
srv_io_q_net_file_enum("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SRV_NETFILEENUM, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SRV_NETFILEENUM, &data, &rdata))
{
SRV_R_NET_FILE_ENUM r_o;
BOOL p;
@@ -346,7 +346,7 @@ BOOL do_srv_net_srv_file_enum(struct cli_state *cli,
/****************************************************************************
do a server get info
****************************************************************************/
-BOOL do_srv_net_srv_get_info(struct cli_state *cli,
+BOOL do_srv_net_srv_get_info(struct cli_state *cli, uint16 fnum,
char *server_name, uint32 switch_value, SRV_INFO_CTR *ctr)
{
prs_struct data;
@@ -370,7 +370,7 @@ BOOL do_srv_net_srv_get_info(struct cli_state *cli,
srv_io_q_net_srv_get_info("", &q_o, &data, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, SRV_NET_SRV_GET_INFO, &data, &rdata))
+ if (rpc_api_pipe_req(cli, fnum, SRV_NET_SRV_GET_INFO, &data, &rdata))
{
SRV_R_NET_SRV_GET_INFO r_o;
BOOL p;
diff --git a/source3/rpc_client/cli_wkssvc.c b/source3/rpc_client/cli_wkssvc.c
index e45016c1b8..06ba8b88c8 100644
--- a/source3/rpc_client/cli_wkssvc.c
+++ b/source3/rpc_client/cli_wkssvc.c
@@ -34,7 +34,7 @@ extern int DEBUGLEVEL;
/****************************************************************************
do a WKS Open Policy
****************************************************************************/
-BOOL do_wks_query_info(struct cli_state *cli,
+BOOL do_wks_query_info(struct cli_state *cli, uint16 fnum,
char *server_name, uint32 switch_value,
WKS_INFO_100 *wks100)
{
@@ -59,7 +59,7 @@ BOOL do_wks_query_info(struct cli_state *cli,
wks_io_q_query_info("", &q_o, &buf, 0);
/* send the data on \PIPE\ */
- if (rpc_api_pipe_req(cli, WKS_QUERY_INFO, &buf, &rbuf))
+ if (rpc_api_pipe_req(cli, fnum, WKS_QUERY_INFO, &buf, &rbuf))
{
WKS_R_QUERY_INFO r_o;
BOOL p;