From a3ddfa5069c9df07626135aa5fd2ec411c41943f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 5 Jul 2003 09:46:12 +0000 Subject: Fixes to our LDAP/vampire codepaths: - Try better to add the appropriate mapping between UID and SIDs, based on Get_Pwnam() - Look for previous users (lookup by SID) and correctly modify the existing entry in that case - Map the root user to the Admin SID as a 'well known user' - Save the LDAPMessage result on the SAM_ACCOUNT for use in the next 'update' call on that user. This means that VL's very nice work on atomic LDAP updates now really gets used properly! - This also means that we know the right DN to update, without the extra round-trips to the server. Andrew Bartlett (This used to be commit c7118cb31dac24db3b762fe68ce655b17ea102e0) --- source3/sam/idmap_util.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/sam') diff --git a/source3/sam/idmap_util.c b/source3/sam/idmap_util.c index 3125c647d6..8c66ef9ab0 100644 --- a/source3/sam/idmap_util.c +++ b/source3/sam/idmap_util.c @@ -402,5 +402,16 @@ BOOL idmap_init_wellknown_sids(void) SAFE_FREE(map); } + /* Fill in the SID for the administrator account. */ + id.uid = 0; + sid_copy(&sid, get_global_sam_sid()); + sid_append_rid(&sid, DOMAIN_USER_RID_ADMIN); + + if (!NT_STATUS_IS_OK(wellknown_id_init(&sid, id, ID_USERID))) { + DEBUG(0, ("Failed to setup UID mapping for ADMINISTRATOR (%s) to (%u)\n", + sid_to_string(sid_string, &sid), (unsigned int)id.uid)); + return False; + } + return True; } -- cgit