1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-27 08:23:49 +03:00

- adding builtin[alias]db.

- lib/sids.c:

	generate_sam_sid() modified to take a domain name: it now
	generates "DOMAIN_NAME.SID".  reasons:

	1) if you run multiple samba servers on the same machine
	under different netbios names as members of a domain,
	they won't all use the same SID, which is a _big_ mistake
	but it would happen _by default_.

	2) we have (had) a problem with sid_to_string() and string_to_sid()
	which cause SIDs to be incorrectly read.  one of the major
	reasons for *NOT* making this change was so as not to disrupt
	existing users.  but as they will be anyway by this bug,
	we might as well go ahead.

- passdb/smbpass.c:

	wanted to change the meaning of the name in the smbpasswd
	file to an "nt" name not a "unix" name.  this is probably
	not a good idea: reverted this.

- output formatting / bug-fixing in rpcclient query_useraliases code.
This commit is contained in:
Luke Leighton
-
parent b95b2b5d44
commit e4930f5f48
14 changed files with 145 additions and 69 deletions

View File

@@ -732,6 +732,7 @@ static void samr_reply_query_useraliases(SAMR_Q_QUERY_USERALIASES *q_u,
{
uint32 status = 0;
LOCAL_GRP *mem_grp = NULL;
uint32 *rid = NULL;
int num_rids = 0;
struct sam_passwd *sam_pass;
@@ -781,21 +782,32 @@ static void samr_reply_query_useraliases(SAMR_Q_QUERY_USERALIASES *q_u,
if (status == 0x0)
{
DEBUG(10,("sid is %s\n", dom_sid_str));
if (sid_equal(&dom_sid, &global_sid_S_1_5_20))
{
DEBUG(10,("lookup on S-1-5-20\n"));
become_root(True);
getuserbuiltinntnam(sam_pass->nt_name, &mem_grp, &num_rids);
unbecome_root(True);
}
else if (sid_equal(&dom_sid, &usr_sid))
{
LOCAL_GRP *mem_grp = NULL;
num_rids = 0;
DEBUG(10,("lookup on Domain SID\n"));
become_root(True);
getuseraliasntnam(sam_pass->nt_name, &mem_grp, &num_rids);
unbecome_root(True);
}
else
{
status = 0xC0000000 | NT_STATUS_NO_SUCH_USER;
}
}
if (status == 0x0 && num_rids > 0)
{
rid = malloc(num_rids * sizeof(uint32));
if (mem_grp != NULL && rid != NULL)
{
@@ -805,11 +817,6 @@ static void samr_reply_query_useraliases(SAMR_Q_QUERY_USERALIASES *q_u,
rid[i] = mem_grp[i].rid;
}
free(mem_grp);
}
}
else
{
status = 0xC0000000 | NT_STATUS_NO_SUCH_USER;
}
}