summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_ldap.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2002-03-19 13:57:53 +0000
committerSimo Sorce <idra@samba.org>2002-03-19 13:57:53 +0000
commit050b80356edea52f1bbb0a27599186ad84c18b73 (patch)
tree1faea4cb8057ee92df2a188cb3bd0909d89ebc5f /source3/passdb/pdb_ldap.c
parentf464ceb109bc9bdc288e0219c4b83da15ba6f1fc (diff)
downloadsamba-050b80356edea52f1bbb0a27599186ad84c18b73.tar.gz
samba-050b80356edea52f1bbb0a27599186ad84c18b73.tar.bz2
samba-050b80356edea52f1bbb0a27599186ad84c18b73.zip
second step to gain free uid<->rid mapping
we still need to free gid<->rid mapping and few other stuff (This used to be commit aa4b6f8181f34196a28951264dd8b631a5deef7f)
Diffstat (limited to 'source3/passdb/pdb_ldap.c')
-rw-r--r--source3/passdb/pdb_ldap.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 4b4ff77eee..a16fb115fc 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -72,6 +72,24 @@ struct ldapsam_privates {
static uint32 ldapsam_get_next_available_nua_rid(struct ldapsam_privates *ldap_state);
/*******************************************************************
+ Converts NT user RID to a UNIX uid.
+ ********************************************************************/
+
+static uid_t pdb_user_rid_to_uid(uint32 user_rid)
+{
+ return (uid_t)(((user_rid & (~USER_RID_TYPE))- 1000)/RID_MULTIPLIER);
+}
+
+/*******************************************************************
+ converts UNIX uid to an NT User RID.
+ ********************************************************************/
+
+static uint32 pdb_uid_to_user_rid(uid_t uid)
+{
+ return (((((uint32)uid)*RID_MULTIPLIER) + 1000) | USER_RID_TYPE);
+}
+
+/*******************************************************************
find the ldap password
******************************************************************/
static BOOL fetch_ldapsam_pw(char *dn, char* pw, int len)
@@ -1498,4 +1516,3 @@ NTSTATUS pdb_init_ldapsam_nua(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method
#endif
-