mirror of
https://github.com/samba-team/samba.git
synced 2025-08-29 13:49:30 +03:00
cool! completed a samr* API that _would_ look like an msdn samr* api...
if microsoft bothered to publish it. actually, there are good reasons for not publishing it: people might write programs for it, and then those programs wouldn't work on nt5, for example...
This commit is contained in:
@ -1795,6 +1795,8 @@ BOOL cli_state_init(const char* server_name, const char* pipe_name,
|
||||
BOOL cli_state_get(const POLICY_HND *pol,
|
||||
struct cli_state **cli,
|
||||
uint16 *fnum);
|
||||
BOOL cli_pol_link(POLICY_HND *to, const POLICY_HND *from);
|
||||
BOOL cli_get_usr_sesskey(const POLICY_HND *pol, uchar sess_key[16]);
|
||||
|
||||
/*The following definitions come from rpc_client/cli_eventlog.c */
|
||||
|
||||
@ -1900,6 +1902,8 @@ BOOL create_rpc_bind_resp(struct pwd_info *pwd,
|
||||
prs_struct *rhdr,
|
||||
prs_struct *rhdr_autha,
|
||||
prs_struct *auth_resp);
|
||||
BOOL rpc_hnd_pipe_req(const POLICY_HND *hnd, uint8 op_num,
|
||||
prs_struct *data, prs_struct *rdata);
|
||||
BOOL rpc_api_pipe_req(struct cli_state *cli, uint16 fnum, uint8 op_num,
|
||||
prs_struct *data, prs_struct *rdata);
|
||||
void cli_nt_set_ntlmssp_flgs(struct cli_state *cli, uint32 ntlmssp_flgs);
|
||||
@ -1964,123 +1968,90 @@ BOOL reg_shutdown(const char *srv_name,
|
||||
|
||||
/*The following definitions come from rpc_client/cli_samr.c */
|
||||
|
||||
BOOL samr_chgpasswd_user(struct cli_state *cli, uint16 fnum,
|
||||
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]);
|
||||
BOOL samr_unknown_38(struct cli_state *cli, uint16 fnum, char *srv_name);
|
||||
BOOL samr_query_dom_info(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *domain_pol, uint16 switch_value,
|
||||
BOOL samr_query_dom_info( POLICY_HND *domain_pol, uint16 switch_value,
|
||||
SAM_UNK_CTR *ctr);
|
||||
uint32 samr_enum_domains(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol,
|
||||
uint32 samr_enum_domains( POLICY_HND *pol,
|
||||
uint32 *start_idx, uint32 size,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_domains);
|
||||
uint32 samr_enum_dom_groups(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol,
|
||||
uint32 samr_enum_dom_groups( POLICY_HND *pol,
|
||||
uint32 *start_idx, uint32 size,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_groups);
|
||||
uint32 samr_enum_dom_aliases(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol,
|
||||
uint32 samr_enum_dom_aliases( POLICY_HND *pol,
|
||||
uint32 *start_idx, uint32 size,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_aliases);
|
||||
uint32 samr_enum_dom_users(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint32 *start_idx,
|
||||
uint32 samr_enum_dom_users( POLICY_HND *pol, uint32 *start_idx,
|
||||
uint16 acb_mask, uint16 unk_1, uint32 size,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_users);
|
||||
BOOL samr_connect(struct cli_state *cli, uint16 fnum,
|
||||
const char *srv_name, uint32 unknown_0,
|
||||
BOOL samr_connect( const char *srv_name, uint32 unknown_0,
|
||||
POLICY_HND *connect_pol);
|
||||
BOOL samr_open_user(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *pol,
|
||||
BOOL samr_open_user( const POLICY_HND *pol,
|
||||
uint32 unk_0, uint32 rid,
|
||||
POLICY_HND *user_pol);
|
||||
BOOL samr_open_alias(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *domain_pol,
|
||||
BOOL samr_open_alias( const POLICY_HND *domain_pol,
|
||||
uint32 flags, uint32 rid,
|
||||
POLICY_HND *alias_pol);
|
||||
BOOL samr_del_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *alias_pol, DOM_SID *sid);
|
||||
BOOL samr_add_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *alias_pol, DOM_SID *sid);
|
||||
BOOL samr_delete_dom_alias(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *alias_pol);
|
||||
BOOL samr_create_dom_user(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *domain_pol, const char *acct_name,
|
||||
BOOL samr_del_aliasmem( POLICY_HND *alias_pol, DOM_SID *sid);
|
||||
BOOL samr_add_aliasmem( POLICY_HND *alias_pol, DOM_SID *sid);
|
||||
BOOL samr_delete_dom_alias( POLICY_HND *alias_pol);
|
||||
BOOL samr_create_dom_user( POLICY_HND *domain_pol, const char *acct_name,
|
||||
uint32 unk_0, uint32 unk_1,
|
||||
POLICY_HND *user_pol, uint32 *rid);
|
||||
BOOL samr_create_dom_alias(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *domain_pol, const char *acct_name,
|
||||
BOOL samr_create_dom_alias( POLICY_HND *domain_pol, const char *acct_name,
|
||||
POLICY_HND *alias_pol, uint32 *rid);
|
||||
BOOL samr_query_aliasinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *alias_pol, uint16 switch_value,
|
||||
BOOL samr_query_aliasinfo( POLICY_HND *alias_pol, uint16 switch_value,
|
||||
ALIAS_INFO_CTR *ctr);
|
||||
BOOL samr_set_aliasinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *alias_pol, ALIAS_INFO_CTR *ctr);
|
||||
BOOL samr_open_group(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *domain_pol,
|
||||
BOOL samr_set_aliasinfo( POLICY_HND *alias_pol, ALIAS_INFO_CTR *ctr);
|
||||
BOOL samr_open_group( const POLICY_HND *domain_pol,
|
||||
uint32 flags, uint32 rid,
|
||||
POLICY_HND *group_pol);
|
||||
BOOL samr_del_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *group_pol, uint32 rid);
|
||||
BOOL samr_add_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *group_pol, uint32 rid);
|
||||
BOOL samr_delete_dom_group(struct cli_state *cli, uint16 fnum, POLICY_HND *group_pol);
|
||||
BOOL samr_create_dom_group(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *domain_pol, const char *acct_name,
|
||||
BOOL samr_del_groupmem( POLICY_HND *group_pol, uint32 rid);
|
||||
BOOL samr_add_groupmem( POLICY_HND *group_pol, uint32 rid);
|
||||
BOOL samr_delete_dom_group( POLICY_HND *group_pol);
|
||||
BOOL samr_create_dom_group( POLICY_HND *domain_pol, const char *acct_name,
|
||||
POLICY_HND *group_pol, uint32 *rid);
|
||||
BOOL samr_set_groupinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *group_pol, GROUP_INFO_CTR *ctr);
|
||||
BOOL samr_open_domain(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *connect_pol,
|
||||
BOOL samr_set_groupinfo( POLICY_HND *group_pol, GROUP_INFO_CTR *ctr);
|
||||
BOOL samr_open_domain( const POLICY_HND *connect_pol,
|
||||
uint32 ace_perms,
|
||||
const DOM_SID *sid,
|
||||
POLICY_HND *domain_pol);
|
||||
BOOL samr_query_lookup_domain(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, const char *dom_name,
|
||||
BOOL samr_query_lookup_domain( POLICY_HND *pol, const char *dom_name,
|
||||
DOM_SID *dom_sid);
|
||||
BOOL samr_query_lookup_names(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint32 flags,
|
||||
BOOL samr_query_lookup_names( POLICY_HND *pol, uint32 flags,
|
||||
uint32 num_names, char **names,
|
||||
uint32 *num_rids,
|
||||
uint32 rid[MAX_LOOKUP_SIDS],
|
||||
uint32 type[MAX_LOOKUP_SIDS]);
|
||||
BOOL samr_query_lookup_rids(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *pol, uint32 flags,
|
||||
BOOL samr_query_lookup_rids( const POLICY_HND *pol, uint32 flags,
|
||||
uint32 num_rids, uint32 *rids,
|
||||
uint32 *num_names,
|
||||
char ***names,
|
||||
uint32 **type);
|
||||
BOOL samr_query_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *alias_pol,
|
||||
BOOL samr_query_aliasmem( const POLICY_HND *alias_pol,
|
||||
uint32 *num_mem, DOM_SID2 *sid);
|
||||
BOOL samr_query_useraliases(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *pol,
|
||||
BOOL samr_query_useraliases( const POLICY_HND *pol,
|
||||
uint32 *ptr_sid, DOM_SID2 *sid,
|
||||
uint32 *num_aliases, uint32 **rid);
|
||||
BOOL samr_query_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *group_pol,
|
||||
BOOL samr_query_groupmem( POLICY_HND *group_pol,
|
||||
uint32 *num_mem, uint32 **rid, uint32 **attr);
|
||||
BOOL samr_query_usergroups(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint32 *num_groups,
|
||||
BOOL samr_query_usergroups( POLICY_HND *pol, uint32 *num_groups,
|
||||
DOM_GID **gid);
|
||||
BOOL samr_query_groupinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol,
|
||||
BOOL samr_query_groupinfo( POLICY_HND *pol,
|
||||
uint16 switch_value, GROUP_INFO_CTR* ctr);
|
||||
BOOL samr_set_userinfo2(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint16 switch_value,
|
||||
BOOL samr_set_userinfo2( POLICY_HND *pol, uint16 switch_value,
|
||||
void* usr);
|
||||
BOOL samr_set_userinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint16 switch_value, void* usr);
|
||||
BOOL samr_query_userinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint16 switch_value, void* usr);
|
||||
BOOL samr_close(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd);
|
||||
BOOL samr_query_dispinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol_open_domain, uint16 level,
|
||||
BOOL samr_set_userinfo( POLICY_HND *pol, uint16 switch_value, void* usr);
|
||||
BOOL samr_query_userinfo( POLICY_HND *pol, uint16 switch_value, void* usr);
|
||||
BOOL samr_close( POLICY_HND *hnd);
|
||||
BOOL samr_query_dispinfo( POLICY_HND *pol_domain, uint16 level,
|
||||
uint32 *num_entries,
|
||||
SAM_DISPINFO_CTR *ctr);
|
||||
|
||||
@ -2187,13 +2158,12 @@ BOOL msrpc_lsa_query_secret(const char* srv_name,
|
||||
|
||||
/*The following definitions come from rpc_client/msrpc_samr.c */
|
||||
|
||||
BOOL req_user_info(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol_dom,
|
||||
BOOL req_user_info( POLICY_HND *pol_dom,
|
||||
const char *domain,
|
||||
const DOM_SID *sid,
|
||||
uint32 user_rid,
|
||||
USER_INFO_FN(usr_inf));
|
||||
uint32 sam_query_usergroups(struct cli_state *cli, uint16 fnum,
|
||||
uint32 sam_query_usergroups(
|
||||
const POLICY_HND *pol_dom,
|
||||
const char *domain,
|
||||
const DOM_SID *sid,
|
||||
@ -2204,132 +2174,123 @@ uint32 sam_query_usergroups(struct cli_state *cli, uint16 fnum,
|
||||
char ***name,
|
||||
uint32 **type,
|
||||
USER_MEM_FN(usr_mem));
|
||||
int msrpc_sam_enum_users(struct cli_state *cli,
|
||||
int msrpc_sam_enum_users( const char* srv_name,
|
||||
const char* domain,
|
||||
const DOM_SID *sid1,
|
||||
const char* srv_name,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_entries,
|
||||
USER_FN(usr_fn),
|
||||
USER_INFO_FN(usr_inf_fn),
|
||||
USER_MEM_FN(usr_grp_fn),
|
||||
USER_MEM_FN(usr_als_fn));
|
||||
BOOL sam_query_dominfo(struct cli_state *cli,
|
||||
BOOL sam_query_dominfo(const char* srv_name,
|
||||
const DOM_SID *sid1,
|
||||
uint32 switch_value, SAM_UNK_CTR *ctr);
|
||||
BOOL query_aliasinfo(struct cli_state *cli, uint16 fnum,
|
||||
BOOL query_aliasinfo(
|
||||
const POLICY_HND *pol_dom,
|
||||
const char *domain,
|
||||
const DOM_SID *sid,
|
||||
uint32 alias_rid,
|
||||
ALIAS_INFO_FN(grp_inf));
|
||||
BOOL sam_query_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
BOOL sam_query_aliasmem(const char *srv_name,
|
||||
const POLICY_HND *pol_dom,
|
||||
uint32 alias_rid,
|
||||
uint32 *num_names,
|
||||
DOM_SID ***sids,
|
||||
char ***name,
|
||||
uint8 **type);
|
||||
BOOL req_aliasmem_info(struct cli_state *cli, uint16 fnum,
|
||||
BOOL req_aliasmem_info(const char* srv_name,
|
||||
const POLICY_HND *pol_dom,
|
||||
const char *domain,
|
||||
const DOM_SID *sid,
|
||||
uint32 alias_rid,
|
||||
const char *alias_name,
|
||||
ALIAS_MEM_FN(als_mem));
|
||||
BOOL sam_query_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
BOOL sam_query_groupmem(
|
||||
const POLICY_HND *pol_dom,
|
||||
uint32 group_rid,
|
||||
uint32 *num_names,
|
||||
uint32 **rid_mem,
|
||||
char ***name,
|
||||
uint32 **type);
|
||||
BOOL query_groupinfo(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *pol_dom,
|
||||
BOOL query_groupinfo( const POLICY_HND *pol_dom,
|
||||
const char *domain,
|
||||
const DOM_SID *sid,
|
||||
uint32 group_rid,
|
||||
GROUP_INFO_FN(grp_inf));
|
||||
BOOL req_groupmem_info(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *pol_dom,
|
||||
BOOL req_groupmem_info( const POLICY_HND *pol_dom,
|
||||
const char *domain,
|
||||
const DOM_SID *sid,
|
||||
uint32 group_rid,
|
||||
const char *group_name,
|
||||
GROUP_MEM_FN(grp_mem));
|
||||
uint32 msrpc_sam_enum_domains(struct cli_state *cli,
|
||||
const char* srv_name,
|
||||
uint32 msrpc_sam_enum_domains( const char* srv_name,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_entries,
|
||||
DOMAIN_FN(dom_fn));
|
||||
uint32 msrpc_sam_enum_groups(struct cli_state *cli,
|
||||
uint32 msrpc_sam_enum_groups( const char* srv_name,
|
||||
const char* domain,
|
||||
const DOM_SID *sid1,
|
||||
const char* srv_name,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_entries,
|
||||
GROUP_FN(grp_fn),
|
||||
GROUP_INFO_FN(grp_inf_fn),
|
||||
GROUP_MEM_FN(grp_mem_fn));
|
||||
uint32 msrpc_sam_enum_aliases(struct cli_state *cli,
|
||||
uint32 msrpc_sam_enum_aliases( const char* srv_name,
|
||||
const char* domain,
|
||||
const DOM_SID *sid1,
|
||||
const char* srv_name,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_entries,
|
||||
ALIAS_FN(als_fn),
|
||||
ALIAS_INFO_FN(als_inf_fn),
|
||||
ALIAS_MEM_FN(als_mem_fn));
|
||||
BOOL create_samr_domain_user(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol_open_domain,
|
||||
BOOL create_samr_domain_user( POLICY_HND *pol_open_domain,
|
||||
const char *acct_name, uint16 acb_info,
|
||||
uint32 *rid);
|
||||
BOOL create_samr_domain_alias(struct cli_state *cli, uint16 fnum,
|
||||
BOOL create_samr_domain_alias( POLICY_HND *pol_open_domain,
|
||||
const char *acct_name, const char *acct_desc,
|
||||
uint32 *rid);
|
||||
BOOL create_samr_domain_group(
|
||||
POLICY_HND *pol_open_domain,
|
||||
const char *acct_name, const char *acct_desc,
|
||||
uint32 *rid);
|
||||
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);
|
||||
BOOL get_samr_query_usergroups(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *pol_open_domain,
|
||||
BOOL get_samr_query_usergroups( const POLICY_HND *pol_open_domain,
|
||||
uint32 user_rid,
|
||||
uint32 *num_groups, DOM_GID **gid);
|
||||
BOOL delete_samr_dom_group(struct cli_state *cli, uint16 fnum,
|
||||
BOOL delete_samr_dom_group(
|
||||
POLICY_HND *pol_open_domain,
|
||||
uint32 group_rid);
|
||||
BOOL get_samr_query_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
BOOL get_samr_query_groupmem(
|
||||
const POLICY_HND *pol_open_domain,
|
||||
uint32 group_rid, uint32 *num_mem,
|
||||
uint32 **rid, uint32 **attr);
|
||||
BOOL delete_samr_dom_alias(struct cli_state *cli, uint16 fnum,
|
||||
BOOL delete_samr_dom_alias(
|
||||
POLICY_HND *pol_open_domain,
|
||||
uint32 alias_rid);
|
||||
BOOL get_samr_query_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
BOOL get_samr_query_aliasmem(
|
||||
const POLICY_HND *pol_open_domain,
|
||||
uint32 alias_rid, uint32 *num_mem, DOM_SID2 *sid);
|
||||
BOOL set_samr_set_userinfo2(struct cli_state *cli, uint16 fnum,
|
||||
BOOL set_samr_set_userinfo2(
|
||||
POLICY_HND *pol_open_domain,
|
||||
uint32 info_level,
|
||||
uint32 user_rid, void *usr);
|
||||
BOOL set_samr_set_userinfo(struct cli_state *cli, uint16 fnum,
|
||||
BOOL set_samr_set_userinfo(
|
||||
POLICY_HND *pol_open_domain,
|
||||
uint32 info_level,
|
||||
uint32 user_rid, void *usr);
|
||||
BOOL get_samr_query_userinfo(struct cli_state *cli, uint16 fnum,
|
||||
BOOL get_samr_query_userinfo(
|
||||
POLICY_HND *pol_open_domain,
|
||||
uint32 info_level,
|
||||
uint32 user_rid, void *usr);
|
||||
BOOL get_samr_query_groupinfo(struct cli_state *cli, uint16 fnum,
|
||||
BOOL get_samr_query_groupinfo(
|
||||
const POLICY_HND *pol_open_domain,
|
||||
uint32 info_level,
|
||||
uint32 group_rid, GROUP_INFO_CTR *ctr);
|
||||
BOOL get_samr_query_aliasinfo(struct cli_state *cli, uint16 fnum,
|
||||
BOOL get_samr_query_aliasinfo(
|
||||
const POLICY_HND *pol_open_domain,
|
||||
uint32 info_level,
|
||||
uint32 alias_rid, ALIAS_INFO_CTR *ctr);
|
||||
BOOL msrpc_sam_create_dom_user(struct cli_state *cli, DOM_SID *sid1,
|
||||
BOOL msrpc_sam_create_dom_user(const char* srv_name, DOM_SID *sid1,
|
||||
char *acct_name, uint16 acb_info,
|
||||
uint32 *rid);
|
||||
|
||||
|
@ -411,8 +411,14 @@ BOOL get_policy_cli_state(const POLICY_HND *hnd, struct cli_state **cli,
|
||||
{
|
||||
DEBUG(3,("Getting cli state pnum=%x\n", p->pnum));
|
||||
|
||||
(*cli ) = p->dev.cli->cli;
|
||||
(*fnum) = p->dev.cli->fnum;
|
||||
if (cli != NULL)
|
||||
{
|
||||
(*cli ) = p->dev.cli->cli;
|
||||
}
|
||||
if (fnum != NULL)
|
||||
{
|
||||
(*fnum) = p->dev.cli->fnum;
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
|
@ -625,6 +625,23 @@ static BOOL create_rpc_request(prs_struct *rhdr, uint8 op_num, int data_len,
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
send a request on an rpc pipe.
|
||||
****************************************************************************/
|
||||
BOOL rpc_hnd_pipe_req(const POLICY_HND *hnd, uint8 op_num,
|
||||
prs_struct *data, prs_struct *rdata)
|
||||
{
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
return rpc_api_pipe_req(cli, fnum, op_num, data, rdata);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
send a request on an rpc pipe.
|
||||
****************************************************************************/
|
||||
|
@ -300,14 +300,6 @@ BOOL reg_flush_key( POLICY_HND *hnd)
|
||||
REG_Q_FLUSH_KEY q_o;
|
||||
BOOL valid_query = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -323,7 +315,7 @@ BOOL reg_flush_key( POLICY_HND *hnd)
|
||||
reg_io_q_flush_key("", &q_o, &buf, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, REG_FLUSH_KEY, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_FLUSH_KEY, &buf, &rbuf))
|
||||
{
|
||||
REG_R_FLUSH_KEY r_o;
|
||||
BOOL p;
|
||||
@ -367,14 +359,6 @@ BOOL reg_query_key( POLICY_HND *hnd,
|
||||
REG_Q_QUERY_KEY q_o;
|
||||
BOOL valid_query = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -390,7 +374,7 @@ BOOL reg_query_key( POLICY_HND *hnd,
|
||||
reg_io_q_query_key("", &q_o, &buf, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, REG_QUERY_KEY, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_QUERY_KEY, &buf, &rbuf))
|
||||
{
|
||||
REG_R_QUERY_KEY r_o;
|
||||
BOOL p;
|
||||
@ -440,14 +424,6 @@ BOOL reg_unknown_1a( POLICY_HND *hnd, uint32 *unk)
|
||||
REG_Q_UNK_1A q_o;
|
||||
BOOL valid_query = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -463,7 +439,7 @@ BOOL reg_unknown_1a( 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, fnum, REG_UNK_1A, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_UNK_1A, &buf, &rbuf))
|
||||
{
|
||||
REG_R_UNK_1A r_o;
|
||||
BOOL p;
|
||||
@ -505,14 +481,6 @@ BOOL reg_query_info( POLICY_HND *hnd,
|
||||
REG_Q_INFO q_o;
|
||||
BOOL valid_query = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -528,7 +496,7 @@ BOOL reg_query_info( POLICY_HND *hnd,
|
||||
reg_io_q_info("", &q_o, &buf, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, REG_INFO, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_INFO, &buf, &rbuf))
|
||||
{
|
||||
REG_R_INFO r_o;
|
||||
BOOL p;
|
||||
@ -572,14 +540,6 @@ BOOL reg_set_key_sec( POLICY_HND *hnd,
|
||||
REG_Q_SET_KEY_SEC q_o;
|
||||
BOOL valid_query = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -595,7 +555,7 @@ BOOL reg_set_key_sec( POLICY_HND *hnd,
|
||||
reg_io_q_set_key_sec("", &q_o, &buf, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, REG_SET_KEY_SEC, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_SET_KEY_SEC, &buf, &rbuf))
|
||||
{
|
||||
REG_R_SET_KEY_SEC r_o;
|
||||
BOOL p;
|
||||
@ -630,14 +590,6 @@ BOOL reg_get_key_sec( POLICY_HND *hnd,
|
||||
REG_Q_GET_KEY_SEC q_o;
|
||||
BOOL valid_query = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -653,7 +605,7 @@ BOOL reg_get_key_sec( POLICY_HND *hnd,
|
||||
reg_io_q_get_key_sec("", &q_o, &buf, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, REG_GET_KEY_SEC, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_GET_KEY_SEC, &buf, &rbuf))
|
||||
{
|
||||
REG_R_GET_KEY_SEC r_o;
|
||||
BOOL p;
|
||||
@ -706,14 +658,6 @@ BOOL reg_delete_val( POLICY_HND *hnd, char *val_name)
|
||||
REG_Q_DELETE_VALUE q_o;
|
||||
BOOL valid_delete = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -729,7 +673,7 @@ BOOL reg_delete_val( 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, fnum, REG_DELETE_VALUE, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_DELETE_VALUE, &buf, &rbuf))
|
||||
{
|
||||
REG_R_DELETE_VALUE r_o;
|
||||
BOOL p;
|
||||
@ -768,14 +712,6 @@ BOOL reg_delete_key( POLICY_HND *hnd, char *key_name)
|
||||
REG_Q_DELETE_KEY q_o;
|
||||
BOOL valid_delete = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -791,7 +727,7 @@ BOOL reg_delete_key( 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, fnum, REG_DELETE_KEY, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_DELETE_KEY, &buf, &rbuf))
|
||||
{
|
||||
REG_R_DELETE_KEY r_o;
|
||||
BOOL p;
|
||||
@ -836,14 +772,6 @@ BOOL reg_create_key( POLICY_HND *hnd,
|
||||
SEC_DESC_BUF sec_buf;
|
||||
int sec_len;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
ZERO_STRUCT(sec);
|
||||
ZERO_STRUCT(sec_buf);
|
||||
ZERO_STRUCT(q_o);
|
||||
@ -870,7 +798,7 @@ BOOL reg_create_key( POLICY_HND *hnd,
|
||||
reg_io_q_create_key("", &q_o, &buf, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, REG_CREATE_KEY, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_CREATE_KEY, &buf, &rbuf))
|
||||
{
|
||||
REG_R_CREATE_KEY r_o;
|
||||
BOOL p;
|
||||
@ -915,14 +843,6 @@ BOOL reg_enum_key( POLICY_HND *hnd,
|
||||
REG_Q_ENUM_KEY q_o;
|
||||
BOOL valid_query = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -938,7 +858,7 @@ BOOL reg_enum_key( POLICY_HND *hnd,
|
||||
reg_io_q_enum_key("", &q_o, &buf, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, REG_ENUM_KEY, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_ENUM_KEY, &buf, &rbuf))
|
||||
{
|
||||
REG_R_ENUM_KEY r_o;
|
||||
BOOL p;
|
||||
@ -983,14 +903,6 @@ BOOL reg_create_val( POLICY_HND *hnd,
|
||||
REG_Q_CREATE_VALUE q_o;
|
||||
BOOL valid_create = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -1006,7 +918,7 @@ BOOL reg_create_val( POLICY_HND *hnd,
|
||||
reg_io_q_create_val("", &q_o, &buf, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, REG_CREATE_VALUE, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_CREATE_VALUE, &buf, &rbuf))
|
||||
{
|
||||
REG_R_CREATE_VALUE r_o;
|
||||
BOOL p;
|
||||
@ -1048,14 +960,6 @@ BOOL reg_enum_val( POLICY_HND *hnd,
|
||||
REG_Q_ENUM_VALUE q_o;
|
||||
BOOL valid_query = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -1071,7 +975,7 @@ BOOL reg_enum_val( POLICY_HND *hnd,
|
||||
reg_io_q_enum_val("", &q_o, &buf, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, REG_ENUM_VALUE, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_ENUM_VALUE, &buf, &rbuf))
|
||||
{
|
||||
REG_R_ENUM_VALUE r_o;
|
||||
BOOL p;
|
||||
@ -1115,14 +1019,6 @@ BOOL reg_open_entry( POLICY_HND *hnd,
|
||||
REG_Q_OPEN_ENTRY q_o;
|
||||
BOOL valid_pol = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
|
||||
@ -1138,7 +1034,7 @@ BOOL reg_open_entry( POLICY_HND *hnd,
|
||||
reg_io_q_open_entry("", &q_o, &buf, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, REG_OPEN_ENTRY, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_OPEN_ENTRY, &buf, &rbuf))
|
||||
{
|
||||
REG_R_OPEN_ENTRY r_o;
|
||||
BOOL p;
|
||||
@ -1157,9 +1053,16 @@ BOOL reg_open_entry( POLICY_HND *hnd,
|
||||
|
||||
if (p)
|
||||
{
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
memcpy(key_hnd, r_o.pol.data, sizeof(key_hnd->data));
|
||||
valid_pol = register_policy_hnd(key_hnd) &&
|
||||
set_policy_cli_state(key_hnd, cli, fnum, NULL);
|
||||
valid_pol = cli_pol_link(key_hnd, hnd);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1179,14 +1082,6 @@ BOOL reg_close( POLICY_HND *hnd)
|
||||
REG_Q_CLOSE q_c;
|
||||
BOOL valid_close = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(hnd, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
if (hnd == NULL) return False;
|
||||
|
||||
/* create and send a MSRPC command with api REG_CLOSE */
|
||||
@ -1203,7 +1098,7 @@ BOOL reg_close( POLICY_HND *hnd)
|
||||
reg_io_q_close("", &q_c, &buf, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, REG_CLOSE, &buf, &rbuf))
|
||||
if (rpc_hnd_pipe_req(hnd, REG_CLOSE, &buf, &rbuf))
|
||||
{
|
||||
REG_R_CLOSE r_c;
|
||||
BOOL p;
|
||||
@ -1263,7 +1158,7 @@ BOOL reg_shutdown(const char *srv_name,
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_init(srv_name, PIPE_WINREG, &cli, &fnum))
|
||||
if (!cli_state_init(srv_name, PIPE_LSARPC, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
@ -31,11 +31,29 @@
|
||||
|
||||
extern int DEBUGLEVEL;
|
||||
|
||||
#if 0
|
||||
if (p)
|
||||
{
|
||||
/* ok, at last: we're happy. return the policy handle */
|
||||
memcpy(hnd, r_o.pol.data, sizeof(hnd->data));
|
||||
valid_pol = register_policy_hnd(hnd) &&
|
||||
set_policy_cli_state(hnd, cli, fnum,
|
||||
cli_state_free);
|
||||
}
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_get(connect_pol, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
do a SAMR change user password command
|
||||
****************************************************************************/
|
||||
BOOL samr_chgpasswd_user(struct cli_state *cli, uint16 fnum,
|
||||
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])
|
||||
@ -86,6 +104,8 @@ BOOL samr_chgpasswd_user(struct cli_state *cli, uint16 fnum,
|
||||
prs_mem_free(&data );
|
||||
prs_mem_free(&rdata );
|
||||
|
||||
cli_state_free(cli, fnum);
|
||||
|
||||
return valid_pwc;
|
||||
}
|
||||
|
||||
@ -145,8 +165,7 @@ BOOL samr_unknown_38(struct cli_state *cli, uint16 fnum, char *srv_name)
|
||||
/****************************************************************************
|
||||
do a SAMR unknown 0x8 command
|
||||
****************************************************************************/
|
||||
BOOL samr_query_dom_info(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *domain_pol, uint16 switch_value,
|
||||
BOOL samr_query_dom_info( POLICY_HND *domain_pol, uint16 switch_value,
|
||||
SAM_UNK_CTR *ctr)
|
||||
{
|
||||
prs_struct data;
|
||||
@ -171,7 +190,7 @@ BOOL samr_query_dom_info(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_query_dom_info("", &q_e, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_DOMAIN_INFO, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(domain_pol, SAMR_QUERY_DOMAIN_INFO, &data, &rdata))
|
||||
{
|
||||
SAMR_R_QUERY_DOMAIN_INFO r_e;
|
||||
BOOL p;
|
||||
@ -202,8 +221,7 @@ BOOL samr_query_dom_info(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR enumerate Domains
|
||||
****************************************************************************/
|
||||
uint32 samr_enum_domains(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol,
|
||||
uint32 samr_enum_domains( POLICY_HND *pol,
|
||||
uint32 *start_idx, uint32 size,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_domains)
|
||||
@ -233,7 +251,7 @@ uint32 samr_enum_domains(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_enum_domains("", &q_e, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_ENUM_DOMAINS, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_ENUM_DOMAINS, &data, &rdata))
|
||||
{
|
||||
SAMR_R_ENUM_DOMAINS r_e;
|
||||
BOOL p;
|
||||
@ -304,8 +322,7 @@ uint32 samr_enum_domains(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR enumerate groups
|
||||
****************************************************************************/
|
||||
uint32 samr_enum_dom_groups(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol,
|
||||
uint32 samr_enum_dom_groups( POLICY_HND *pol,
|
||||
uint32 *start_idx, uint32 size,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_groups)
|
||||
@ -335,7 +352,7 @@ uint32 samr_enum_dom_groups(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_enum_dom_groups("", &q_e, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_ENUM_DOM_GROUPS, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_ENUM_DOM_GROUPS, &data, &rdata))
|
||||
{
|
||||
SAMR_R_ENUM_DOM_GROUPS r_e;
|
||||
BOOL p;
|
||||
@ -406,8 +423,7 @@ uint32 samr_enum_dom_groups(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR enumerate aliases
|
||||
****************************************************************************/
|
||||
uint32 samr_enum_dom_aliases(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol,
|
||||
uint32 samr_enum_dom_aliases( POLICY_HND *pol,
|
||||
uint32 *start_idx, uint32 size,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_aliases)
|
||||
@ -437,7 +453,7 @@ uint32 samr_enum_dom_aliases(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_enum_dom_aliases("", &q_e, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_ENUM_DOM_ALIASES, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_ENUM_DOM_ALIASES, &data, &rdata))
|
||||
{
|
||||
SAMR_R_ENUM_DOM_ALIASES r_e;
|
||||
BOOL p;
|
||||
@ -507,8 +523,7 @@ uint32 samr_enum_dom_aliases(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR enumerate users
|
||||
****************************************************************************/
|
||||
uint32 samr_enum_dom_users(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint32 *start_idx,
|
||||
uint32 samr_enum_dom_users( POLICY_HND *pol, uint32 *start_idx,
|
||||
uint16 acb_mask, uint16 unk_1, uint32 size,
|
||||
struct acct_info **sam,
|
||||
uint32 *num_sam_users)
|
||||
@ -539,7 +554,7 @@ uint32 samr_enum_dom_users(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_enum_dom_users("", &q_e, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_ENUM_DOM_USERS, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_ENUM_DOM_USERS, &data, &rdata))
|
||||
{
|
||||
SAMR_R_ENUM_DOM_USERS r_e;
|
||||
BOOL p;
|
||||
@ -615,8 +630,7 @@ uint32 samr_enum_dom_users(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Connect
|
||||
****************************************************************************/
|
||||
BOOL samr_connect(struct cli_state *cli, uint16 fnum,
|
||||
const char *srv_name, uint32 unknown_0,
|
||||
BOOL samr_connect( const char *srv_name, uint32 unknown_0,
|
||||
POLICY_HND *connect_pol)
|
||||
{
|
||||
prs_struct data;
|
||||
@ -625,6 +639,14 @@ BOOL samr_connect(struct cli_state *cli, uint16 fnum,
|
||||
SAMR_Q_CONNECT q_o;
|
||||
BOOL valid_pol = False;
|
||||
|
||||
struct cli_state *cli = NULL;
|
||||
uint16 fnum = 0xffff;
|
||||
|
||||
if (!cli_state_init(srv_name, PIPE_SAMR, &cli, &fnum))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
DEBUG(4,("SAMR Open Policy server:%s undoc value:%x\n",
|
||||
srv_name, unknown_0));
|
||||
|
||||
@ -660,7 +682,9 @@ BOOL samr_connect(struct cli_state *cli, uint16 fnum,
|
||||
if (p)
|
||||
{
|
||||
memcpy(connect_pol, &r_o.connect_pol, sizeof(r_o.connect_pol));
|
||||
valid_pol = True;
|
||||
valid_pol = register_policy_hnd(connect_pol) &&
|
||||
set_policy_cli_state(connect_pol, cli, fnum,
|
||||
cli_state_free);
|
||||
}
|
||||
}
|
||||
|
||||
@ -673,8 +697,7 @@ BOOL samr_connect(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Open User
|
||||
****************************************************************************/
|
||||
BOOL samr_open_user(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *pol,
|
||||
BOOL samr_open_user( const POLICY_HND *pol,
|
||||
uint32 unk_0, uint32 rid,
|
||||
POLICY_HND *user_pol)
|
||||
{
|
||||
@ -701,7 +724,7 @@ BOOL samr_open_user(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_open_user("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_OPEN_USER, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_OPEN_USER, &data, &rdata))
|
||||
{
|
||||
SAMR_R_OPEN_USER r_o;
|
||||
BOOL p;
|
||||
@ -719,7 +742,7 @@ BOOL samr_open_user(struct cli_state *cli, uint16 fnum,
|
||||
if (p)
|
||||
{
|
||||
memcpy(user_pol, &r_o.user_pol, sizeof(r_o.user_pol));
|
||||
valid_pol = True;
|
||||
valid_pol = cli_pol_link(user_pol, pol);
|
||||
}
|
||||
}
|
||||
|
||||
@ -732,8 +755,7 @@ BOOL samr_open_user(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Open Alias
|
||||
****************************************************************************/
|
||||
BOOL samr_open_alias(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *domain_pol,
|
||||
BOOL samr_open_alias( const POLICY_HND *domain_pol,
|
||||
uint32 flags, uint32 rid,
|
||||
POLICY_HND *alias_pol)
|
||||
{
|
||||
@ -759,7 +781,7 @@ BOOL samr_open_alias(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_open_alias("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_OPEN_ALIAS, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(domain_pol, SAMR_OPEN_ALIAS, &data, &rdata))
|
||||
{
|
||||
SAMR_R_OPEN_ALIAS r_o;
|
||||
BOOL p;
|
||||
@ -777,7 +799,7 @@ BOOL samr_open_alias(struct cli_state *cli, uint16 fnum,
|
||||
if (p)
|
||||
{
|
||||
memcpy(alias_pol, &r_o.pol, sizeof(r_o.pol));
|
||||
valid_pol = True;
|
||||
valid_pol = cli_pol_link(alias_pol, domain_pol);
|
||||
}
|
||||
}
|
||||
|
||||
@ -790,8 +812,7 @@ BOOL samr_open_alias(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Delete Alias Member
|
||||
****************************************************************************/
|
||||
BOOL samr_del_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *alias_pol, DOM_SID *sid)
|
||||
BOOL samr_del_aliasmem( POLICY_HND *alias_pol, DOM_SID *sid)
|
||||
{
|
||||
prs_struct data;
|
||||
prs_struct rdata;
|
||||
@ -815,7 +836,7 @@ BOOL samr_del_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_del_aliasmem("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_DEL_ALIASMEM, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(alias_pol, SAMR_DEL_ALIASMEM, &data, &rdata))
|
||||
{
|
||||
SAMR_R_DEL_ALIASMEM r_o;
|
||||
BOOL p;
|
||||
@ -845,8 +866,7 @@ BOOL samr_del_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Add Alias Member
|
||||
****************************************************************************/
|
||||
BOOL samr_add_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *alias_pol, DOM_SID *sid)
|
||||
BOOL samr_add_aliasmem( POLICY_HND *alias_pol, DOM_SID *sid)
|
||||
{
|
||||
prs_struct data;
|
||||
prs_struct rdata;
|
||||
@ -870,7 +890,7 @@ BOOL samr_add_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_add_aliasmem("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_ADD_ALIASMEM, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(alias_pol, SAMR_ADD_ALIASMEM, &data, &rdata))
|
||||
{
|
||||
SAMR_R_ADD_ALIASMEM r_o;
|
||||
BOOL p;
|
||||
@ -900,8 +920,7 @@ BOOL samr_add_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Delete Domain Alias
|
||||
****************************************************************************/
|
||||
BOOL samr_delete_dom_alias(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *alias_pol)
|
||||
BOOL samr_delete_dom_alias( POLICY_HND *alias_pol)
|
||||
{
|
||||
prs_struct data;
|
||||
prs_struct rdata;
|
||||
@ -925,7 +944,7 @@ BOOL samr_delete_dom_alias(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_delete_dom_alias("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_DELETE_DOM_ALIAS, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(alias_pol, SAMR_DELETE_DOM_ALIAS, &data, &rdata))
|
||||
{
|
||||
SAMR_R_DELETE_DOM_ALIAS r_o;
|
||||
BOOL p;
|
||||
@ -955,8 +974,7 @@ BOOL samr_delete_dom_alias(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Create Domain User
|
||||
****************************************************************************/
|
||||
BOOL samr_create_dom_user(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *domain_pol, const char *acct_name,
|
||||
BOOL samr_create_dom_user( POLICY_HND *domain_pol, const char *acct_name,
|
||||
uint32 unk_0, uint32 unk_1,
|
||||
POLICY_HND *user_pol, uint32 *rid)
|
||||
{
|
||||
@ -982,7 +1000,7 @@ BOOL samr_create_dom_user(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_create_user("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_CREATE_USER, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(domain_pol, SAMR_CREATE_USER, &data, &rdata))
|
||||
{
|
||||
SAMR_R_CREATE_USER r_o;
|
||||
BOOL p;
|
||||
@ -1001,7 +1019,7 @@ BOOL samr_create_dom_user(struct cli_state *cli, uint16 fnum,
|
||||
{
|
||||
memcpy(user_pol, &r_o.user_pol, sizeof(r_o.user_pol));
|
||||
*rid = r_o.user_rid;
|
||||
valid_pol = True;
|
||||
valid_pol = cli_pol_link(user_pol, domain_pol);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1014,8 +1032,7 @@ BOOL samr_create_dom_user(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Create Domain Alias
|
||||
****************************************************************************/
|
||||
BOOL samr_create_dom_alias(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *domain_pol, const char *acct_name,
|
||||
BOOL samr_create_dom_alias( POLICY_HND *domain_pol, const char *acct_name,
|
||||
POLICY_HND *alias_pol, uint32 *rid)
|
||||
{
|
||||
prs_struct data;
|
||||
@ -1040,7 +1057,7 @@ BOOL samr_create_dom_alias(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_create_dom_alias("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_CREATE_DOM_ALIAS, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(domain_pol, SAMR_CREATE_DOM_ALIAS, &data, &rdata))
|
||||
{
|
||||
SAMR_R_CREATE_DOM_ALIAS r_o;
|
||||
BOOL p;
|
||||
@ -1059,7 +1076,7 @@ BOOL samr_create_dom_alias(struct cli_state *cli, uint16 fnum,
|
||||
{
|
||||
memcpy(alias_pol, &r_o.alias_pol, sizeof(r_o.alias_pol));
|
||||
*rid = r_o.rid;
|
||||
valid_pol = True;
|
||||
valid_pol = cli_pol_link(alias_pol, domain_pol);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1072,8 +1089,7 @@ BOOL samr_create_dom_alias(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Get Alias Info
|
||||
****************************************************************************/
|
||||
BOOL samr_query_aliasinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *alias_pol, uint16 switch_value,
|
||||
BOOL samr_query_aliasinfo( POLICY_HND *alias_pol, uint16 switch_value,
|
||||
ALIAS_INFO_CTR *ctr)
|
||||
{
|
||||
prs_struct data;
|
||||
@ -1098,7 +1114,7 @@ BOOL samr_query_aliasinfo(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_query_aliasinfo("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_ALIASINFO, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(alias_pol, SAMR_QUERY_ALIASINFO, &data, &rdata))
|
||||
{
|
||||
SAMR_R_QUERY_ALIASINFO r_o;
|
||||
BOOL p;
|
||||
@ -1131,8 +1147,7 @@ BOOL samr_query_aliasinfo(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Set Alias Info
|
||||
****************************************************************************/
|
||||
BOOL samr_set_aliasinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *alias_pol, ALIAS_INFO_CTR *ctr)
|
||||
BOOL samr_set_aliasinfo( POLICY_HND *alias_pol, ALIAS_INFO_CTR *ctr)
|
||||
{
|
||||
prs_struct data;
|
||||
prs_struct rdata;
|
||||
@ -1156,7 +1171,7 @@ BOOL samr_set_aliasinfo(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_set_aliasinfo("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_SET_ALIASINFO, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(alias_pol, SAMR_SET_ALIASINFO, &data, &rdata))
|
||||
{
|
||||
SAMR_R_SET_ALIASINFO r_o;
|
||||
BOOL p;
|
||||
@ -1186,8 +1201,7 @@ BOOL samr_set_aliasinfo(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Open Group
|
||||
****************************************************************************/
|
||||
BOOL samr_open_group(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *domain_pol,
|
||||
BOOL samr_open_group( const POLICY_HND *domain_pol,
|
||||
uint32 flags, uint32 rid,
|
||||
POLICY_HND *group_pol)
|
||||
{
|
||||
@ -1213,7 +1227,7 @@ BOOL samr_open_group(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_open_group("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_OPEN_GROUP, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(domain_pol, SAMR_OPEN_GROUP, &data, &rdata))
|
||||
{
|
||||
SAMR_R_OPEN_GROUP r_o;
|
||||
BOOL p;
|
||||
@ -1231,7 +1245,7 @@ BOOL samr_open_group(struct cli_state *cli, uint16 fnum,
|
||||
if (p)
|
||||
{
|
||||
memcpy(group_pol, &r_o.pol, sizeof(r_o.pol));
|
||||
valid_pol = True;
|
||||
valid_pol = cli_pol_link(group_pol, domain_pol);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1244,8 +1258,7 @@ BOOL samr_open_group(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Delete Group Member
|
||||
****************************************************************************/
|
||||
BOOL samr_del_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *group_pol, uint32 rid)
|
||||
BOOL samr_del_groupmem( POLICY_HND *group_pol, uint32 rid)
|
||||
{
|
||||
prs_struct data;
|
||||
prs_struct rdata;
|
||||
@ -1269,7 +1282,7 @@ BOOL samr_del_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_del_groupmem("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_DEL_GROUPMEM, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(group_pol, SAMR_DEL_GROUPMEM, &data, &rdata))
|
||||
{
|
||||
SAMR_R_DEL_GROUPMEM r_o;
|
||||
BOOL p;
|
||||
@ -1299,8 +1312,7 @@ BOOL samr_del_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Add Group Member
|
||||
****************************************************************************/
|
||||
BOOL samr_add_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *group_pol, uint32 rid)
|
||||
BOOL samr_add_groupmem( POLICY_HND *group_pol, uint32 rid)
|
||||
{
|
||||
prs_struct data;
|
||||
prs_struct rdata;
|
||||
@ -1324,7 +1336,7 @@ BOOL samr_add_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_add_groupmem("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_ADD_GROUPMEM, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(group_pol, SAMR_ADD_GROUPMEM, &data, &rdata))
|
||||
{
|
||||
SAMR_R_ADD_GROUPMEM r_o;
|
||||
BOOL p;
|
||||
@ -1354,7 +1366,7 @@ BOOL samr_add_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Delete Domain Group
|
||||
****************************************************************************/
|
||||
BOOL samr_delete_dom_group(struct cli_state *cli, uint16 fnum, POLICY_HND *group_pol)
|
||||
BOOL samr_delete_dom_group( POLICY_HND *group_pol)
|
||||
{
|
||||
prs_struct data;
|
||||
prs_struct rdata;
|
||||
@ -1378,7 +1390,7 @@ BOOL samr_delete_dom_group(struct cli_state *cli, uint16 fnum, POLICY_HND *group
|
||||
samr_io_q_delete_dom_group("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_DELETE_DOM_GROUP, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(group_pol, SAMR_DELETE_DOM_GROUP, &data, &rdata))
|
||||
{
|
||||
SAMR_R_DELETE_DOM_GROUP r_o;
|
||||
BOOL p;
|
||||
@ -1408,8 +1420,7 @@ BOOL samr_delete_dom_group(struct cli_state *cli, uint16 fnum, POLICY_HND *group
|
||||
/****************************************************************************
|
||||
do a SAMR Create Domain Group
|
||||
****************************************************************************/
|
||||
BOOL samr_create_dom_group(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *domain_pol, const char *acct_name,
|
||||
BOOL samr_create_dom_group( POLICY_HND *domain_pol, const char *acct_name,
|
||||
POLICY_HND *group_pol, uint32 *rid)
|
||||
{
|
||||
prs_struct data;
|
||||
@ -1434,7 +1445,7 @@ BOOL samr_create_dom_group(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_create_dom_group("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_CREATE_DOM_GROUP, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(domain_pol, SAMR_CREATE_DOM_GROUP, &data, &rdata))
|
||||
{
|
||||
SAMR_R_CREATE_DOM_GROUP r_o;
|
||||
BOOL p;
|
||||
@ -1453,7 +1464,7 @@ BOOL samr_create_dom_group(struct cli_state *cli, uint16 fnum,
|
||||
{
|
||||
memcpy(group_pol, &r_o.pol, sizeof(r_o.pol));
|
||||
*rid = r_o.rid;
|
||||
valid_pol = True;
|
||||
valid_pol = cli_pol_link(group_pol, domain_pol);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1466,8 +1477,7 @@ BOOL samr_create_dom_group(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Set Group Info
|
||||
****************************************************************************/
|
||||
BOOL samr_set_groupinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *group_pol, GROUP_INFO_CTR *ctr)
|
||||
BOOL samr_set_groupinfo( POLICY_HND *group_pol, GROUP_INFO_CTR *ctr)
|
||||
{
|
||||
prs_struct data;
|
||||
prs_struct rdata;
|
||||
@ -1491,7 +1501,7 @@ BOOL samr_set_groupinfo(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_set_groupinfo("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_SET_GROUPINFO, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(group_pol, SAMR_SET_GROUPINFO, &data, &rdata))
|
||||
{
|
||||
SAMR_R_SET_GROUPINFO r_o;
|
||||
BOOL p;
|
||||
@ -1521,8 +1531,7 @@ BOOL samr_set_groupinfo(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Open Domain
|
||||
****************************************************************************/
|
||||
BOOL samr_open_domain(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *connect_pol,
|
||||
BOOL samr_open_domain( const POLICY_HND *connect_pol,
|
||||
uint32 ace_perms,
|
||||
const DOM_SID *sid,
|
||||
POLICY_HND *domain_pol)
|
||||
@ -1555,7 +1564,7 @@ BOOL samr_open_domain(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_open_domain("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_OPEN_DOMAIN, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(connect_pol, SAMR_OPEN_DOMAIN, &data, &rdata))
|
||||
{
|
||||
SAMR_R_OPEN_DOMAIN r_o;
|
||||
BOOL p;
|
||||
@ -1573,7 +1582,7 @@ BOOL samr_open_domain(struct cli_state *cli, uint16 fnum,
|
||||
if (p)
|
||||
{
|
||||
memcpy(domain_pol, &r_o.domain_pol, sizeof(r_o.domain_pol));
|
||||
valid_pol = True;
|
||||
valid_pol = cli_pol_link(domain_pol, connect_pol);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1586,8 +1595,7 @@ BOOL samr_open_domain(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Query Lookup Domain
|
||||
****************************************************************************/
|
||||
BOOL samr_query_lookup_domain(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, const char *dom_name,
|
||||
BOOL samr_query_lookup_domain( POLICY_HND *pol, const char *dom_name,
|
||||
DOM_SID *dom_sid)
|
||||
{
|
||||
prs_struct data;
|
||||
@ -1612,7 +1620,7 @@ BOOL samr_query_lookup_domain(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_lookup_domain("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_LOOKUP_DOMAIN, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_LOOKUP_DOMAIN, &data, &rdata))
|
||||
{
|
||||
SAMR_R_LOOKUP_DOMAIN r_o;
|
||||
BOOL p;
|
||||
@ -1643,8 +1651,7 @@ BOOL samr_query_lookup_domain(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Query Lookup Names
|
||||
****************************************************************************/
|
||||
BOOL samr_query_lookup_names(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint32 flags,
|
||||
BOOL samr_query_lookup_names( POLICY_HND *pol, uint32 flags,
|
||||
uint32 num_names, char **names,
|
||||
uint32 *num_rids,
|
||||
uint32 rid[MAX_LOOKUP_SIDS],
|
||||
@ -1673,7 +1680,7 @@ BOOL samr_query_lookup_names(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_lookup_names("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_LOOKUP_NAMES, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_LOOKUP_NAMES, &data, &rdata))
|
||||
{
|
||||
SAMR_R_LOOKUP_NAMES r_o;
|
||||
BOOL p;
|
||||
@ -1728,8 +1735,7 @@ BOOL samr_query_lookup_names(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Query Lookup RIDS
|
||||
****************************************************************************/
|
||||
BOOL samr_query_lookup_rids(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *pol, uint32 flags,
|
||||
BOOL samr_query_lookup_rids( const POLICY_HND *pol, uint32 flags,
|
||||
uint32 num_rids, uint32 *rids,
|
||||
uint32 *num_names,
|
||||
char ***names,
|
||||
@ -1758,7 +1764,7 @@ BOOL samr_query_lookup_rids(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_lookup_rids("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_LOOKUP_RIDS, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_LOOKUP_RIDS, &data, &rdata))
|
||||
{
|
||||
SAMR_R_LOOKUP_RIDS r_o;
|
||||
BOOL p;
|
||||
@ -1827,8 +1833,7 @@ BOOL samr_query_lookup_rids(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Query Alias Members
|
||||
****************************************************************************/
|
||||
BOOL samr_query_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *alias_pol,
|
||||
BOOL samr_query_aliasmem( const POLICY_HND *alias_pol,
|
||||
uint32 *num_mem, DOM_SID2 *sid)
|
||||
{
|
||||
prs_struct data;
|
||||
@ -1853,7 +1858,7 @@ BOOL samr_query_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_query_aliasmem("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_ALIASMEM, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(alias_pol, SAMR_QUERY_ALIASMEM, &data, &rdata))
|
||||
{
|
||||
SAMR_R_QUERY_ALIASMEM r_o;
|
||||
BOOL p;
|
||||
@ -1888,8 +1893,7 @@ BOOL samr_query_aliasmem(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Query User Aliases
|
||||
****************************************************************************/
|
||||
BOOL samr_query_useraliases(struct cli_state *cli, uint16 fnum,
|
||||
const POLICY_HND *pol,
|
||||
BOOL samr_query_useraliases( const POLICY_HND *pol,
|
||||
uint32 *ptr_sid, DOM_SID2 *sid,
|
||||
uint32 *num_aliases, uint32 **rid)
|
||||
{
|
||||
@ -1916,7 +1920,7 @@ BOOL samr_query_useraliases(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_query_useraliases("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_USERALIASES, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_QUERY_USERALIASES, &data, &rdata))
|
||||
{
|
||||
SAMR_R_QUERY_USERALIASES r_o;
|
||||
BOOL p;
|
||||
@ -1951,8 +1955,7 @@ BOOL samr_query_useraliases(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Query Group Members
|
||||
****************************************************************************/
|
||||
BOOL samr_query_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *group_pol,
|
||||
BOOL samr_query_groupmem( POLICY_HND *group_pol,
|
||||
uint32 *num_mem, uint32 **rid, uint32 **attr)
|
||||
{
|
||||
prs_struct data;
|
||||
@ -1977,7 +1980,7 @@ BOOL samr_query_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_query_groupmem("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_GROUPMEM, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(group_pol, SAMR_QUERY_GROUPMEM, &data, &rdata))
|
||||
{
|
||||
SAMR_R_QUERY_GROUPMEM r_o;
|
||||
BOOL p;
|
||||
@ -2016,8 +2019,7 @@ BOOL samr_query_groupmem(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Query User Groups
|
||||
****************************************************************************/
|
||||
BOOL samr_query_usergroups(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint32 *num_groups,
|
||||
BOOL samr_query_usergroups( POLICY_HND *pol, uint32 *num_groups,
|
||||
DOM_GID **gid)
|
||||
{
|
||||
prs_struct data;
|
||||
@ -2042,7 +2044,7 @@ BOOL samr_query_usergroups(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_query_usergroups("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_USERGROUPS, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_QUERY_USERGROUPS, &data, &rdata))
|
||||
{
|
||||
SAMR_R_QUERY_USERGROUPS r_o;
|
||||
BOOL p;
|
||||
@ -2078,8 +2080,7 @@ BOOL samr_query_usergroups(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Query Group Info
|
||||
****************************************************************************/
|
||||
BOOL samr_query_groupinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol,
|
||||
BOOL samr_query_groupinfo( POLICY_HND *pol,
|
||||
uint16 switch_value, GROUP_INFO_CTR* ctr)
|
||||
{
|
||||
prs_struct data;
|
||||
@ -2104,7 +2105,7 @@ BOOL samr_query_groupinfo(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_query_groupinfo("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_GROUPINFO, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_QUERY_GROUPINFO, &data, &rdata))
|
||||
{
|
||||
SAMR_R_QUERY_GROUPINFO r_o;
|
||||
BOOL p;
|
||||
@ -2143,8 +2144,7 @@ BOOL samr_query_groupinfo(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Set User Info
|
||||
****************************************************************************/
|
||||
BOOL samr_set_userinfo2(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint16 switch_value,
|
||||
BOOL samr_set_userinfo2( POLICY_HND *pol, uint16 switch_value,
|
||||
void* usr)
|
||||
{
|
||||
prs_struct data;
|
||||
@ -2169,7 +2169,7 @@ BOOL samr_set_userinfo2(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_set_userinfo2("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_SET_USERINFO2, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_SET_USERINFO2, &data, &rdata))
|
||||
{
|
||||
SAMR_R_SET_USERINFO2 r_o;
|
||||
BOOL p;
|
||||
@ -2199,8 +2199,7 @@ BOOL samr_set_userinfo2(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Set User Info
|
||||
****************************************************************************/
|
||||
BOOL samr_set_userinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint16 switch_value, void* usr)
|
||||
BOOL samr_set_userinfo( POLICY_HND *pol, uint16 switch_value, void* usr)
|
||||
{
|
||||
prs_struct data;
|
||||
prs_struct rdata;
|
||||
@ -2224,7 +2223,7 @@ BOOL samr_set_userinfo(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_set_userinfo("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_SET_USERINFO, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_SET_USERINFO, &data, &rdata))
|
||||
{
|
||||
SAMR_R_SET_USERINFO r_o;
|
||||
BOOL p;
|
||||
@ -2254,8 +2253,7 @@ BOOL samr_set_userinfo(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Query User Info
|
||||
****************************************************************************/
|
||||
BOOL samr_query_userinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol, uint16 switch_value, void* usr)
|
||||
BOOL samr_query_userinfo( POLICY_HND *pol, uint16 switch_value, void* usr)
|
||||
{
|
||||
prs_struct data;
|
||||
prs_struct rdata;
|
||||
@ -2279,7 +2277,7 @@ BOOL samr_query_userinfo(struct cli_state *cli, uint16 fnum,
|
||||
samr_io_q_query_userinfo("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_USERINFO, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol, SAMR_QUERY_USERINFO, &data, &rdata))
|
||||
{
|
||||
SAMR_R_QUERY_USERINFO r_o;
|
||||
BOOL p;
|
||||
@ -2318,7 +2316,7 @@ BOOL samr_query_userinfo(struct cli_state *cli, uint16 fnum,
|
||||
/****************************************************************************
|
||||
do a SAMR Close
|
||||
****************************************************************************/
|
||||
BOOL samr_close(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd)
|
||||
BOOL samr_close( POLICY_HND *hnd)
|
||||
{
|
||||
prs_struct data;
|
||||
prs_struct rdata;
|
||||
@ -2342,7 +2340,7 @@ BOOL samr_close(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd)
|
||||
samr_io_q_close_hnd("", &q_c, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_CLOSE_HND, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(hnd, SAMR_CLOSE_HND, &data, &rdata))
|
||||
{
|
||||
SAMR_R_CLOSE_HND r_c;
|
||||
BOOL p;
|
||||
@ -2381,14 +2379,15 @@ BOOL samr_close(struct cli_state *cli, uint16 fnum, POLICY_HND *hnd)
|
||||
prs_mem_free(&data );
|
||||
prs_mem_free(&rdata );
|
||||
|
||||
close_policy_hnd(hnd);
|
||||
|
||||
return valid_close;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
do a SAMR query display info
|
||||
****************************************************************************/
|
||||
BOOL samr_query_dispinfo(struct cli_state *cli, uint16 fnum,
|
||||
POLICY_HND *pol_open_domain, uint16 level,
|
||||
BOOL samr_query_dispinfo( POLICY_HND *pol_domain, uint16 level,
|
||||
uint32 *num_entries,
|
||||
SAM_DISPINFO_CTR *ctr)
|
||||
{
|
||||
@ -2400,7 +2399,7 @@ BOOL samr_query_dispinfo(struct cli_state *cli, uint16 fnum,
|
||||
|
||||
DEBUG(4,("SAMR Query Display Info. level: %d\n", level));
|
||||
|
||||
if (pol_open_domain == NULL || num_entries == NULL || ctr == NULL ||
|
||||
if (pol_domain == NULL || num_entries == NULL || ctr == NULL ||
|
||||
level == 0)
|
||||
{
|
||||
return False;
|
||||
@ -2412,13 +2411,13 @@ BOOL samr_query_dispinfo(struct cli_state *cli, uint16 fnum,
|
||||
prs_init(&rdata, 0 , 4, SAFETY_MARGIN, True );
|
||||
|
||||
/* store the parameters */
|
||||
make_samr_q_query_dispinfo(&q_o, pol_open_domain, level, 0, 0xffffffff);
|
||||
make_samr_q_query_dispinfo(&q_o, pol_domain, level, 0, 0xffffffff);
|
||||
|
||||
/* turn parameters into data stream */
|
||||
samr_io_q_query_dispinfo("", &q_o, &data, 0);
|
||||
|
||||
/* send the data on \PIPE\ */
|
||||
if (rpc_api_pipe_req(cli, fnum, SAMR_QUERY_DISPINFO, &data, &rdata))
|
||||
if (rpc_hnd_pipe_req(pol_domain, SAMR_QUERY_DISPINFO, &data, &rdata))
|
||||
{
|
||||
SAMR_R_QUERY_DISPINFO r_o;
|
||||
BOOL p;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5671,8 +5671,28 @@ BOOL make_samr_q_set_userinfo(SAMR_Q_SET_USERINFO *q_u,
|
||||
switch (switch_value)
|
||||
{
|
||||
case 0x18:
|
||||
{
|
||||
uchar sess_key[16];
|
||||
if (!cli_get_usr_sesskey(hnd, sess_key))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
#ifdef DEBUG_PASSWORD
|
||||
dump_data(100, sess_key, 16);
|
||||
#endif
|
||||
SamOEMhash(q_u->info.id24->pass, sess_key, 1);
|
||||
}
|
||||
case 0x17:
|
||||
{
|
||||
uchar sess_key[16];
|
||||
if (!cli_get_usr_sesskey(hnd, sess_key))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
#ifdef DEBUG_PASSWORD
|
||||
dump_data(100, sess_key, 16);
|
||||
#endif
|
||||
SamOEMhash(q_u->info.id23->pass, sess_key, 1);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -411,8 +411,14 @@ BOOL get_policy_cli_state(const POLICY_HND *hnd, struct cli_state **cli,
|
||||
{
|
||||
DEBUG(3,("Getting cli state pnum=%x\n", p->pnum));
|
||||
|
||||
(*cli ) = p->dev.cli->cli;
|
||||
(*fnum) = p->dev.cli->fnum;
|
||||
if (cli != NULL)
|
||||
{
|
||||
(*cli ) = p->dev.cli->cli;
|
||||
}
|
||||
if (fnum != NULL)
|
||||
{
|
||||
(*fnum) = p->dev.cli->fnum;
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -974,8 +974,7 @@ static char *complete_samenum_usr(char *text, int state)
|
||||
num_usrs = 0;
|
||||
|
||||
/* Iterate all users */
|
||||
if (msrpc_sam_enum_users(smb_cli,
|
||||
domain, &sid1, srv_name,
|
||||
if (msrpc_sam_enum_users(srv_name, domain, &sid1,
|
||||
&sam, &num_usrs,
|
||||
NULL, NULL, NULL, NULL) == 0)
|
||||
{
|
||||
@ -1030,8 +1029,7 @@ static char *complete_samenum_als(char *text, int state)
|
||||
num_als = 0;
|
||||
|
||||
/* Iterate all aliases */
|
||||
if (msrpc_sam_enum_aliases(smb_cli,
|
||||
domain, &sid1, srv_name,
|
||||
if (msrpc_sam_enum_aliases(srv_name, domain, &sid1,
|
||||
&sam, &num_als,
|
||||
NULL, NULL, NULL) == 0)
|
||||
{
|
||||
@ -1086,8 +1084,8 @@ static char *complete_samenum_grp(char *text, int state)
|
||||
num_grps = 0;
|
||||
|
||||
/* Iterate all groups */
|
||||
if (msrpc_sam_enum_groups(smb_cli,
|
||||
domain, &sid1, srv_name,
|
||||
if (msrpc_sam_enum_groups(srv_name,
|
||||
domain, &sid1,
|
||||
&sam, &num_grps,
|
||||
NULL, NULL, NULL) == 0)
|
||||
{
|
||||
|
Reference in New Issue
Block a user