summaryrefslogtreecommitdiff
path: root/source3/groupdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/groupdb')
-rw-r--r--source3/groupdb/aliasfile.c24
-rw-r--r--source3/groupdb/groupfile.c28
2 files changed, 46 insertions, 6 deletions
diff --git a/source3/groupdb/aliasfile.c b/source3/groupdb/aliasfile.c
index 4b8bbe3079..fc87b47c47 100644
--- a/source3/groupdb/aliasfile.c
+++ b/source3/groupdb/aliasfile.c
@@ -130,24 +130,36 @@ static char *get_alias_members(char *p, int *num_mem, LOCAL_GRP_MEMBER **members
{
DOM_SID sid;
uint8 type;
+ BOOL found = False;
- if (lookup_sid(name, &sid, &type))
+ if (strnequal(name, "S-", 2))
{
- (*members) = Realloc((*members), ((*num_mem)+1) * sizeof(LOCAL_GRP_MEMBER));
- (*num_mem)++;
+ /* sid entered directly */
+ string_to_sid(&sid, name);
+ found = lookup_name(&sid, name, &type) == 0x0;
}
else
{
+ found = lookup_sid(name, &sid, &type) == 0x0;
+ }
+
+ if (!found)
+ {
DEBUG(0,("alias database: could not resolve alias named %s\n", name));
continue;
}
+
+ (*members) = Realloc((*members), ((*num_mem)+1) * sizeof(LOCAL_GRP_MEMBER));
+
if ((*members) == NULL)
{
return NULL;
}
- fstrcpy((*members)[(*num_mem)-1].name, name);
- (*members)[(*num_mem)-1].sid_use = type;
- sid_copy(&(*members)[(*num_mem)-1].sid, &sid);
+
+ fstrcpy((*members)[*num_mem].name, name);
+ (*members)[*num_mem].sid_use = type;
+ sid_copy(&(*members)[*num_mem].sid, &sid);
+ (*num_mem)++;
}
return p;
}
diff --git a/source3/groupdb/groupfile.c b/source3/groupdb/groupfile.c
index 88d362e7d4..8044071391 100644
--- a/source3/groupdb/groupfile.c
+++ b/source3/groupdb/groupfile.c
@@ -26,6 +26,9 @@ extern int DEBUGLEVEL;
static char s_readbuf[1024];
+extern DOM_SID global_sam_sid;
+extern fstring global_sam_name;
+
/***************************************************************
Start to enumerate the grppasswd list. Returns a void pointer
to ensure no modification outside this module.
@@ -128,11 +131,36 @@ static char *get_group_members(char *p, int *num_mem, DOMAIN_GRP_MEMBER **member
while (next_token(&p, name, ",", sizeof(fstring)))
{
+ DOM_SID sid;
+ uint8 type;
+ BOOL found = False;
+
+ if (isdigit(name))
+ {
+ uint32 rid = get_number(name);
+ sid_copy(&sid, &global_sam_sid);
+ sid_append_rid(&sid, rid);
+
+ found = lookup_name(&sid, name, &type) == 0x0;
+ }
+ else
+ {
+ found = lookup_sid(name, &sid, &type) == 0x0;
+ }
+
+ if (!found)
+ {
+ DEBUG(0,("alias database: could not resolve name %s in domain %s\n",
+ name, global_sam_name));
+ continue;
+ }
+
(*members) = Realloc((*members), ((*num_mem)+1) * sizeof(DOMAIN_GRP_MEMBER));
if ((*members) == NULL)
{
return NULL;
}
+
fstrcpy((*members)[(*num_mem)].name, name);
(*members)[(*num_mem)].attr = 0x07;
(*num_mem)++;