From 9141acecdcebd9276107a500435e3d4545020056 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 11 May 1998 18:03:01 +0000 Subject: password back-end database support ldap.c : - added getldap21pwent() function passdb.c : - getsam21pwent() no longer a stub: calls ldap21 or smb21 smbpass.c : - added getsmb21pwent() function (he he :-) lib/rpc/server/srv_samr.c : - removed "specific" calls to ldap functions; replaced with call to get_sampwd_entries instead (which is unfinished). - rewrote get_user_info_21 function to call getsam21pwrid. (This used to be commit c760ebbf127796427c4602aae61952df938c6def) --- source3/passdb/ldap.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'source3/passdb/ldap.c') diff --git a/source3/passdb/ldap.c b/source3/passdb/ldap.c index 8547cf45cf..7af8a1b9f1 100644 --- a/source3/passdb/ldap.c +++ b/source3/passdb/ldap.c @@ -496,12 +496,37 @@ void *startldappwent(BOOL update) *************************************************************************/ struct smb_passwd *getldappwent(void *vp) { + static struct smb_passwd user; + struct ldap_enum_info *ldap_vp = (struct ldap_enum_info *)vp; + + ldap_vp->entry = ldap_next_entry(ldap_vp->ldap_struct, ldap_vp->entry); + + if (ldap_vp->entry != NULL) + { + ldap_get_smb_passwd(ldap_vp->ldap_struct, ldap_vp->entry, &user); + return &user; + } + return NULL; +} + +/************************************************************************* + Routine to return the next entry in the ldap passwd list. + + do not call this function directly. use passdb.c instead. + *************************************************************************/ +struct sam_passwd *getldap21pwent(void *vp) +{ + static struct sam_passwd user; struct ldap_enum_info *ldap_vp = (struct ldap_enum_info *)vp; + ldap_vp->entry = ldap_next_entry(ldap_vp->ldap_struct, ldap_vp->entry); -/* - make_ldap_sam_user_info_21(ldap_struct, entry, &(pw_buf[(*num_entries)]) ); -*/ + + if (ldap_vp->entry != NULL) + { + ldap_get_sam_passwd(ldap_vp->ldap_struct, ldap_vp->entry, &user); + return &user; + } return NULL; } -- cgit