summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2001-11-09 22:15:33 +0000
committerVolker Lendecke <vlendec@samba.org>2001-11-09 22:15:33 +0000
commit89c6eed93baed829c555e62b83a6350db2f6647b (patch)
tree637b243fe00ea0e048df1c9f85800955fa0a4521 /source3/passdb
parente3abad17417bb9f5f1309039aae8e364871c22d8 (diff)
downloadsamba-89c6eed93baed829c555e62b83a6350db2f6647b.tar.gz
samba-89c6eed93baed829c555e62b83a6350db2f6647b.tar.bz2
samba-89c6eed93baed829c555e62b83a6350db2f6647b.zip
As pdb_ldap.c does not compile in HEAD anyway, a not-compiled merge
from 2_2. Volker (This used to be commit 7d70b30dbdf06de126b78879fc89708ca335f91e)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ldap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 9502fc5fe4..62c3a1b4a2 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -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);