summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/domain_namemap.c13
-rw-r--r--source3/lib/sids.c14
-rw-r--r--source3/lib/util_pwdb.c9
3 files changed, 20 insertions, 16 deletions
diff --git a/source3/lib/domain_namemap.c b/source3/lib/domain_namemap.c
index 3de5b60785..cc96a014c4 100644
--- a/source3/lib/domain_namemap.c
+++ b/source3/lib/domain_namemap.c
@@ -273,8 +273,6 @@ static void delete_map_list(ubi_slList *map_list)
***************************************************************************/
static BOOL make_mydomain_sid(DOM_NAME_MAP *grp, DOM_MAP_TYPE type)
{
- DEBUG(10,("make_mydomain_sid\n"));
-
if (!map_domain_name_to_sid(&grp->sid, &(grp->nt_domain)))
{
DEBUG(0,("make_mydomain_sid: unknown domain %s\n",
@@ -287,8 +285,10 @@ static BOOL make_mydomain_sid(DOM_NAME_MAP *grp, DOM_MAP_TYPE type)
/*
* only builtin aliases are recognised in S-1-5-20
*/
+ DEBUG(10,("make_mydomain_sid: group %s in builtin domain\n",
+ grp->nt_name));
- if (!lookup_builtin_alias_name(grp->nt_name, "BUILTIN", &grp->sid, &grp->type))
+ if (lookup_builtin_alias_name(grp->nt_name, "BUILTIN", &grp->sid, &grp->type) != 0x0)
{
DEBUG(0,("unix group %s mapped to an unrecognised BUILTIN domain name %s\n",
grp->unix_name, grp->nt_name));
@@ -584,9 +584,6 @@ static ubi_slList *load_name_map(DOM_MAP_TYPE type)
if (!*unixname)
continue;
- DEBUG(5,("unixname = %s, ntname = %s.\n",
- unixname, nt_name));
-
p = strchr(nt_name, '\\');
if (p == NULL)
@@ -602,9 +599,11 @@ static ubi_slList *load_name_map(DOM_MAP_TYPE type)
fstrcpy(nt_group , p);
}
- if (make_name_entry(&new_ep, nt_domain, nt_name, unixname, type))
+ if (make_name_entry(&new_ep, nt_domain, nt_group, unixname, type))
{
ubi_slAddTail(map_list, (ubi_slNode *)new_ep);
+ DEBUG(5,("unixname = %s, ntname = %s\\%s type = %d\n",
+ unixname, nt_domain, nt_group, new_ep->grp.type));
}
}
diff --git a/source3/lib/sids.c b/source3/lib/sids.c
index 432c3349e3..854e9d5786 100644
--- a/source3/lib/sids.c
+++ b/source3/lib/sids.c
@@ -268,22 +268,24 @@ void generate_wellknown_sids(void)
}
/****************************************************************************
- Generate the global machine sid. Look for the MACHINE.SID file first, if
- not found then look in smb.conf and use it to create the MACHINE.SID file.
+ Generate the global machine sid. Look for the DOMAINNAME.SID file first, if
+ not found then look in smb.conf and use it to create the DOMAINNAME.SID file.
****************************************************************************/
-BOOL generate_sam_sid(void)
+BOOL generate_sam_sid(char *domain_name)
{
int fd;
int i;
char *p;
pstring sid_file;
fstring sid_string;
+ fstring file_name;
SMB_STRUCT_STAT st;
uchar raw_sid_data[12];
pstrcpy(sid_file, lp_smb_passwd_file());
p = strrchr(sid_file, '/');
- if (p != NULL) {
+ if (p != NULL)
+ {
*++p = '\0';
}
@@ -295,7 +297,9 @@ BOOL generate_sam_sid(void)
}
}
- pstrcat(sid_file, "MACHINE.SID");
+ slprintf(file_name, sizeof(file_name)-1, "%s.SID", domain_name);
+ strupper(file_name);
+ pstrcat(sid_file, file_name);
if ((fd = sys_open(sid_file, O_RDWR | O_CREAT, 0644)) == -1) {
DEBUG(0,("unable to open or create file %s. Error was %s\n",
diff --git a/source3/lib/util_pwdb.c b/source3/lib/util_pwdb.c
index 50cc0510d8..74d5ff6794 100644
--- a/source3/lib/util_pwdb.c
+++ b/source3/lib/util_pwdb.c
@@ -176,8 +176,6 @@ uint32 lookup_builtin_alias_name(const char *alias_name, const char *domain,
rid = builtin_alias_rids[i].rid;
als_name = builtin_alias_rids[i].name;
- i++;
-
if (strequal(als_name, alias_name))
{
if (sid != NULL)
@@ -193,6 +191,8 @@ uint32 lookup_builtin_alias_name(const char *alias_name, const char *domain,
return 0x0;
}
+ i++;
+
} while (als_name != NULL);
return 0xC0000000 | NT_STATUS_NONE_MAPPED;
@@ -431,9 +431,10 @@ BOOL pwdb_initialise(void)
generate_wellknown_sids();
- if (!generate_sam_sid())
+ if (!generate_sam_sid(global_sam_name))
{
- DEBUG(0,("ERROR: Samba cannot create a SAM SID.\n"));
+ DEBUG(0,("ERROR: Samba cannot create a SAM SID for its domain (%s).\n",
+ global_sam_name));
return False;
}