From d8d9f7723337c267a8740750fe19a6387cfbb1f6 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 7 May 1998 18:19:05 +0000 Subject: created "passdb.c" which is an interface point to (at present) either smbpasswd or ldap passwd, at compile-time (-DUSE_LDAP). _none_ of the functions in ldap.c or smbpass.c should be called directly: only those in passdb.c should be used. -DUSE_LDAP is unlikely to compile at the moment. (This used to be commit 57b01ad4ffb14ebd600d4e66602b54ed987f6106) --- source3/passdb/ldap.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'source3/passdb/ldap.c') diff --git a/source3/passdb/ldap.c b/source3/passdb/ldap.c index fedc31cbfc..d9387dfcc4 100644 --- a/source3/passdb/ldap.c +++ b/source3/passdb/ldap.c @@ -475,7 +475,7 @@ static void ldap_get_machine(LDAP *ldap_struct,LDAPMessage *entry, /******************************************************************* find a user or a machine return a smbpass struct. ******************************************************************/ -struct smb_passwd *ldap_get_smbpwd_entry(char *name, int smb_userid) +static struct smb_passwd *ldap_get_smbpwd_entry(char *name, int smb_userid) { LDAP *ldap_struct; LDAPMessage *result; @@ -560,4 +560,24 @@ struct smb_passwd *ldap_get_smbpwd_entry(char *name, int smb_userid) return(&ldap_passwd); } + +/************************************************************************ + Routine to search ldap passwd by name. +*************************************************************************/ + +struct smb_passwd *getldappwnam(char *name) +{ + return ldap_get_smbpwd_entry(name, 0); +} + +/************************************************************************ + Routine to search ldap passwd by uid. +*************************************************************************/ + +struct smb_passwd *getldappwuid(unsigned int uid) +{ + return ldap_get_smbpwd_entry(NULL, uid); +} + + #endif -- cgit