summaryrefslogtreecommitdiff
path: root/source3/passdb/pdb_nisplus.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_nisplus.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_nisplus.c')
-rw-r--r--source3/passdb/pdb_nisplus.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/passdb/pdb_nisplus.c b/source3/passdb/pdb_nisplus.c
index ce642fa5f5..145e1d4f0c 100644
--- a/source3/passdb/pdb_nisplus.c
+++ b/source3/passdb/pdb_nisplus.c
@@ -114,6 +114,25 @@ static VOLATILE sig_atomic_t gotalarm;
#define NPF_WORKSTATIONS 20
#define NPF_HOURS 21
+
+/*******************************************************************
+ 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);
+}
+
/***************************************************************
Signal function to tell us we timed out.
****************************************************************/