----- Original Message ----- From: "Andrew Bartlett" <[EMAIL PROTECTED]> Sent: Wednesday, June 26, 2002 5:49 AM
> > It would be good, if all those q_u->pol could be renamed to identify on what > > type of sam-object each of the policies where opened. i.e. q_u->domain_pol, > > q_u->user_pol, q_u->group_pol and so on. I think that would clarify some of > > the policy stuff. > > Yes, I would support that. Patches welcome ;-) Here comes a renameing patch then :) All of the q_u->pol and r_u->pol have been renamed, except for the r_u->pol in the delete functions. I don't know what typ of policyhandle they return, as their q_u->pol has been released. > Andrew Bartlett Kai
--- ./samba32606-orig/source/libsmb/cli_samr.c Sat Jun 22 11:31:23 2002 +++ ./samba32606/source/libsmb/cli_samr.c Thu Jun 27 00:50:17 2002 @@ -249,7 +249,7 @@ /* Return output parameters */ if (NT_STATUS_IS_OK(result = r.status)) { - *group_pol = r.pol; + *group_pol = r.group_pol; #ifdef __INSURE__ group_pol->marker = malloc(1); #endif @@ -742,7 +742,7 @@ /* Return output parameters */ if (NT_STATUS_IS_OK(result = r.status)) { - *alias_pol = r.pol; + *alias_pol = r.alias_pol; #ifdef __INSURE__ alias_pol->marker = malloc(1); #endif
--- ./samba32606-orig/source/include/rpc_samr.h Fri Jun 14 16:12:32 2002 +++ ./samba32606/source/include/rpc_samr.h Thu Jun 27 01:12:44 2002 @@ -459,7 +459,7 @@ /* SAMR_Q_QUERY_SEC_OBJ - probably get domain info... */ typedef struct q_samr_query_sec_obj_info { - POLICY_HND user_pol; /* policy handle */ + POLICY_HND pol; /* policy handle */ uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */ } SAMR_Q_QUERY_SEC_OBJ; @@ -630,9 +630,9 @@ /* SAMR_Q_OPEN_DOMAIN */ typedef struct q_samr_open_domain_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND connect_pol; /* policy handle */ uint32 flags; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */ - DOM_SID2 dom_sid; /* domain SID */ + DOM_SID2 dom_sid; /* domain SID */ } SAMR_Q_OPEN_DOMAIN; @@ -640,7 +640,7 @@ /* SAMR_R_OPEN_DOMAIN - probably an open */ typedef struct r_samr_open_domain_info { - POLICY_HND domain_pol; /* policy handle associated with the SID */ + POLICY_HND domain_pol; /* policy handle associated with the SID */ NTSTATUS status; /* return status */ } SAMR_R_OPEN_DOMAIN; @@ -661,7 +661,7 @@ /* SAMR_Q_ENUM_DOMAINS - SAM rids and names */ typedef struct q_samr_enum_domains_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND connect_pol; /* policy handle */ uint32 start_idx; /* enumeration handle */ uint32 max_size; /* 0x0000 ffff */ @@ -691,13 +691,13 @@ /* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */ typedef struct q_samr_enum_dom_users_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND domain_pol; /* policy handle */ - uint32 start_idx; /* number of values (0 indicates unlimited?) */ + uint32 start_idx; /* number of values (0 indicates unlimited?) */ uint16 acb_mask; /* 0x0000 indicates all */ uint16 unknown_1; /* 0x0000 */ - uint32 max_size; /* 0x0000 ffff */ + uint32 max_size; /* 0x0000 ffff */ } SAMR_Q_ENUM_DOM_USERS; @@ -726,7 +726,7 @@ /* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */ typedef struct q_samr_enum_dom_groups_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND domain_pol; /* policy handle */ /* this is possibly an enumeration context handle... */ uint32 start_idx; /* 0x0000 0000 */ @@ -760,7 +760,7 @@ /* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */ typedef struct q_samr_enum_dom_aliases_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND domain_pol; /* policy handle */ /* this is possibly an enumeration context handle... */ uint32 start_idx; /* 0x0000 0000 */ @@ -1000,7 +1000,7 @@ /* SAMR_Q_CREATE_DOM_GROUP - SAM create group */ typedef struct q_samr_create_dom_group_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND domain_pol; /* policy handle */ UNIHDR hdr_acct_desc; UNISTR2 uni_acct_desc; @@ -1012,7 +1012,7 @@ /* SAMR_R_CREATE_DOM_GROUP - SAM create group */ typedef struct r_samr_create_dom_group_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND group_pol; /* policy handle */ uint32 rid; NTSTATUS status; @@ -1022,7 +1022,7 @@ /* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */ typedef struct q_samr_query_group_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND group_pol; /* policy handle */ uint16 switch_level; /* 0x0001 seen */ @@ -1084,7 +1084,7 @@ /* SAMR_Q_SET_GROUPINFO - SAM Group Info */ typedef struct q_samr_set_group_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND group_pol; /* policy handle */ GROUP_INFO_CTR *ctr; } SAMR_Q_SET_GROUPINFO; @@ -1117,7 +1117,7 @@ /* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */ typedef struct q_samr_create_dom_alias_info { - POLICY_HND dom_pol; /* policy handle */ + POLICY_HND domain_pol; /* policy handle */ UNIHDR hdr_acct_desc; UNISTR2 uni_acct_desc; @@ -1139,7 +1139,7 @@ /* SAMR_Q_QUERY_ALIASINFO - SAM Alias Info */ typedef struct q_samr_query_alias_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND alias_pol; /* policy handle */ uint16 switch_level; /* 0x0003 seen */ @@ -1207,7 +1207,7 @@ /* SAMR_Q_QUERY_USERGROUPS - */ typedef struct q_samr_query_usergroup_info { - POLICY_HND pol; /* policy handle associated with unknown id */ + POLICY_HND user_pol; /* policy handle associated with unknown id */ } SAMR_Q_QUERY_USERGROUPS; @@ -1250,7 +1250,7 @@ /* SAMR_Q_SET_USERINFO2 - set sam info */ typedef struct q_samr_set_user_info2 { - POLICY_HND pol; /* policy handle associated with user */ + POLICY_HND user_pol; /* policy handle associated with user */ uint16 switch_value; /* 0x0010 */ SAM_USERINFO_CTR *ctr; @@ -1267,7 +1267,7 @@ /* SAMR_Q_SET_USERINFO - set sam info */ typedef struct q_samr_set_user_info { - POLICY_HND pol; /* policy handle associated with user */ + POLICY_HND user_pol; /* policy handle associated with user */ uint16 switch_value; SAM_USERINFO_CTR *ctr; @@ -1284,7 +1284,7 @@ /* SAMR_Q_QUERY_USERINFO - probably a get sam info */ typedef struct q_samr_query_user_info { - POLICY_HND pol; /* policy handle associated with unknown id */ + POLICY_HND user_pol; /* policy handle associated with unknown id */ uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */ } SAMR_Q_QUERY_USERINFO; @@ -1310,7 +1310,7 @@ /* SAMR_Q_QUERY_USERALIASES */ typedef struct q_samr_query_useraliases_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND user_pol; /* policy handle */ uint32 num_sids1; /* number of rids being looked up */ uint32 ptr; /* buffer pointer */ @@ -1342,11 +1342,11 @@ /* SAMR_Q_LOOKUP_NAMES */ typedef struct q_samr_lookup_names_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND domain_pol; /* policy handle */ uint32 num_names1; /* number of names being looked up */ uint32 flags; /* 0x0000 03e8 - unknown */ - uint32 ptr; /* 0x0000 0000 - 32 bit unknown */ + uint32 ptr; /* 0x0000 0000 - 32 bit unknown */ uint32 num_names2; /* number of names being looked up */ UNIHDR *hdr_name; /* unicode account name header */ @@ -1383,7 +1383,7 @@ /* SAMR_Q_LOOKUP_RIDS */ typedef struct q_samr_lookup_rids_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND domain_pol; /* policy handle */ uint32 num_rids1; /* number of rids being looked up */ uint32 flags; /* 0x0000 03e8 - unknown */ @@ -1423,9 +1423,9 @@ /* SAMR_Q_OPEN_USER - probably an open */ typedef struct q_samr_open_user_info { - POLICY_HND domain_pol; /* policy handle */ + POLICY_HND domain_pol; /* policy handle */ uint32 access_mask; /* 32 bit unknown - 0x02011b */ - uint32 user_rid; /* user RID */ + uint32 user_rid; /* user RID */ } SAMR_Q_OPEN_USER; @@ -1433,7 +1433,7 @@ /* SAMR_R_OPEN_USER - probably an open */ typedef struct r_samr_open_user_info { - POLICY_HND user_pol; /* policy handle associated with unknown id */ + POLICY_HND user_pol; /* policy handle associated with unknown id */ NTSTATUS status; /* return status */ } SAMR_R_OPEN_USER; @@ -1442,12 +1442,12 @@ /* SAMR_Q_CREATE_USER - probably a create */ typedef struct q_samr_create_user_info { - POLICY_HND domain_pol; /* policy handle */ + POLICY_HND domain_pol; /* policy handle */ UNIHDR hdr_name; /* unicode account name header */ UNISTR2 uni_name; /* unicode account name */ - uint32 acb_info; /* account control info */ + uint32 acb_info; /* account control info */ uint32 access_mask; /* 0xe005 00b0 */ } SAMR_Q_CREATE_USER; @@ -1456,7 +1456,7 @@ /* SAMR_R_CREATE_USER - probably a create */ typedef struct r_samr_create_user_info { - POLICY_HND user_pol; /* policy handle associated with user */ + POLICY_HND user_pol; /* policy handle associated with user */ uint32 unknown_0; /* 0x0007 03ff */ uint32 user_rid; /* user RID */ @@ -1513,8 +1513,8 @@ /* SAMR_Q_DEL_GROUPMEM - probably an del group member */ typedef struct q_samr_del_group_mem_info { - POLICY_HND pol; /* policy handle */ - uint32 rid; /* rid */ + POLICY_HND group_pol; /* policy handle */ + uint32 rid; /* rid */ } SAMR_Q_DEL_GROUPMEM; @@ -1530,7 +1530,7 @@ /* SAMR_Q_ADD_GROUPMEM - probably an add group member */ typedef struct q_samr_add_group_mem_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND group_pol; /* policy handle */ uint32 rid; /* rid */ uint32 unknown; /* 0x0000 0005 */ @@ -1549,8 +1549,8 @@ /* SAMR_Q_OPEN_GROUP - probably an open */ typedef struct q_samr_open_group_info { - POLICY_HND domain_pol; /* policy handle */ - uint32 access_mask; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */ + POLICY_HND domain_pol; /* policy handle */ + uint32 access_mask; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */ uint32 rid_group; /* rid */ } SAMR_Q_OPEN_GROUP; @@ -1559,7 +1559,7 @@ /* SAMR_R_OPEN_GROUP - probably an open */ typedef struct r_samr_open_group_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND group_pol; /* policy handle */ NTSTATUS status; /* return status */ } SAMR_R_OPEN_GROUP; @@ -1627,7 +1627,7 @@ /* SAMR_Q_OPEN_ALIAS - probably an open */ typedef struct q_samr_open_alias_info { - POLICY_HND dom_pol; + POLICY_HND domain_pol; uint32 access_mask; uint32 rid_alias; @@ -1638,7 +1638,7 @@ /* SAMR_R_OPEN_ALIAS - probably an open */ typedef struct r_samr_open_alias_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND alias_pol; /* policy handle */ NTSTATUS status; /* return status */ } SAMR_R_OPEN_ALIAS; @@ -1657,7 +1657,7 @@ /* SAMR_R_CONNECT_ANON - probably an open */ typedef struct r_samr_connect_anon_info { - POLICY_HND connect_pol; /* policy handle */ + POLICY_HND connect_pol; /* policy handle */ NTSTATUS status; /* return status */ } SAMR_R_CONNECT_ANON; @@ -1676,7 +1676,7 @@ /* SAMR_R_CONNECT - probably an open */ typedef struct r_samr_connect_info { - POLICY_HND connect_pol; /* policy handle */ + POLICY_HND connect_pol; /* policy handle */ NTSTATUS status; /* return status */ } SAMR_R_CONNECT; @@ -1755,8 +1755,8 @@ /* SAMR_Q_UNKNOWN_2D */ typedef struct q_samr_unknown_2d_info { - POLICY_HND dom_pol; /* policy handle */ - DOM_SID2 sid; /* SID */ + POLICY_HND domain_pol; /* policy handle */ + DOM_SID2 sid; /* SID */ } SAMR_Q_UNKNOWN_2D;
--- ./samba32606-orig/source/rpc_parse/parse_samr.c Sat Jun 22 11:31:25 2002 +++ ./samba32606/source/rpc_parse/parse_samr.c Thu Jun 27 00:05:12 2002 @@ -90,13 +90,13 @@ ********************************************************************/ void init_samr_q_lookup_domain(SAMR_Q_LOOKUP_DOMAIN * q_u, - POLICY_HND *pol, char *dom_name) + POLICY_HND *connect_pol, char *dom_name) { int len_name = strlen(dom_name); DEBUG(5, ("init_samr_q_lookup_domain\n")); - q_u->connect_pol = *pol; + q_u->connect_pol = *connect_pol; init_uni_hdr(&q_u->hdr_domain, len_name); init_unistr2(&q_u->uni_domain, dom_name, len_name); @@ -182,11 +182,11 @@ reads or writes a structure. ********************************************************************/ -void init_samr_q_unknown_2d(SAMR_Q_UNKNOWN_2D * q_u, POLICY_HND *dom_pol, DOM_SID *sid) +void init_samr_q_unknown_2d(SAMR_Q_UNKNOWN_2D * q_u, POLICY_HND *domain_pol, DOM_SID +*sid) { DEBUG(5, ("samr_init_samr_q_unknown_2d\n")); - q_u->dom_pol = *dom_pol; + q_u->domain_pol = *domain_pol; init_dom_sid2(&q_u->sid, sid); } @@ -206,7 +206,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("domain_pol", &q_u->dom_pol, ps, depth)) + if(!smb_io_pol_hnd("domain_pol", &q_u->domain_pol, ps, depth)) return False; if(!smb_io_dom_sid2("sid", &q_u->sid, ps, depth)) @@ -245,12 +245,12 @@ ********************************************************************/ void init_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN * q_u, - POLICY_HND *pol, uint32 flags, + POLICY_HND *connect_pol, uint32 flags, const DOM_SID *sid) { DEBUG(5, ("samr_init_samr_q_open_domain\n")); - q_u->pol = *pol; + q_u->connect_pol = *connect_pol; q_u->flags = flags; init_dom_sid2(&q_u->dom_sid, sid); } @@ -271,7 +271,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_u->pol, ps, depth)) + if(!smb_io_pol_hnd("connect_pol", &q_u->connect_pol, ps, depth)) return False; if(!prs_uint32("flags", ps, depth, &q_u->flags)) @@ -395,11 +395,11 @@ ********************************************************************/ void init_samr_q_query_sec_obj(SAMR_Q_QUERY_SEC_OBJ * q_u, - POLICY_HND *user_pol, uint32 sec_info) + POLICY_HND *pol, uint32 sec_info) { DEBUG(5, ("samr_init_samr_q_query_sec_obj\n")); - q_u->user_pol = *user_pol; + q_u->pol = *pol; q_u->sec_info = sec_info; } @@ -420,7 +420,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("user_pol", &q_u->user_pol, ps, depth)) + if(!smb_io_pol_hnd("pol", &q_u->pol, ps, depth)) return False; if(!prs_uint32("sec_info", ps, depth, &q_u->sec_info)) @@ -1244,13 +1244,13 @@ inits a SAMR_Q_ENUM_DOM_USERS structure. ********************************************************************/ -void init_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS * q_e, POLICY_HND *pol, +void init_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS * q_e, POLICY_HND *domain_pol, uint32 start_idx, uint16 acb_mask, uint16 unk_1, uint32 size) { DEBUG(5, ("init_samr_q_enum_dom_users\n")); - q_e->pol = *pol; + q_e->domain_pol = *domain_pol; q_e->start_idx = start_idx; /* zero indicates lots */ q_e->acb_mask = acb_mask; @@ -1274,7 +1274,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("domain_pol", &q_e->pol, ps, depth)) + if(!smb_io_pol_hnd("domain_pol", &q_e->domain_pol, ps, depth)) return False; if(!prs_uint32("start_idx", ps, depth, &q_e->start_idx)) @@ -1386,13 +1386,13 @@ inits a SAMR_Q_QUERY_DISPINFO structure. ********************************************************************/ -void init_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO * q_e, POLICY_HND *pol, +void init_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO * q_e, POLICY_HND *domain_pol, uint16 switch_level, uint32 start_idx, uint32 max_entries) { DEBUG(5, ("init_samr_q_query_dispinfo\n")); - q_e->domain_pol = *pol; + q_e->domain_pol = *domain_pol; q_e->switch_level = switch_level; @@ -2099,7 +2099,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &r_u->pol, ps, depth)) + if(!smb_io_pol_hnd("group_pol", &r_u->group_pol, ps, depth)) return False; if(!prs_ntstatus("status", ps, depth, &r_u->status)) @@ -2286,14 +2286,14 @@ ********************************************************************/ void init_samr_q_create_dom_group(SAMR_Q_CREATE_DOM_GROUP * q_e, - POLICY_HND *pol, char *acct_desc, + POLICY_HND *domain_pol, char *acct_desc, uint32 access_mask) { int acct_len = acct_desc != NULL ? strlen(acct_desc) : 0; DEBUG(5, ("init_samr_q_create_dom_group\n")); - q_e->pol = *pol; + q_e->domain_pol = *domain_pol; init_uni_hdr(&q_e->hdr_acct_desc, acct_len); init_unistr2(&q_e->uni_acct_desc, acct_desc, acct_len); @@ -2317,7 +2317,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_e->pol, ps, depth)) + if(!smb_io_pol_hnd("domain_pol", &q_e->domain_pol, ps, depth)) return False; if(!smb_io_unihdr("hdr_acct_desc", &q_e->hdr_acct_desc, ps, depth)) @@ -2350,7 +2350,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &r_u->pol, ps, depth)) + if(!smb_io_pol_hnd("group_pol", &r_u->group_pol, ps, depth)) return False; if(!prs_uint32("rid ", ps, depth, &r_u->rid)) @@ -2425,11 +2425,11 @@ ********************************************************************/ void init_samr_q_del_groupmem(SAMR_Q_DEL_GROUPMEM * q_e, - POLICY_HND *pol, uint32 rid) + POLICY_HND *group_pol, uint32 rid) { DEBUG(5, ("init_samr_q_del_groupmem\n")); - q_e->pol = *pol; + q_e->group_pol = *group_pol; q_e->rid = rid; } @@ -2449,7 +2449,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_e->pol, ps, depth)) + if(!smb_io_pol_hnd("group_pol", &q_e->group_pol, ps, depth)) return False; if(!prs_uint32("rid", ps, depth, &q_e->rid)) @@ -2497,11 +2497,11 @@ ********************************************************************/ void init_samr_q_add_groupmem(SAMR_Q_ADD_GROUPMEM * q_e, - POLICY_HND *pol, uint32 rid) + POLICY_HND *group_pol, uint32 rid) { DEBUG(5, ("init_samr_q_add_groupmem\n")); - q_e->pol = *pol; + q_e->group_pol = *group_pol; q_e->rid = rid; q_e->unknown = 0x0005; } @@ -2522,7 +2522,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_e->pol, ps, depth)) + if(!smb_io_pol_hnd("group_pol", &q_e->group_pol, ps, depth)) return False; if(!prs_uint32("rid ", ps, depth, &q_e->rid)) @@ -2572,11 +2572,11 @@ ********************************************************************/ void init_samr_q_set_groupinfo(SAMR_Q_SET_GROUPINFO * q_e, - POLICY_HND *pol, GROUP_INFO_CTR * ctr) + POLICY_HND *group_pol, GROUP_INFO_CTR * ctr) { DEBUG(5, ("init_samr_q_set_groupinfo\n")); - q_e->pol = *pol; + q_e->group_pol = *group_pol; q_e->ctr = ctr; } @@ -2596,7 +2596,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_e->pol, ps, depth)) + if(!smb_io_pol_hnd("group_pol", &q_e->group_pol, ps, depth)) return False; if(!samr_group_info_ctr("ctr", &q_e->ctr, ps, depth)) @@ -2643,11 +2643,11 @@ ********************************************************************/ void init_samr_q_query_groupinfo(SAMR_Q_QUERY_GROUPINFO * q_e, - POLICY_HND *pol, uint16 switch_level) + POLICY_HND *group_pol, uint16 switch_level) { DEBUG(5, ("init_samr_q_query_groupinfo\n")); - q_e->pol = *pol; + q_e->group_pol = *group_pol; q_e->switch_level = switch_level; } @@ -2668,7 +2668,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_e->pol, ps, depth)) + if(!smb_io_pol_hnd("group_pol", &q_e->group_pol, ps, depth)) return False; if(!prs_uint16("switch_level", ps, depth, &q_e->switch_level)) @@ -2861,11 +2861,11 @@ ********************************************************************/ void init_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS * q_u, - POLICY_HND *hnd) + POLICY_HND *user_pol) { DEBUG(5, ("init_samr_q_query_usergroups\n")); - q_u->pol = *hnd; + q_u->user_pol = *user_pol; } /******************************************************************* @@ -2884,7 +2884,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_u->pol, ps, depth)) + if(!smb_io_pol_hnd("user_pol", &q_u->user_pol, ps, depth)) return False; return True; @@ -2999,12 +2999,12 @@ ********************************************************************/ void init_samr_q_enum_domains(SAMR_Q_ENUM_DOMAINS * q_e, - POLICY_HND *pol, + POLICY_HND *connect_pol, uint32 start_idx, uint32 size) { DEBUG(5, ("init_samr_q_enum_domains\n")); - q_e->pol = *pol; + q_e->connect_pol = *connect_pol; q_e->start_idx = start_idx; q_e->max_size = size; @@ -3026,7 +3026,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_e->pol, ps, depth)) + if(!smb_io_pol_hnd("connect_pol", &q_e->connect_pol, ps, depth)) return False; if(!prs_uint32("start_idx", ps, depth, &q_e->start_idx)) @@ -3138,12 +3138,12 @@ ********************************************************************/ void init_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS * q_e, - POLICY_HND *pol, + POLICY_HND *domain_pol, uint32 start_idx, uint32 size) { DEBUG(5, ("init_samr_q_enum_dom_groups\n")); - q_e->pol = *pol; + q_e->domain_pol = *domain_pol; q_e->start_idx = start_idx; q_e->max_size = size; @@ -3165,7 +3165,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &(q_e->pol), ps, depth)) + if(!smb_io_pol_hnd("domain_pol", &(q_e->domain_pol), ps, depth)) return False; if(!prs_uint32("start_idx", ps, depth, &q_e->start_idx)) @@ -3272,12 +3272,12 @@ ********************************************************************/ void init_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES * q_e, - POLICY_HND *pol, uint32 start_idx, + POLICY_HND *domain_pol, uint32 start_idx, uint32 size) { DEBUG(5, ("init_samr_q_enum_dom_aliases\n")); - q_e->pol = *pol; + q_e->domain_pol = *domain_pol; q_e->start_idx = start_idx; q_e->max_size = size; @@ -3300,7 +3300,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_e->pol, ps, depth)) + if(!smb_io_pol_hnd("domain_pol", &q_e->domain_pol, ps, depth)) return False; if(!prs_uint32("start_idx", ps, depth, &q_e->start_idx)) @@ -3538,11 +3538,11 @@ ********************************************************************/ void init_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO * q_e, - POLICY_HND *pol, uint16 switch_level) + POLICY_HND *alias_pol, uint16 switch_level) { DEBUG(5, ("init_samr_q_query_aliasinfo\n")); - q_e->pol = *pol; + q_e->alias_pol = *alias_pol; q_e->switch_level = switch_level; } @@ -3562,7 +3562,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &(q_e->pol), ps, depth)) + if(!smb_io_pol_hnd("alias_pol", &(q_e->alias_pol), ps, depth)) return False; if(!prs_uint16("switch_level", ps, depth, &q_e->switch_level)) @@ -3680,13 +3680,13 @@ ********************************************************************/ void init_samr_q_query_useraliases(SAMR_Q_QUERY_USERALIASES * q_u, - POLICY_HND *hnd, + POLICY_HND *user_pol, uint32 num_sids, uint32 *ptr_sid, DOM_SID2 * sid) { DEBUG(5, ("init_samr_q_query_useraliases\n")); - q_u->pol = *hnd; + q_u->user_pol = *user_pol; q_u->num_sids1 = num_sids; q_u->ptr = 1; @@ -3715,7 +3715,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_u->pol, ps, depth)) + if(!smb_io_pol_hnd("user_pol", &q_u->user_pol, ps, depth)) return False; if(!prs_uint32("num_sids1", ps, depth, &q_u->num_sids1)) @@ -3858,12 +3858,12 @@ inits a SAMR_Q_OPEN_ALIAS structure. ********************************************************************/ -void init_samr_q_open_alias(SAMR_Q_OPEN_ALIAS * q_u, POLICY_HND *pol, +void init_samr_q_open_alias(SAMR_Q_OPEN_ALIAS * q_u, POLICY_HND *domain_pol, uint32 access_mask, uint32 rid) { DEBUG(5, ("init_samr_q_open_alias\n")); - q_u->dom_pol = *pol; + q_u->domain_pol = *domain_pol; q_u->access_mask = access_mask; q_u->rid_alias = rid; } @@ -3884,7 +3884,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("domain_pol", &q_u->dom_pol, ps, depth)) + if(!smb_io_pol_hnd("domain_pol", &q_u->domain_pol, ps, depth)) return False; if(!prs_uint32("access_mask", ps, depth, &q_u->access_mask)) @@ -3911,7 +3911,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &r_u->pol, ps, depth)) + if(!smb_io_pol_hnd("alias_pol", &r_u->alias_pol, ps, depth)) return False; if(!prs_ntstatus("status", ps, depth, &r_u->status)) @@ -3925,12 +3925,12 @@ ********************************************************************/ void init_samr_q_lookup_rids(TALLOC_CTX *ctx, SAMR_Q_LOOKUP_RIDS * q_u, - POLICY_HND *pol, uint32 flags, + POLICY_HND *domain_pol, uint32 flags, uint32 num_rids, uint32 *rid) { DEBUG(5, ("init_samr_q_lookup_rids\n")); - q_u->pol = *pol; + q_u->domain_pol = *domain_pol; q_u->num_rids1 = num_rids; q_u->flags = flags; @@ -3967,7 +3967,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_u->pol, ps, depth)) + if(!smb_io_pol_hnd("domain_pol", &q_u->domain_pol, ps, depth)) return False; if(!prs_uint32("num_rids1", ps, depth, &q_u->num_rids1)) @@ -4176,13 +4176,13 @@ ********************************************************************/ void init_samr_q_create_dom_alias(SAMR_Q_CREATE_DOM_ALIAS * q_u, - POLICY_HND *hnd, char *acct_desc) + POLICY_HND *domain_pol, char *acct_desc) { int acct_len = acct_desc != NULL ? strlen(acct_desc) : 0; DEBUG(5, ("init_samr_q_create_dom_alias\n")); - q_u->dom_pol = *hnd; + q_u->domain_pol = *domain_pol; init_uni_hdr(&q_u->hdr_acct_desc, acct_len); init_unistr2(&q_u->uni_acct_desc, acct_desc, acct_len); @@ -4206,7 +4206,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("dom_pol", &q_u->dom_pol, ps, depth)) + if(!smb_io_pol_hnd("domain_pol", &q_u->domain_pol, ps, depth)) return False; if(!smb_io_unihdr("hdr_acct_desc", &q_u->hdr_acct_desc, ps, depth)) @@ -4554,14 +4554,14 @@ ********************************************************************/ NTSTATUS init_samr_q_lookup_names(TALLOC_CTX *ctx, SAMR_Q_LOOKUP_NAMES * q_u, - POLICY_HND *pol, uint32 flags, + POLICY_HND *domain_pol, uint32 flags, uint32 num_names, const char **name) { uint32 i; DEBUG(5, ("init_samr_q_lookup_names\n")); - q_u->pol = *pol; + q_u->domain_pol = *domain_pol; q_u->num_names1 = num_names; q_u->flags = flags; @@ -4604,7 +4604,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_u->pol, ps, depth)) + if(!smb_io_pol_hnd("domain_pol", &q_u->domain_pol, ps, depth)) return False; if(!prs_uint32("num_names1", ps, depth, &q_u->num_names1)) @@ -4841,12 +4841,12 @@ ********************************************************************/ void init_samr_q_open_user(SAMR_Q_OPEN_USER * q_u, - POLICY_HND *pol, + POLICY_HND *domain_pol, uint32 access_mask, uint32 rid) { DEBUG(5, ("samr_init_samr_q_open_user\n")); - q_u->domain_pol = *pol; + q_u->domain_pol = *domain_pol; q_u->access_mask = access_mask; q_u->user_rid = rid; } @@ -4909,7 +4909,7 @@ ********************************************************************/ void init_samr_q_create_user(SAMR_Q_CREATE_USER * q_u, - POLICY_HND *pol, + POLICY_HND *domain_pol, const char *name, uint32 acb_info, uint32 access_mask) { @@ -4918,7 +4918,7 @@ DEBUG(5, ("samr_init_samr_q_create_user\n")); - q_u->domain_pol = *pol; + q_u->domain_pol = *domain_pol; init_uni_hdr(&q_u->hdr_name, len_name); init_unistr2(&q_u->uni_name, name, len_name); @@ -4995,11 +4995,11 @@ ********************************************************************/ void init_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO * q_u, - POLICY_HND *hnd, uint16 switch_value) + POLICY_HND *user_pol, uint16 switch_value) { DEBUG(5, ("init_samr_q_query_userinfo\n")); - q_u->pol = *hnd; + q_u->user_pol = *user_pol; q_u->switch_value = switch_value; } @@ -5019,7 +5019,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_u->pol, ps, depth)) + if(!smb_io_pol_hnd("user_pol", &q_u->user_pol, ps, depth)) return False; if(!prs_uint16("switch_value", ps, depth, &q_u->switch_value)) /* 0x0015 or 0x0011 */ @@ -6365,12 +6365,12 @@ ********************************************************************/ void init_samr_q_set_userinfo(SAMR_Q_SET_USERINFO * q_u, - POLICY_HND *hnd, unsigned char sess_key[16], + POLICY_HND *user_pol, unsigned char sess_key[16], uint16 switch_value, void *info) { DEBUG(5, ("init_samr_q_set_userinfo\n")); - q_u->pol = *hnd; + q_u->user_pol = *user_pol; q_u->switch_value = switch_value; init_samr_userinfo_ctr(q_u->ctr, sess_key, switch_value, info); } @@ -6391,7 +6391,7 @@ if(!prs_align(ps)) return False; - smb_io_pol_hnd("pol", &(q_u->pol), ps, depth); + smb_io_pol_hnd("user_pol", &(q_u->user_pol), ps, depth); if(!prs_uint16("switch_value", ps, depth, &q_u->switch_value)) return False; @@ -6439,12 +6439,12 @@ ********************************************************************/ void init_samr_q_set_userinfo2(SAMR_Q_SET_USERINFO2 * q_u, - POLICY_HND *hnd, unsigned char sess_key[16], + POLICY_HND *user_pol, unsigned char sess_key[16], uint16 switch_value, SAM_USERINFO_CTR * ctr) { DEBUG(5, ("init_samr_q_set_userinfo2\n")); - q_u->pol = *hnd; + q_u->user_pol = *user_pol; q_u->switch_value = switch_value; q_u->ctr = ctr; @@ -6478,7 +6478,7 @@ if(!prs_align(ps)) return False; - if(!smb_io_pol_hnd("pol", &q_u->pol, ps, depth)) + if(!smb_io_pol_hnd("user_pol", &q_u->user_pol, ps, depth)) return False; if(!prs_uint16("switch_value", ps, depth, &q_u->switch_value))
--- ./samba32606-orig/source/rpc_server/srv_samr_nt.c Wed Jun 26 17:21:45 2002 +++ ./samba32606/source/rpc_server/srv_samr_nt.c Wed Jun 26 23:33:27 2002 @@ -391,7 +391,7 @@ r_u->status = NT_STATUS_OK; /* find the connection policy handle. */ - if (!find_policy_by_hnd(p, &q_u->pol, NULL)) + if (!find_policy_by_hnd(p, &q_u->connect_pol, NULL)) return NT_STATUS_INVALID_HANDLE; /* associate the domain SID with the (unique) handle. */ @@ -509,7 +509,7 @@ /* Get the SID. */ - if (!get_lsa_policy_samr_sid(p, &q_u->user_pol, &pol_sid)) + if (!get_lsa_policy_samr_sid(p, &q_u->pol, &pol_sid)) return NT_STATUS_INVALID_HANDLE; DEBUG(10,("_samr_query_sec_obj: querying security on SID: %s\n", sid_to_string(str_sid, &pol_sid))); @@ -575,7 +575,7 @@ r_u->status = NT_STATUS_OK; /* find the policy handle. open a policy on it. */ - if (!find_policy_by_hnd(p, &q_u->pol, NULL)) + if (!find_policy_by_hnd(p, &q_u->domain_pol, NULL)) return NT_STATUS_INVALID_HANDLE; DEBUG(5,("_samr_enum_dom_users: %d\n", __LINE__)); @@ -835,7 +835,7 @@ r_u->status = NT_STATUS_OK; - if (!get_lsa_policy_samr_sid(p, &q_u->pol, &sid)) + if (!get_lsa_policy_samr_sid(p, &q_u->domain_pol, &sid)) return NT_STATUS_INVALID_HANDLE; DEBUG(5,("samr_reply_enum_dom_groups: %d\n", __LINE__)); @@ -867,7 +867,7 @@ r_u->status = NT_STATUS_OK; - if (!get_lsa_policy_samr_sid(p, &q_u->pol, &sid)) + if (!get_lsa_policy_samr_sid(p, &q_u->domain_pol, &sid)) return NT_STATUS_INVALID_HANDLE; sid_to_string(sid_str, &sid); @@ -1089,7 +1089,7 @@ DEBUG(5,("_samr_query_aliasinfo: %d\n", __LINE__)); /* find the policy handle. open a policy on it. */ - if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info)) + if (!find_policy_by_hnd(p, &q_u->alias_pol, (void **)&info)) return NT_STATUS_INVALID_HANDLE; if (!sid_check_is_in_our_domain(&info->sid) && @@ -1201,7 +1201,7 @@ ZERO_ARRAY(rid); ZERO_ARRAY(type); - if (!get_lsa_policy_samr_sid(p, &q_u->pol, &pol_sid)) { + if (!get_lsa_policy_samr_sid(p, &q_u->domain_pol, &pol_sid)) { init_samr_r_lookup_names(p->mem_ctx, r_u, 0, NULL, NULL, NT_STATUS_OBJECT_TYPE_MISMATCH); return r_u->status; } @@ -1354,7 +1354,7 @@ DEBUG(5,("_samr_lookup_rids: %d\n", __LINE__)); /* find the policy handle. open a policy on it. */ - if (!get_lsa_policy_samr_sid(p, &q_u->pol, &pol_sid)) + if (!get_lsa_policy_samr_sid(p, &q_u->domain_pol, &pol_sid)) return NT_STATUS_INVALID_HANDLE; if (num_rids > MAX_SAM_ENTRIES) { @@ -1626,7 +1626,7 @@ r_u->status=NT_STATUS_OK; /* search for the handle */ - if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info)) + if (!find_policy_by_hnd(p, &q_u->user_pol, (void **)&info)) return NT_STATUS_INVALID_HANDLE; if (!sid_check_is_in_our_domain(&info->sid)) @@ -1744,7 +1744,7 @@ DEBUG(5,("_samr_query_usergroups: %d\n", __LINE__)); /* find the policy handle. open a policy on it. */ - if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info)) + if (!find_policy_by_hnd(p, &q_u->user_pol, (void **)&info)) return NT_STATUS_INVALID_HANDLE; if (!sid_check_is_in_our_domain(&info->sid)) @@ -2223,9 +2223,9 @@ NTSTATUS _api_samr_open_alias(pipes_struct *p, SAMR_Q_OPEN_ALIAS *q_u, SAMR_R_OPEN_ALIAS *r_u) { DOM_SID sid; - POLICY_HND domain_pol = q_u->dom_pol; + POLICY_HND domain_pol = q_u->domain_pol; uint32 alias_rid = q_u->rid_alias; - POLICY_HND *alias_pol = &r_u->pol; + POLICY_HND *alias_pol = &r_u->alias_pol; struct samr_info *info = NULL; r_u->status = NT_STATUS_OK; @@ -2520,7 +2520,7 @@ NTSTATUS _samr_set_userinfo(pipes_struct *p, SAMR_Q_SET_USERINFO *q_u, SAMR_R_SET_USERINFO *r_u) { DOM_SID sid; - POLICY_HND *pol = &q_u->pol; + POLICY_HND *user_pol = &q_u->user_pol; uint16 switch_value = q_u->switch_value; SAM_USERINFO_CTR *ctr = q_u->ctr; @@ -2529,7 +2529,7 @@ r_u->status = NT_STATUS_OK; /* find the policy handle. open a policy on it. */ - if (!get_lsa_policy_samr_sid(p, pol, &sid)) + if (!get_lsa_policy_samr_sid(p, user_pol, &sid)) return NT_STATUS_INVALID_HANDLE; DEBUG(5, ("_samr_set_userinfo: sid:%s, level:%d\n", sid_string_static(&sid), switch_value)); @@ -2599,7 +2599,7 @@ { DOM_SID sid; SAM_USERINFO_CTR *ctr = q_u->ctr; - POLICY_HND *pol = &q_u->pol; + POLICY_HND *user_pol = &q_u->user_pol; uint16 switch_value = q_u->switch_value; DEBUG(5, ("samr_reply_set_userinfo2: %d\n", __LINE__)); @@ -2607,7 +2607,7 @@ r_u->status = NT_STATUS_OK; /* find the policy handle. open a policy on it. */ - if (!get_lsa_policy_samr_sid(p, pol, &sid)) + if (!get_lsa_policy_samr_sid(p, user_pol, &sid)) return NT_STATUS_INVALID_HANDLE; DEBUG(5, ("samr_reply_set_userinfo2: sid:%s\n", sid_string_static(&sid))); @@ -2673,7 +2673,7 @@ DEBUG(5,("_samr_query_useraliases: %d\n", __LINE__)); /* find the policy handle. open a policy on it. */ - if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info)) + if (!find_policy_by_hnd(p, &q_u->user_pol, (void **)&info)) return NT_STATUS_INVALID_HANDLE; if (!sid_check_is_domain(&info->sid) && @@ -3074,7 +3074,7 @@ BOOL check; /* Find the policy handle. Open a policy on it. */ - if (!get_lsa_policy_samr_sid(p, &q_u->pol, &group_sid)) + if (!get_lsa_policy_samr_sid(p, &q_u->group_pol, &group_sid)) return NT_STATUS_INVALID_HANDLE; sid_to_string(group_sid_str, &group_sid); @@ -3161,7 +3161,7 @@ */ /* Find the policy handle. Open a policy on it. */ - if (!get_lsa_policy_samr_sid(p, &q_u->pol, &group_sid)) + if (!get_lsa_policy_samr_sid(p, &q_u->group_pol, &group_sid)) return NT_STATUS_INVALID_HANDLE; if(!sid_check_is_in_our_domain(&group_sid)) @@ -3404,7 +3404,7 @@ init_privilege(&priv_set); /* Find the policy handle. Open a policy on it. */ - if (!get_lsa_policy_samr_sid(p, &q_u->pol, &dom_sid)) + if (!get_lsa_policy_samr_sid(p, &q_u->domain_pol, &dom_sid)) return NT_STATUS_INVALID_HANDLE; if (!sid_equal(&dom_sid, get_global_sam_sid())) @@ -3439,7 +3439,7 @@ return NT_STATUS_NO_MEMORY; /* get a (unique) handle. open a policy on it. */ - if (!create_policy_hnd(p, &r_u->pol, free_samr_info, (void *)info)) + if (!create_policy_hnd(p, &r_u->group_pol, free_samr_info, (void *)info)) return NT_STATUS_OBJECT_NAME_NOT_FOUND; return NT_STATUS_OK; @@ -3462,7 +3462,7 @@ init_privilege(&priv_set); /* Find the policy handle. Open a policy on it. */ - if (!get_lsa_policy_samr_sid(p, &q_u->dom_pol, &dom_sid)) + if (!get_lsa_policy_samr_sid(p, &q_u->domain_pol, &dom_sid)) return NT_STATUS_INVALID_HANDLE; if (!sid_equal(&dom_sid, get_global_sam_sid())) @@ -3518,7 +3518,7 @@ int num_uids=0; GROUP_INFO_CTR *ctr; - if (!get_lsa_policy_samr_sid(p, &q_u->pol, &group_sid)) + if (!get_lsa_policy_samr_sid(p, &q_u->group_pol, &group_sid)) return NT_STATUS_INVALID_HANDLE; if (!get_domain_group_from_sid(group_sid, &map, MAPPING_WITHOUT_PRIV)) @@ -3565,7 +3565,7 @@ GROUP_MAP map; GROUP_INFO_CTR *ctr; - if (!get_lsa_policy_samr_sid(p, &q_u->pol, &group_sid)) + if (!get_lsa_policy_samr_sid(p, &q_u->group_pol, &group_sid)) return NT_STATUS_INVALID_HANDLE; if (!get_domain_group_from_sid(group_sid, &map, MAPPING_WITH_PRIV)) @@ -3688,7 +3688,7 @@ return NT_STATUS_NO_SUCH_GROUP; /* get a (unique) handle. open a policy on it. */ - if (!create_policy_hnd(p, &r_u->pol, free_samr_info, (void *)info)) + if (!create_policy_hnd(p, &r_u->group_pol, free_samr_info, (void *)info)) return NT_STATUS_OBJECT_NAME_NOT_FOUND; return NT_STATUS_OK;