The branch, master has been updated via 2330e52 s3-passdb: use tevent_context in passdb. via 0b6ced6 s3-smbldap: use tevent_context in smbldap. from 7d7ba3b Add systemd service files.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 2330e52cacef0f1cf0e766cd25d23715be5102ef Author: Günther Deschner <g...@samba.org> Date: Thu Oct 27 16:28:27 2011 +0200 s3-passdb: use tevent_context in passdb. Guenther Autobuild-User: Günther Deschner <g...@samba.org> Autobuild-Date: Fri Oct 28 13:09:47 CEST 2011 on sn-devel-104 commit 0b6ced62096cf31142b329056c0d0066d04b344c Author: Günther Deschner <g...@samba.org> Date: Thu Oct 27 16:19:07 2011 +0200 s3-smbldap: use tevent_context in smbldap. Guenther ----------------------------------------------------------------------- Summary of changes: source3/include/passdb.h | 5 +++-- source3/include/smbldap.h | 6 +++--- source3/lib/smbldap.c | 19 ++++++++++--------- source3/passdb/pdb_interface.c | 10 +++++----- source3/passdb/pdb_ldap.c | 2 +- 5 files changed, 22 insertions(+), 20 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 70b21c9..37d35cf 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -32,6 +32,7 @@ #endif #include "../librpc/gen_ndr/lsa.h" +#include <tevent.h> /* group mapping headers */ @@ -801,7 +802,7 @@ bool pdb_element_is_set_or_changed(const struct samu *sampass, NTSTATUS smb_register_passdb(int version, const char *name, pdb_init_function init) ; struct pdb_init_function_entry *pdb_find_backend_entry(const char *name); const struct pdb_init_function_entry *pdb_get_backends(void); -struct event_context *pdb_get_event_context(void); +struct tevent_context *pdb_get_tevent_context(void); NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected); struct pdb_domain_info *pdb_get_domain_info(TALLOC_CTX *mem_ctx); bool pdb_getsampwnam(struct samu *sam_acct, const char *username) ; @@ -872,7 +873,7 @@ bool pdb_sid_to_id(const struct dom_sid *sid, uid_t *uid, gid_t *gid, enum lsa_SidType *type); uint32_t pdb_capabilities(void); bool pdb_new_rid(uint32_t *rid); -bool initialize_password_db(bool reload, struct event_context *event_ctx); +bool initialize_password_db(bool reload, struct tevent_context *tevent_ctx); struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx, enum pdb_search_type type); struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32_t acct_flags); diff --git a/source3/include/smbldap.h b/source3/include/smbldap.h index cce3e1e..9a81c30 100644 --- a/source3/include/smbldap.h +++ b/source3/include/smbldap.h @@ -131,7 +131,7 @@ extern ATTRIB_MAP_ENTRY trustpw_attr_list[]; have to worry about LDAP structure types */ NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, - struct event_context *event_ctx, + struct tevent_context *tevent_ctx, const char *location, struct smbldap_state **smbldap_state); @@ -174,7 +174,7 @@ struct smbldap_state { unsigned int num_failures; time_t last_use; /* monotonic */ - struct event_context *event_context; + struct tevent_context *tevent_context; struct timed_event *idle_event; struct timeval last_rebind; /* monotonic */ @@ -239,7 +239,7 @@ int smbldap_search_suffix (struct smbldap_state *ldap_state, const char *filter, const char **search_attr, LDAPMessage ** result); void smbldap_free_struct(struct smbldap_state **ldap_state) ; -NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct event_context *event_ctx, +NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct tevent_context *tevent_ctx, const char *location, struct smbldap_state **smbldap_state); bool smbldap_has_control(LDAP *ld, const char *control); diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c index b333f30..bb98d44 100644 --- a/source3/lib/smbldap.c +++ b/source3/lib/smbldap.c @@ -26,6 +26,7 @@ #include "smbldap.h" #include "secrets.h" #include "../libcli/security/security.h" +#include <tevent.h> /* Try not to hit the up or down server forever */ @@ -1249,7 +1250,7 @@ done: return rc; } -static void smbldap_idle_fn(struct event_context *event_ctx, +static void smbldap_idle_fn(struct tevent_context *tevent_ctx, struct timed_event *te, struct timeval now_abs, void *private_data); @@ -1310,9 +1311,9 @@ static int smbldap_open(struct smbldap_state *ldap_state) TALLOC_FREE(ldap_state->idle_event); - if (ldap_state->event_context != NULL) { - ldap_state->idle_event = event_add_timed( - ldap_state->event_context, ldap_state, + if (ldap_state->tevent_context != NULL) { + ldap_state->idle_event = tevent_add_timer( + ldap_state->tevent_context, ldap_state, timeval_current_ofs(SMBLDAP_IDLE_TIME, 0), smbldap_idle_fn, ldap_state); } @@ -1859,7 +1860,7 @@ int smbldap_search_suffix (struct smbldap_state *ldap_state, filter, search_attr, 0, result); } -static void smbldap_idle_fn(struct event_context *event_ctx, +static void smbldap_idle_fn(struct tevent_context *tevent_ctx, struct timed_event *te, struct timeval now_abs, void *private_data) @@ -1877,8 +1878,8 @@ static void smbldap_idle_fn(struct event_context *event_ctx, DEBUG(10,("ldap connection not idle...\n")); /* this needs to be made monotonic clock aware inside tevent: */ - state->idle_event = event_add_timed( - event_ctx, state, + state->idle_event = tevent_add_timer( + tevent_ctx, state, timeval_add(&now_abs, SMBLDAP_IDLE_TIME, 0), smbldap_idle_fn, private_data); @@ -1920,7 +1921,7 @@ static int smbldap_state_destructor(struct smbldap_state *state) Intitalise the 'general' ldap structures, on which ldap operations may be conducted *********************************************************************/ -NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct event_context *event_ctx, +NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct tevent_context *tevent_ctx, const char *location, struct smbldap_state **smbldap_state) { @@ -1936,7 +1937,7 @@ NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct event_context *event_ctx, (*smbldap_state)->uri = "ldap://localhost"; } - (*smbldap_state)->event_context = event_ctx; + (*smbldap_state)->tevent_context = tevent_ctx; talloc_set_destructor(*smbldap_state, smbldap_state_destructor); return NT_STATUS_OK; diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index a6a7774..b202d43 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -116,11 +116,11 @@ const struct pdb_init_function_entry *pdb_get_backends(void) * smb_idle_event_list that used to exist in lib/module.c. -- VL */ -static struct event_context *pdb_event_ctx; +static struct tevent_context *pdb_tevent_ctx; -struct event_context *pdb_get_event_context(void) +struct tevent_context *pdb_get_tevent_context(void) { - return pdb_event_ctx; + return pdb_tevent_ctx; } /****************************************************************** @@ -1315,9 +1315,9 @@ bool pdb_new_rid(uint32_t *rid) If uninitialised, context will auto-init on first use. ***************************************************************/ -bool initialize_password_db(bool reload, struct event_context *event_ctx) +bool initialize_password_db(bool reload, struct tevent_context *tevent_ctx) { - pdb_event_ctx = event_ctx; + pdb_tevent_ctx = tevent_ctx; return (pdb_get_methods_reload(reload) != NULL); } diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index feda002..b59eeb9 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -6487,7 +6487,7 @@ static NTSTATUS pdb_init_ldapsam_common(struct pdb_methods **pdb_method, const c return NT_STATUS_NO_MEMORY; } - nt_status = smbldap_init(*pdb_method, pdb_get_event_context(), + nt_status = smbldap_init(*pdb_method, pdb_get_tevent_context(), location, &ldap_state->smbldap_state); if ( !NT_STATUS_IS_OK(nt_status) ) { -- Samba Shared Repository