extern DOM_SID global_sid_S_1_1;
extern DOM_SID global_sid_S_1_5_20;
-extern rid_name domain_group_rids[];
-extern rid_name domain_alias_rids[];
-extern rid_name builtin_alias_rids[];
-
/*******************************************************************
This next function should be replaced with something that
dynamically returns the correct user info..... JRA.
}
}
- if (r_e.status == 0x0 &&
- (sid_equal(&sid, &global_sam_sid) ||
- sid_equal(&sid, &global_sid_S_1_5_20)))
- {
- char *name;
- int i = 0;
- got_grps = True;
-
- while (num_entries < MAX_SAM_ENTRIES && ((name = domain_group_rids[i].name) != NULL))
- {
- DOMAIN_GRP tmp_grp;
-
- fstrcpy(tmp_grp.name , name);
- fstrcpy(tmp_grp.comment, "");
- tmp_grp.rid = domain_group_rids[i].rid;
- tmp_grp.attr = 0x7;
-
- if (!add_domain_group(&grps, &num_entries, &tmp_grp))
- {
- r_e.status = 0xC0000000 | NT_STATUS_NO_MEMORY;
- break;
- }
-
- i++;
- }
- }
-
if (r_e.status == 0 && got_grps)
{
make_samr_r_enum_dom_groups(&r_e, q_u->start_idx, num_entries, grps, r_e.status);
/* well-known aliases */
if (sid_equal(&sid, &global_sid_S_1_5_20))
{
- char *name;
+ BOOL ret;
+ /* builtin aliases */
- while ((name = builtin_alias_rids[num_entries].name) != NULL)
+ become_root(True);
+ ret = enumdombuiltins(&alss, &num_entries);
+ unbecome_root(True);
+ if (!ret)
{
- LOCAL_GRP tmp_als;
-
- fstrcpy(tmp_als.name , name);
- fstrcpy(tmp_als.comment, "");
- tmp_als.rid = builtin_alias_rids[num_entries].rid;
-
- if (!add_domain_alias(&alss, &num_entries, &tmp_als))
- {
- r_e.status = 0xC0000000 | NT_STATUS_NO_MEMORY;
- break;
- }
+ r_e.status = 0xC0000000 | NT_STATUS_NO_MEMORY;
}
}
else if (sid_equal(&sid, &global_sam_sid))
{
BOOL ret;
/* local aliases */
- num_entries = 0;
become_root(True);
ret = enumdomaliases(&alss, &num_entries);
fstring user_name;
fstring wks;
- fstrcpy(user_name, unistrn2(q_u->uni_user_name.buffer, q_u->uni_user_name.uni_str_len));
- fstrcpy(wks , unistrn2(q_u->uni_dest_host.buffer, q_u->uni_dest_host.uni_str_len));
+ fstrcpy(user_name, unistr2_to_str(&q_u->uni_user_name));
+ fstrcpy(wks , unistr2_to_str(&q_u->uni_dest_host));
DEBUG(5,("samr_chgpasswd_user: user: %s wks: %s\n", user_name, wks));
reply if the account already exists...
*/
- fstrcpy(mach_acct, unistrn2(q_u.uni_mach_acct.buffer,
- q_u.uni_mach_acct.uni_str_len));
+ fstrcpy(mach_acct, unistr2_to_str(&q_u.uni_mach_acct));
become_root(True);
sam_pass = getsam21pwntnam(mach_acct);