From 844a5697761ec38f9f11728946b870bcf841a0e2 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 27 Oct 2017 00:48:42 -0400 Subject: [PATCH] Started prepping for the move from LDAP Access to LDAP Sync --- citadel/citadel_ldap.h | 2 +- citadel/housekeeping.c | 4 +++- citadel/ldap.c | 2 +- citadel/user_ops.c | 6 ++++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/citadel/citadel_ldap.h b/citadel/citadel_ldap.h index ed9373455..a8e03292f 100644 --- a/citadel/citadel_ldap.h +++ b/citadel/citadel_ldap.h @@ -16,4 +16,4 @@ int CtdlTryUserLDAP(char *username, char *found_dn, int found_dn_size, char *ful int CtdlTryPasswordLDAP(char *user_dn, const char *password); int Ctdl_LDAP_to_vCard(char *ldap_dn, struct vCard *v); int extract_email_addresses_from_ldap(char *ldap_dn, char *emailaddrs); -void CtdlPopulateUsersFromLDAP(void); +void CtdlSynchronizeUsersFromLDAP(void); diff --git a/citadel/housekeeping.c b/citadel/housekeeping.c index ee12b16a7..f3577c0cf 100644 --- a/citadel/housekeeping.c +++ b/citadel/housekeeping.c @@ -127,7 +127,9 @@ void do_housekeeping(void) { /* Then, do the "once per minute" stuff... */ if (do_perminute_housekeeping_now) { cdb_check_handles(); - //CtdlPopulateUsersFromLDAP(); // This one isn't from a module so we put it here +#ifdef HAVE_LDAP + CtdlSynchronizeUsersFromLDAP(); // This one isn't from a module so we put it here +#endif PerformSessionHooks(EVT_TIMER); // Run all registered TIMER hooks } diff --git a/citadel/ldap.c b/citadel/ldap.c index 2a770f839..9855fb7b7 100644 --- a/citadel/ldap.c +++ b/citadel/ldap.c @@ -549,7 +549,7 @@ int extract_email_addresses_from_ldap(char *ldap_dn, char *emailaddrs) /* * Scan LDAP for users and populate Citadel's user database with everyone */ -void CtdlPopulateUsersFromLDAP(void) +void CtdlSynchronizeUsersFromLDAP(void) { LDAP *ldserver = NULL; int i; diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 0a61cb0e2..5cdd4977a 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -461,8 +461,10 @@ void rebuild_usersbynumber(void) { * getuserbyuid() - get user by system uid (for PAM mode authentication) * returns 0 if user was found * - * WARNING: don't use this function unless you absolutely have to. It does - * a sequential search and therefore is computationally expensive. + * WARNING: don't use this function unless you absolutely have to. It does + * a sequential search and therefore is computationally expensive. + * + * FIXME: build an index, dummy. */ int getuserbyuid(struct ctdluser *usbuf, uid_t number) { -- 2.30.2