From 21e107fd42eb953affac28239588458c6c0ee323 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Wed, 21 Oct 1998 21:11:16 +0000 Subject: the next dialog: user-groups. it's not very sensible what appears, but hey: it appears! (This used to be commit 399035098f212e976cc0000a215e0705ebe78c05) --- source3/passdb/passdb.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'source3/passdb/passdb.c') diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index a4bb657e80..0cd2f6ef2e 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -84,6 +84,15 @@ BOOL initialize_password_db(void) * Functions that return/manipulate a struct smb_passwd. */ +/************************************************************************ + Utility function to search smb passwd by rid. +*************************************************************************/ + +struct smb_passwd *iterate_getsmbpwrid(uint32 user_rid) +{ + return iterate_getsmbpwuid(pdb_user_rid_to_uid(user_rid)); +} + /************************************************************************ Utility function to search smb passwd by uid. use this if your database does not have search facilities. @@ -222,6 +231,15 @@ struct smb_passwd *getsmbpwnam(char *name) return pdb_ops->getsmbpwnam(name); } +/************************************************************************ + Routine to search smb passwd by user rid. +*************************************************************************/ + +struct smb_passwd *getsmbpwrid(uint32 user_rid) +{ + return pdb_ops->getsmbpwrid(user_rid); +} + /************************************************************************ Routine to search smb passwd by uid. *************************************************************************/ @@ -962,6 +980,15 @@ Error was %s\n", sid_file, strerror(errno) )); return True; } +/******************************************************************* + converts UNIX uid to an NT User RID. + ********************************************************************/ + +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. ********************************************************************/ -- cgit