From 050b80356edea52f1bbb0a27599186ad84c18b73 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 19 Mar 2002 13:57:53 +0000 Subject: 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) --- source3/passdb/pdb_nisplus.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3/passdb/pdb_nisplus.c') 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. ****************************************************************/ -- cgit