svn commit: samba r13684 - in trunk/source/passdb: .

idra at samba.org idra at samba.org
Fri Feb 24 22:33:25 GMT 2006


Author: idra
Date: 2006-02-24 22:33:24 +0000 (Fri, 24 Feb 2006)
New Revision: 13684

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13684

Log:

following last jerry's patch, avoid to set the primary group SID


Modified:
   trunk/source/passdb/pdb_ldap.c


Changeset:
Modified: trunk/source/passdb/pdb_ldap.c
===================================================================
--- trunk/source/passdb/pdb_ldap.c	2006-02-24 22:26:53 UTC (rev 13683)
+++ trunk/source/passdb/pdb_ldap.c	2006-02-24 22:33:24 UTC (rev 13684)
@@ -4548,7 +4548,6 @@
 	BOOL is_machine = False;
 	BOOL is_new_entry = False;
 	LDAPMod **mods = NULL;
-	char *groupsidstr;
 	char *usersidstr;
 	char *actflags;
 	char *username;
@@ -4587,7 +4586,6 @@
 	}
 	
 	if (num_result == 1) {
-		GROUP_MAP map;
 		char *tmp;
 
 		/* check if it is just a posix account.
@@ -4606,7 +4604,7 @@
 			return NT_STATUS_USER_EXISTS;
 		}
 
-		/* it is just a posix account, retrieve the user_sid and group_sid for later use */
+		/* it is just a posix account, retrieve the user_sid and the gid for later use */
 		if (!smbldap_get_single_attribute(priv2ld(ldap_state), entry, "gidNumber", str, sizeof(str)-1)) {
 			DEBUG (1, ("ldapsam_create_user: Couldn't retrieve the gidNumber for [%s]?!?!\n", name));
 			ldap_msgfree(result);
@@ -4615,14 +4613,6 @@
 		
 		gid = strtoul(str, NULL, 10);
 
-		if (!NT_STATUS_IS_OK((ret = ldapsam_getgrgid(my_methods, &map, gid)))) {
-			DEBUG(1, ("ldapsam_create_user: User's primary group is not mapped! Fail.\n"));
-			ldap_msgfree(result);
-			return ret;
-		}
-
-		sid_copy(&group_sid, &map.sid);
-
 		tmp = smbldap_get_dn(priv2ld(ldap_state), entry);
 		if (!tmp) {
 			DEBUG(1, ("ldapsam_create_user: Couldn't retrieve the DN for [%s]?!?!\n", name));
@@ -4698,8 +4688,6 @@
 	sid_copy(&user_sid, get_global_sam_sid());
 	sid_append_rid(&user_sid, *rid);
 
-	sid_to_string(str, &group_sid);
-	groupsidstr = talloc_strdup(tmp_ctx, str);
 	sid_to_string(str, &user_sid);
 	usersidstr = talloc_strdup(tmp_ctx, str);
 
@@ -4709,13 +4697,12 @@
 		actflags = talloc_strdup(tmp_ctx, pdb_encode_acct_ctrl(acb_info & ACB_DISABLED, NEW_PW_FORMAT_SPACE_PADDED_LEN));
 	}
 
-	if (!groupsidstr || !usersidstr || !actflags) {
+	if (!usersidstr || !actflags) {
 		DEBUG(0,("ldapsam_create_user: Out of memory!\n"));
 		return NT_STATUS_NO_MEMORY;
 	}
 
 	smbldap_set_mod(&mods, LDAP_MOD_ADD, "objectclass", LDAP_OBJ_SAMBASAMACCOUNT);
-	smbldap_set_mod(&mods, LDAP_MOD_ADD, get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_PRIMARY_GROUP_SID), usersidstr);
 	smbldap_set_mod(&mods, LDAP_MOD_ADD, get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_USER_SID), usersidstr);
 	smbldap_set_mod(&mods, LDAP_MOD_ADD, get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_DISPLAY_NAME), name);
 	smbldap_set_mod(&mods, LDAP_MOD_ADD, get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_ACB_INFO), actflags);



More information about the samba-cvs mailing list