As pdb_ldap.c does not compile in HEAD anyway, a not-compiled merge
authorVolker Lendecke <vlendec@samba.org>
Fri, 9 Nov 2001 22:15:33 +0000 (22:15 +0000)
committerVolker Lendecke <vlendec@samba.org>
Fri, 9 Nov 2001 22:15:33 +0000 (22:15 +0000)
from 2_2.

Volker

source/passdb/pdb_ldap.c

index 9502fc5fe4e77cbdcc253faee3607d95060a418a..62c3a1b4a27cc91c10ca7ac0e49099c4dc557254 100644 (file)
@@ -439,9 +439,9 @@ static BOOL init_sam_from_ldap (SAM_ACCOUNT * sampass,
        get_single_attribute(ldap_struct, entry, "description", acct_desc);
        get_single_attribute(ldap_struct, entry, "userWorkstations", workstations);
        get_single_attribute(ldap_struct, entry, "rid", temp);
-       user_rid = (uint32)strtol(temp, NULL, 16);
+       user_rid = (uint32)strtol(temp, NULL, 10);
        get_single_attribute(ldap_struct, entry, "primaryGroupID", temp);
-       group_rid = (uint32)strtol(temp, NULL, 16);
+       group_rid = (uint32)strtol(temp, NULL, 10);
 
 
        /* These values MAY be in LDAP, but they can also be retrieved through 
@@ -577,9 +577,13 @@ static BOOL init_ldap_from_sam (LDAPMod *** mods, int ldap_state, const SAM_ACCO
        make_a_mod(mods, ldap_state, "description", pdb_get_acct_desc(sampass));
        make_a_mod(mods, ldap_state, "userWorkstations", pdb_get_workstations(sampass));
 
+       if ( !sampass->user_rid)
+               sampass->user_rid = pdb_uid_to_user_rid(pdb_get_uid(sampass));
        slprintf(temp, sizeof(temp) - 1, "%i", sampass->user_rid);
        make_a_mod(mods, ldap_state, "rid", temp);
 
+       if ( !sampass->group_rid)
+               sampass->group_rid = pdb_gid_to_group_rid(pdb_get_gid(sampass));
        slprintf(temp, sizeof(temp) - 1, "%i", sampass->group_rid);
        make_a_mod(mods, ldap_state, "primaryGroupID", temp);