s3: Rename server_event_context() to global_event_context()
authorChristof Schmitt <cs@samba.org>
Tue, 21 Aug 2018 18:06:16 +0000 (11:06 -0700)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 7 Sep 2018 15:26:17 +0000 (17:26 +0200)
This reflects that the event context is also used outside of the server
processes.

The command used for the rename:
find . -name '*.[hc]' -print0 | xargs -0 sed -i 's/server_event_context/global_event_context/'

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
31 files changed:
source3/include/proto.h
source3/lib/server_contexts.c
source3/modules/vfs_aio_fork.c
source3/modules/vfs_preopen.c
source3/nmbd/nmbd.c
source3/printing/printing.c
source3/printing/queue_process.c
source3/rpc_server/fss/srv_fss_agent.c
source3/rpc_server/mdssvc/mdssvc.c
source3/rpc_server/samr/srv_samr_nt.c
source3/rpc_server/spoolss/srv_spoolss_nt.c
source3/smbd/server.c
source3/smbd/server_exit.c
source3/torture/test_dbwrap_do_locked.c
source3/torture/test_g_lock.c
source3/utils/smbcontrol.c
source3/winbindd/idmap_ldap.c
source3/winbindd/idmap_rfc2307.c
source3/winbindd/winbindd.c
source3/winbindd/winbindd_cm.c
source3/winbindd/winbindd_cred_cache.c
source3/winbindd/winbindd_domain_info.c
source3/winbindd/winbindd_dual.c
source3/winbindd/winbindd_gpupdate.c
source3/winbindd/winbindd_irpc.c
source3/winbindd/winbindd_pam_auth.c
source3/winbindd/winbindd_pam_auth_crap.c
source3/winbindd/winbindd_pam_chauthtok.c
source3/winbindd/winbindd_pam_chng_pswd_auth_crap.c
source3/winbindd/winbindd_pam_logoff.c
source3/winbindd/winbindd_util.c

index fea4ba5..5b460e5 100644 (file)
@@ -888,8 +888,8 @@ uint32_t get_int_param( const char* param );
 char* get_string_param( const char* param );
 
 /* The following definitions come from lib/server_contexts.c  */
-struct tevent_context *server_event_context(void);
-void server_event_context_free(void);
+struct tevent_context *global_event_context(void);
+void global_event_context_free(void);
 struct messaging_context *server_messaging_context(void);
 void server_messaging_context_free(void);
 
index b21cf0a..40f1ed0 100644 (file)
@@ -23,7 +23,7 @@
 
 static struct tevent_context *server_event_ctx = NULL;
 
-struct tevent_context *server_event_context(void)
+struct tevent_context *global_event_context(void)
 {
        if (!server_event_ctx) {
                /*
@@ -39,7 +39,7 @@ struct tevent_context *server_event_context(void)
        return server_event_ctx;
 }
 
-void server_event_context_free(void)
+void global_event_context_free(void)
 {
        TALLOC_FREE(server_event_ctx);
 }
@@ -55,7 +55,7 @@ struct messaging_context *server_messaging_context(void)
                 * children exiting.
                 */
                server_msg_ctx = messaging_init(NULL,
-                                               server_event_context());
+                                               global_event_context());
        }
        return server_msg_ctx;
 }
index 5ad2dce..a1fed5c 100644 (file)
@@ -256,7 +256,7 @@ static void aio_child_cleanup(struct tevent_context *event_ctx,
                /*
                 * Re-schedule the next cleanup round
                 */
-               list->cleanup_event = tevent_add_timer(server_event_context(), list,
+               list->cleanup_event = tevent_add_timer(global_event_context(), list,
                                                      timeval_add(&now, 30, 0),
                                                      aio_child_cleanup, list);
 
@@ -287,7 +287,7 @@ static struct aio_child_list *init_aio_children(struct vfs_handle_struct *handle
 
        if (children->cleanup_event == NULL) {
                children->cleanup_event =
-                       tevent_add_timer(server_event_context(), children,
+                       tevent_add_timer(global_event_context(), children,
                                         timeval_current_ofs(30, 0),
                                         aio_child_cleanup, children);
                if (children->cleanup_event == NULL) {
index b6a63d3..84b1355 100644 (file)
@@ -239,7 +239,7 @@ static NTSTATUS preopen_init_helper(struct preopen_helper *h)
        }
        close(fdpair[1]);
        h->fd = fdpair[0];
-       h->fde = tevent_add_fd(server_event_context(), h->state, h->fd,
+       h->fde = tevent_add_fd(global_event_context(), h->state, h->fd,
                              TEVENT_FD_READ, preopen_helper_readable, h);
        if (h->fde == NULL) {
                close(h->fd);
index 7884ff8..cb4a46d 100644 (file)
@@ -46,7 +46,7 @@ time_t StartupTime = 0;
 
 struct tevent_context *nmbd_event_context(void)
 {
-       return server_event_context();
+       return global_event_context();
 }
 
 /**************************************************************************** **
@@ -928,7 +928,7 @@ static bool open_sockets(bool isdaemon, int port)
                exit(1);
        }
 
-       msg = messaging_init(NULL, server_event_context());
+       msg = messaging_init(NULL, global_event_context());
        if (msg == NULL) {
                return 1;
        }
index efdd687..105166d 100644 (file)
@@ -1682,7 +1682,7 @@ void print_queue_receive(struct messaging_context *msg,
                return;
        }
 
-       print_queue_update_with_lock(server_event_context(), msg, sharename,
+       print_queue_update_with_lock(global_event_context(), msg, sharename,
                get_printer_fns_from_type((enum printing_types)printing_type),
                lpqcommand, lprmcommand );
 
@@ -1764,7 +1764,7 @@ static void print_queue_update(struct messaging_context *msg_ctx,
        if ( force || background_lpq_updater_pid == -1 ) {
                DEBUG(4,("print_queue_update: updating queue [%s] myself\n", sharename));
                current_printif = get_printer_fns( snum );
-               print_queue_update_with_lock(server_event_context(), msg_ctx,
+               print_queue_update_with_lock(global_event_context(), msg_ctx,
                                             sharename, current_printif,
                                             lpqcommand, lprmcommand);
 
@@ -2307,7 +2307,7 @@ WERROR print_job_delete(const struct auth_session_info *server_info,
                }
        }
 
-       if (!print_job_delete1(server_event_context(), msg_ctx, snum, jobid)) {
+       if (!print_job_delete1(global_event_context(), msg_ctx, snum, jobid)) {
                werr = WERR_ACCESS_DENIED;
                goto err_out;
        }
@@ -2387,7 +2387,7 @@ WERROR print_job_pause(const struct auth_session_info *server_info,
 
        /* Send a printer notify message */
 
-       notify_job_status(server_event_context(), msg_ctx, sharename, jobid,
+       notify_job_status(global_event_context(), msg_ctx, sharename, jobid,
                          JOB_STATUS_PAUSED);
 
        /* how do we tell if this succeeded? */
@@ -2453,7 +2453,7 @@ WERROR print_job_resume(const struct auth_session_info *server_info,
 
        /* Send a printer notify message */
 
-       notify_job_status(server_event_context(), msg_ctx, sharename, jobid,
+       notify_job_status(global_event_context(), msg_ctx, sharename, jobid,
                          JOB_STATUS_QUEUED);
 
        werr = WERR_OK;
@@ -2881,7 +2881,7 @@ WERROR print_job_start(const struct auth_session_info *server_info,
                goto fail;
        }
 
-       pjob_store(server_event_context(), msg_ctx, sharename, jobid, &pjob);
+       pjob_store(global_event_context(), msg_ctx, sharename, jobid, &pjob);
 
        /* Update the 'jobs added' entry used by print_queue_status. */
        add_to_jobs_added(pdb, jobid);
@@ -2896,7 +2896,7 @@ WERROR print_job_start(const struct auth_session_info *server_info,
 
 fail:
        if (jobid != -1) {
-               pjob_delete(server_event_context(), msg_ctx, sharename, jobid);
+               pjob_delete(global_event_context(), msg_ctx, sharename, jobid);
        }
 
        release_print_db(pdb);
@@ -2930,7 +2930,7 @@ void print_job_endpage(struct messaging_context *msg_ctx,
        }
 
        pjob->page_count++;
-       pjob_store(server_event_context(), msg_ctx, sharename, jobid, pjob);
+       pjob_store(global_event_context(), msg_ctx, sharename, jobid, pjob);
 err_out:
        talloc_free(tmp_ctx);
 }
@@ -3014,7 +3014,7 @@ NTSTATUS print_job_end(struct messaging_context *msg_ctx, int snum,
                DEBUG(5,("print_job_end: canceling spool of %s (%s)\n",
                        pjob->filename, pjob->size ? "deleted" : "zero length" ));
                unlink(pjob->filename);
-               pjob_delete(server_event_context(), msg_ctx, sharename, jobid);
+               pjob_delete(global_event_context(), msg_ctx, sharename, jobid);
                return NT_STATUS_OK;
        }
 
@@ -3052,7 +3052,7 @@ NTSTATUS print_job_end(struct messaging_context *msg_ctx, int snum,
 
        pjob->spooled = True;
        pjob->status = LPQ_QUEUED;
-       pjob_store(server_event_context(), msg_ctx, sharename, jobid, pjob);
+       pjob_store(global_event_context(), msg_ctx, sharename, jobid, pjob);
 
        /* make sure the database is up to date */
        if (print_cache_expired(lp_const_servicename(snum), True))
@@ -3066,7 +3066,7 @@ fail:
        /* Still need to add proper error return propagation! 010122:JRR */
        pjob->fd = -1;
        unlink(pjob->filename);
-       pjob_delete(server_event_context(), msg_ctx, sharename, jobid);
+       pjob_delete(global_event_context(), msg_ctx, sharename, jobid);
 err_out:
        talloc_free(tmp_ctx);
        return status;
@@ -3344,7 +3344,7 @@ WERROR print_queue_pause(const struct auth_session_info *server_info,
 
        /* Send a printer notify message */
 
-       notify_printer_status(server_event_context(), msg_ctx, snum,
+       notify_printer_status(global_event_context(), msg_ctx, snum,
                              PRINTER_STATUS_PAUSED);
 
        return WERR_OK;
@@ -3381,7 +3381,7 @@ WERROR print_queue_resume(const struct auth_session_info *server_info,
 
        /* Send a printer notify message */
 
-       notify_printer_status(server_event_context(), msg_ctx, snum,
+       notify_printer_status(global_event_context(), msg_ctx, snum,
                              PRINTER_STATUS_OK);
 
        return WERR_OK;
@@ -3431,7 +3431,7 @@ WERROR print_queue_purge(const struct auth_session_info *server_info,
                                 jobid);
 
                if (owner || can_job_admin) {
-                       print_job_delete1(server_event_context(), msg_ctx,
+                       print_job_delete1(global_event_context(), msg_ctx,
                                          snum, jobid);
                }
        }
index c4648ce..1d60f25 100644 (file)
@@ -211,8 +211,8 @@ static void bq_setup_sig_term_handler(void)
 {
        struct tevent_signal *se;
 
-       se = tevent_add_signal(server_event_context(),
-                              server_event_context(),
+       se = tevent_add_signal(global_event_context(),
+                              global_event_context(),
                               SIGTERM, 0,
                               bq_sig_term_handler,
                               NULL);
index ab7f905..03c2668 100644 (file)
@@ -527,7 +527,7 @@ static void fss_seq_tout_set(TALLOC_CTX *mem_ctx,
                memcpy(sc_set_id, &sc_set->id, sizeof(*sc_set_id));
        }
 
-       tmr = tevent_add_timer(server_event_context(),
+       tmr = tevent_add_timer(global_event_context(),
                              mem_ctx,
                              timeval_current_ofs(tout, 0),
                              fss_seq_tout_handler, sc_set_id);
@@ -948,7 +948,7 @@ uint32_t _fss_CommitShadowCopySet(struct pipes_struct *p,
        for (sc = sc_set->scs; sc; sc = sc->next) {
                char *base_path;
                char *snap_path;
-               status = commit_sc_with_conn(frame, server_event_context(),
+               status = commit_sc_with_conn(frame, global_event_context(),
                                             p->msg_ctx, p->session_info, sc,
                                             &base_path, &snap_path);
                if (!NT_STATUS_IS_OK(status)) {
index 5a63d37..7c99694 100644 (file)
@@ -772,7 +772,7 @@ static void tracker_cursor_cb(GObject *object,
                SLQ_DEBUG(10, slq, "closed");
                g_main_loop_quit(slq->mds_ctx->gmainloop);
 
-               req = slq_destroy_send(slq, server_event_context(), &slq);
+               req = slq_destroy_send(slq, global_event_context(), &slq);
                if (req == NULL) {
                        slq->state = SLQ_STATE_ERROR;
                        return;
@@ -1166,7 +1166,7 @@ static bool slrpc_open_query(struct mds_ctx *mds_ctx,
        slq->last_used = timeval_current();
        slq->start_time = slq->last_used;
        slq->expire_time = timeval_add(&slq->last_used, MAX_SL_RUNTIME, 0);
-       slq->te = tevent_add_timer(server_event_context(), slq,
+       slq->te = tevent_add_timer(global_event_context(), slq,
                                   slq->expire_time, slq_close_timer, slq);
        if (slq->te == NULL) {
                DEBUG(1, ("tevent_add_timer failed\n"));
@@ -1361,7 +1361,7 @@ static bool slrpc_fetch_query_results(struct mds_ctx *mds_ctx,
        TALLOC_FREE(slq->te);
        slq->last_used = timeval_current();
        slq->expire_time = timeval_add(&slq->last_used, MAX_SL_RUNTIME, 0);
-       slq->te = tevent_add_timer(server_event_context(), slq,
+       slq->te = tevent_add_timer(global_event_context(), slq,
                                   slq->expire_time, slq_close_timer, slq);
        if (slq->te == NULL) {
                DEBUG(1, ("tevent_add_timer failed\n"));
index adc9e41..00497ef 100644 (file)
@@ -308,7 +308,7 @@ static void set_disp_info_cache_timeout(DISP_INFO *disp_info, time_t secs_fromno
                  (unsigned int)secs_fromnow ));
 
        disp_info->cache_timeout_event = tevent_add_timer(
-               server_event_context(), NULL,
+               global_event_context(), NULL,
                timeval_current_ofs(secs_fromnow, 0),
                disp_info_cache_idle_timeout_handler, (void *)disp_info);
 }
index 2bdce56..ac76e7e 100644 (file)
@@ -6043,7 +6043,7 @@ WERROR _spoolss_WritePrinter(struct pipes_struct *p,
                return WERR_INVALID_HANDLE;
 
        /* print_job_write takes care of checking for PJOB_SMBD_SPOOLING */
-       buffer_written = print_job_write(server_event_context(),p->msg_ctx,
+       buffer_written = print_job_write(global_event_context(),p->msg_ctx,
                                                   snum, Printer->jobid,
                                                   (const char *)r->in.data.data,
                                                   (size_t)r->in._data_size);
@@ -6544,7 +6544,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx,
                        DEBUG(10,("update_printer: changing driver [%s]!  Sending event!\n",
                                printer->drivername));
 
-                       notify_printer_driver(server_event_context(), msg_ctx,
+                       notify_printer_driver(global_event_context(), msg_ctx,
                                              snum, printer->drivername ?
                                              printer->drivername : "");
                }
@@ -6572,7 +6572,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx,
                }
 
                if (!force_update) {
-                       notify_printer_comment(server_event_context(), msg_ctx,
+                       notify_printer_comment(global_event_context(), msg_ctx,
                                               snum, printer->comment ?
                                               printer->comment : "");
                }
@@ -6600,7 +6600,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx,
                }
 
                if (!force_update) {
-                       notify_printer_sharename(server_event_context(),
+                       notify_printer_sharename(global_event_context(),
                                                 msg_ctx,
                                                 snum, printer->sharename ?
                                                 printer->sharename : "");
@@ -6641,7 +6641,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx,
                }
 
                if (!force_update) {
-                       notify_printer_printername(server_event_context(),
+                       notify_printer_printername(global_event_context(),
                                                   msg_ctx, snum, p ? p : "");
                }
 
@@ -6671,7 +6671,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx,
                }
 
                if (!force_update) {
-                       notify_printer_port(server_event_context(),
+                       notify_printer_port(global_event_context(),
                                            msg_ctx, snum, printer->portname ?
                                            printer->portname : "");
                }
@@ -6699,7 +6699,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx,
                }
 
                if (!force_update) {
-                       notify_printer_location(server_event_context(),
+                       notify_printer_location(global_event_context(),
                                                msg_ctx, snum,
                                                printer->location ?
                                                printer->location : "");
@@ -6728,7 +6728,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx,
                }
 
                if (!force_update) {
-                       notify_printer_sepfile(server_event_context(),
+                       notify_printer_sepfile(global_event_context(),
                                               msg_ctx, snum,
                                               printer->sepfile ?
                                               printer->sepfile : "");
@@ -7718,7 +7718,7 @@ static WERROR spoolss_setjob_1(TALLOC_CTX *mem_ctx,
                return WERR_OK;
        }
 
-       if (!print_job_set_name(server_event_context(), msg_ctx,
+       if (!print_job_set_name(global_event_context(), msg_ctx,
                                printer_name, job_id, r->document_name)) {
                return WERR_INVALID_HANDLE;
        }
index b73ac2b..a9201f8 100644 (file)
@@ -1776,7 +1776,7 @@ extern void build_options(bool screen);
         * initialized before the messaging context, cause the messaging
         * context holds an event context.
         */
-       ev_ctx = server_event_context();
+       ev_ctx = global_event_context();
        if (ev_ctx == NULL) {
                exit(1);
        }
index cc8ea18..4bf3ea8 100644 (file)
@@ -218,7 +218,7 @@ static void exit_server_common(enum server_exit_reason how,
        TALLOC_FREE(global_smbXsrv_client);
        smbprofile_dump();
        server_messaging_context_free();
-       server_event_context_free();
+       global_event_context_free();
        TALLOC_FREE(smbd_memcache_ctx);
 
        locking_end();
index 2e5305d..9245e5d 100644 (file)
@@ -78,9 +78,9 @@ bool run_dbwrap_do_locked1(int dummy)
        int ret = false;
        NTSTATUS status;
 
-       ev = server_event_context();
+       ev = global_event_context();
        if (ev == NULL) {
-               fprintf(stderr, "server_event_context() failed\n");
+               fprintf(stderr, "global_event_context() failed\n");
                return false;
        }
        msg = server_messaging_context();
index 624f7cd..29046d6 100644 (file)
@@ -31,7 +31,7 @@ static bool get_g_lock_ctx(TALLOC_CTX *mem_ctx,
                           struct messaging_context **msg,
                           struct g_lock_ctx **ctx)
 {
-       *ev = server_event_context();
+       *ev = global_event_context();
        if (*ev == NULL) {
                fprintf(stderr, "tevent_context_init failed\n");
                return false;
index d768849..e23e128 100644 (file)
@@ -1618,7 +1618,7 @@ int main(int argc, const char **argv)
                exit(1);
        }
 
-       evt_ctx = server_event_context();
+       evt_ctx = global_event_context();
 
        lp_load_global(get_dyn_CONFIGFILE());
 
index 6765dfc..9b2b7c1 100644 (file)
@@ -455,7 +455,7 @@ static NTSTATUS idmap_ldap_db_init(struct idmap_domain *dom)
 
        /* get_credentials deals with setting up creds */
 
-       ret = smbldap_init(ctx, server_event_context(), ctx->url,
+       ret = smbldap_init(ctx, global_event_context(), ctx->url,
                           false, NULL, NULL, &ctx->smbldap_state);
        if (!NT_STATUS_IS_OK(ret)) {
                DEBUG(1, ("ERROR: smbldap_init (%s) failed!\n", ctx->url));
index 264ccb0..f30baf9 100644 (file)
@@ -193,7 +193,7 @@ static NTSTATUS idmap_rfc2307_init_ldap(struct idmap_rfc2307_context *ctx,
        }
 
        /* assume anonymous if we don't have a specified user */
-       ret = smbldap_init(mem_ctx, server_event_context(), url,
+       ret = smbldap_init(mem_ctx, global_event_context(), url,
                           (user_dn == NULL), user_dn, secret,
                           &ctx->smbldap_state);
        SAFE_FREE(secret);
index b63db38..4781506 100644 (file)
@@ -87,7 +87,7 @@ struct imessaging_context *winbind_imessaging_context(void)
         * Note we MUST use the NULL context here, not the autofree context,
         * to avoid side effects in forked children exiting.
         */
-       msg = imessaging_init(NULL, lp_ctx, myself, server_event_context());
+       msg = imessaging_init(NULL, lp_ctx, myself, global_event_context());
        talloc_unlink(NULL, lp_ctx);
 
        if (msg == NULL) {
@@ -270,14 +270,14 @@ bool winbindd_setup_sig_term_handler(bool parent)
        struct tevent_signal *se;
        bool *is_parent;
 
-       is_parent = talloc(server_event_context(), bool);
+       is_parent = talloc(global_event_context(), bool);
        if (!is_parent) {
                return false;
        }
 
        *is_parent = parent;
 
-       se = tevent_add_signal(server_event_context(),
+       se = tevent_add_signal(global_event_context(),
                               is_parent,
                               SIGTERM, 0,
                               winbindd_sig_term_handler,
@@ -288,7 +288,7 @@ bool winbindd_setup_sig_term_handler(bool parent)
                return false;
        }
 
-       se = tevent_add_signal(server_event_context(),
+       se = tevent_add_signal(global_event_context(),
                               is_parent,
                               SIGINT, 0,
                               winbindd_sig_term_handler,
@@ -299,7 +299,7 @@ bool winbindd_setup_sig_term_handler(bool parent)
                return false;
        }
 
-       se = tevent_add_signal(server_event_context(),
+       se = tevent_add_signal(global_event_context(),
                               is_parent,
                               SIGQUIT, 0,
                               winbindd_sig_term_handler,
@@ -320,7 +320,7 @@ bool winbindd_setup_stdin_handler(bool parent, bool foreground)
        if (foreground) {
                struct stat st;
 
-               is_parent = talloc(server_event_context(), bool);
+               is_parent = talloc(global_event_context(), bool);
                if (!is_parent) {
                        return false;
                }
@@ -336,7 +336,7 @@ bool winbindd_setup_stdin_handler(bool parent, bool foreground)
                        return false;
                }
                if (S_ISFIFO(st.st_mode) || S_ISSOCK(st.st_mode)) {
-                       tevent_add_fd(server_event_context(),
+                       tevent_add_fd(global_event_context(),
                                        is_parent,
                                        0,
                                        TEVENT_FD_READ,
@@ -368,15 +368,15 @@ bool winbindd_setup_sig_hup_handler(const char *lfile)
        char *file = NULL;
 
        if (lfile) {
-               file = talloc_strdup(server_event_context(),
+               file = talloc_strdup(global_event_context(),
                                     lfile);
                if (!file) {
                        return false;
                }
        }
 
-       se = tevent_add_signal(server_event_context(),
-                              server_event_context(),
+       se = tevent_add_signal(global_event_context(),
+                              global_event_context(),
                               SIGHUP, 0,
                               winbindd_sig_hup_handler,
                               file);
@@ -405,8 +405,8 @@ static bool winbindd_setup_sig_chld_handler(void)
 {
        struct tevent_signal *se;
 
-       se = tevent_add_signal(server_event_context(),
-                              server_event_context(),
+       se = tevent_add_signal(global_event_context(),
+                              global_event_context(),
                               SIGCHLD, 0,
                               winbindd_sig_chld_handler,
                               NULL);
@@ -431,8 +431,8 @@ static bool winbindd_setup_sig_usr2_handler(void)
 {
        struct tevent_signal *se;
 
-       se = tevent_add_signal(server_event_context(),
-                              server_event_context(),
+       se = tevent_add_signal(global_event_context(),
+                              global_event_context(),
                               SIGUSR2, 0,
                               winbindd_sig_usr2_handler,
                               NULL);
@@ -929,7 +929,7 @@ static void new_connection(int listen_sock, bool privileged)
 
        state->privileged = privileged;
 
-       req = wb_req_read_send(state, server_event_context(), state->sock,
+       req = wb_req_read_send(state, global_event_context(), state->sock,
                               WINBINDD_MAX_EXTRA_DATA);
        if (req == NULL) {
                TALLOC_FREE(state);
@@ -969,7 +969,7 @@ static void winbind_client_request_read(struct tevent_req *req)
                return;
        }
 
-       req = wait_for_read_send(state, server_event_context(), state->sock,
+       req = wait_for_read_send(state, global_event_context(), state->sock,
                                 true);
        if (req == NULL) {
                DEBUG(0, ("winbind_client_request_read[%d:%s]:"
@@ -981,7 +981,7 @@ static void winbind_client_request_read(struct tevent_req *req)
        tevent_req_set_callback(req, winbind_client_activity, state);
        state->io_req = req;
 
-       req = process_request_send(state, server_event_context(), state);
+       req = process_request_send(state, global_event_context(), state);
        if (req == NULL) {
                DBG_ERR("process_request_send failed\n");
                remove_client(state);
@@ -1069,7 +1069,7 @@ static void winbind_client_processed(struct tevent_req *req)
 
        req = wb_req_read_send(
                cli_state,
-               server_event_context(),
+               global_event_context(),
                cli_state->sock,
                WINBINDD_MAX_EXTRA_DATA);
        if (req == NULL) {
@@ -1296,7 +1296,7 @@ static bool winbindd_setup_listeners(void)
        int rc;
        char *socket_path;
 
-       pub_state = talloc(server_event_context(),
+       pub_state = talloc(global_event_context(),
                           struct winbindd_listen_state);
        if (!pub_state) {
                goto failed;
@@ -1313,7 +1313,7 @@ static bool winbindd_setup_listeners(void)
                goto failed;
        }
 
-       fde = tevent_add_fd(server_event_context(), pub_state, pub_state->fd,
+       fde = tevent_add_fd(global_event_context(), pub_state, pub_state->fd,
                            TEVENT_FD_READ, winbindd_listen_fde_handler,
                            pub_state);
        if (fde == NULL) {
@@ -1322,7 +1322,7 @@ static bool winbindd_setup_listeners(void)
        }
        tevent_fd_set_auto_close(fde);
 
-       priv_state = talloc(server_event_context(),
+       priv_state = talloc(global_event_context(),
                            struct winbindd_listen_state);
        if (!priv_state) {
                goto failed;
@@ -1345,7 +1345,7 @@ static bool winbindd_setup_listeners(void)
                goto failed;
        }
 
-       fde = tevent_add_fd(server_event_context(), priv_state,
+       fde = tevent_add_fd(global_event_context(), priv_state,
                            priv_state->fd, TEVENT_FD_READ,
                            winbindd_listen_fde_handler, priv_state);
        if (fde == NULL) {
@@ -1354,7 +1354,7 @@ static bool winbindd_setup_listeners(void)
        }
        tevent_fd_set_auto_close(fde);
 
-       winbindd_scrub_clients_handler(server_event_context(), NULL,
+       winbindd_scrub_clients_handler(global_event_context(), NULL,
                                       timeval_current(), NULL);
        return true;
 failed:
@@ -1473,7 +1473,7 @@ static void winbindd_register_handlers(struct messaging_context *msg_ctx,
        }
 
        if (scan_trusts) {
-               if (tevent_add_timer(server_event_context(), NULL, timeval_zero(),
+               if (tevent_add_timer(global_event_context(), NULL, timeval_zero(),
                              rescan_trusted_domains, NULL) == NULL) {
                        DEBUG(0, ("Could not trigger rescan_trusted_domains()\n"));
                        exit(1);
@@ -1840,12 +1840,12 @@ int main(int argc, const char **argv)
         */
 
        status = reinit_after_fork(server_messaging_context(),
-                                  server_event_context(),
+                                  global_event_context(),
                                   false, NULL);
        if (!NT_STATUS_IS_OK(status)) {
                exit_daemon("Winbindd reinit_after_fork() failed", map_errno_from_nt_status(status));
        }
-       initialize_password_db(true, server_event_context());
+       initialize_password_db(true, global_event_context());
 
        /*
         * Do not initialize the parent-child-pipe before becoming
@@ -1871,7 +1871,7 @@ int main(int argc, const char **argv)
        rpc_lsarpc_init(NULL);
        rpc_samr_init(NULL);
 
-       winbindd_init_addrchange(NULL, server_event_context(),
+       winbindd_init_addrchange(NULL, global_event_context(),
                                 server_messaging_context());
 
        /* setup listen sockets */
@@ -1894,7 +1894,7 @@ int main(int argc, const char **argv)
        while (1) {
                frame = talloc_stackframe();
 
-               if (tevent_loop_once(server_event_context()) == -1) {
+               if (tevent_loop_once(global_event_context()) == -1) {
                        DEBUG(1, ("tevent_loop_once() failed: %s\n",
                                  strerror(errno)));
                        return 1;
index 9561203..88ef366 100644 (file)
@@ -434,7 +434,7 @@ void set_domain_offline(struct winbindd_domain *domain)
 
        calc_new_online_timeout_check(domain);
 
-       domain->check_online_event = tevent_add_timer(server_event_context(),
+       domain->check_online_event = tevent_add_timer(global_event_context(),
                                                NULL,
                                                timeval_current_ofs(domain->check_online_timeout,0),
                                                check_domain_online_handler,
@@ -610,7 +610,7 @@ void set_domain_online_request(struct winbindd_domain *domain)
 
        TALLOC_FREE(domain->check_online_event);
 
-       domain->check_online_event = tevent_add_timer(server_event_context(),
+       domain->check_online_event = tevent_add_timer(global_event_context(),
                                                     NULL,
                                                     tev,
                                                     check_domain_online_handler,
index 5e019df..c733229 100644 (file)
@@ -284,7 +284,7 @@ done:
        if (entry->refresh_time == 0) {
                entry->refresh_time = new_start;
        }
-       entry->event = tevent_add_timer(server_event_context(), entry,
+       entry->event = tevent_add_timer(global_event_context(), entry,
                                       timeval_set(new_start, 0),
                                       krb5_ticket_refresh_handler,
                                       entry);
@@ -383,7 +383,7 @@ static void krb5_ticket_gain_handler(struct tevent_context *event_ctx,
        if (entry->refresh_time == 0) {
                entry->refresh_time = t.tv_sec;
        }
-       entry->event = tevent_add_timer(server_event_context(),
+       entry->event = tevent_add_timer(global_event_context(),
                                       entry,
                                       t,
                                       krb5_ticket_refresh_handler,
@@ -402,7 +402,7 @@ static void add_krb5_ticket_gain_handler_event(struct WINBINDD_CCACHE_ENTRY *ent
                                     struct timeval t)
 {
        entry->refresh_time = 0;
-       entry->event = tevent_add_timer(server_event_context(),
+       entry->event = tevent_add_timer(global_event_context(),
                                       entry,
                                       t,
                                       krb5_ticket_gain_handler,
@@ -422,13 +422,13 @@ void ccache_regain_all_now(void)
                 * the event has the krb5_ticket_gain_handler
                 */
                if (cur->refresh_time == 0) {
-                       new_event = tevent_add_timer(server_event_context(),
+                       new_event = tevent_add_timer(global_event_context(),
                                                    cur,
                                                    t,
                                                    krb5_ticket_gain_handler,
                                                    cur);
                } else {
-                       new_event = tevent_add_timer(server_event_context(),
+                       new_event = tevent_add_timer(global_event_context(),
                                                    cur,
                                                    t,
                                                    krb5_ticket_refresh_handler,
@@ -545,7 +545,7 @@ NTSTATUS add_ccache_to_list(const char *princ_name,
                                if (!entry->refresh_time) {
                                        entry->refresh_time = t.tv_sec;
                                }
-                               entry->event = tevent_add_timer(server_event_context(),
+                               entry->event = tevent_add_timer(global_event_context(),
                                                               entry,
                                                               t,
                                                               krb5_ticket_refresh_handler,
@@ -643,7 +643,7 @@ NTSTATUS add_ccache_to_list(const char *princ_name,
                if (entry->refresh_time == 0) {
                        entry->refresh_time = t.tv_sec;
                }
-               entry->event = tevent_add_timer(server_event_context(),
+               entry->event = tevent_add_timer(global_event_context(),
                                               entry,
                                               t,
                                               krb5_ticket_refresh_handler,
index 126691a..7a5d9eb 100644 (file)
@@ -66,7 +66,7 @@ struct tevent_req *winbindd_domain_info_send(
         * Send a ping down. This implicitly initializes the domain.
         */
 
-       subreq = wb_domain_request_send(state, server_event_context(),
+       subreq = wb_domain_request_send(state, global_event_context(),
                                        state->domain, &state->ping_request);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
index cff2c97..e641b52 100644 (file)
@@ -242,7 +242,7 @@ static void wb_child_request_waited(struct tevent_req *subreq)
 
        tevent_fd_set_flags(state->child->monitor_fde, 0);
 
-       subreq = wb_simple_trans_send(state, server_event_context(), NULL,
+       subreq = wb_simple_trans_send(state, global_event_context(), NULL,
                                      state->child->sock, state->request);
        if (tevent_req_nomem(subreq, req)) {
                return;
@@ -1188,7 +1188,7 @@ static void account_lockout_policy_handler(struct tevent_context *ctx,
                         nt_errstr(result)));
        }
 
-       child->lockout_policy_event = tevent_add_timer(server_event_context(), NULL,
+       child->lockout_policy_event = tevent_add_timer(global_event_context(), NULL,
                                                      timeval_current_ofs(3600, 0),
                                                      account_lockout_policy_handler,
                                                      child);
@@ -1353,7 +1353,7 @@ static void machine_password_change_handler(struct tevent_context *ctx,
        }
 
 done:
-       child->machine_password_change_event = tevent_add_timer(server_event_context(), NULL,
+       child->machine_password_change_event = tevent_add_timer(global_event_context(), NULL,
                                                              next_change,
                                                              machine_password_change_handler,
                                                              child);
@@ -1498,13 +1498,13 @@ NTSTATUS winbindd_reinit_after_fork(const struct winbindd_child *myself,
 
        status = reinit_after_fork(
                server_messaging_context(),
-               server_event_context(),
+               global_event_context(),
                true, NULL);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("reinit_after_fork() failed\n"));
                return status;
        }
-       initialize_password_db(true, server_event_context());
+       initialize_password_db(true, global_event_context());
 
        close_conns_after_fork();
 
@@ -1672,8 +1672,8 @@ static bool fork_domain_child(struct winbindd_child *child)
                        return false;
                }
 
-               child->monitor_fde = tevent_add_fd(server_event_context(),
-                                                  server_event_context(),
+               child->monitor_fde = tevent_add_fd(global_event_context(),
+                                                  global_event_context(),
                                                   fdpair[1],
                                                   TEVENT_FD_READ,
                                                   child_socket_readable,
@@ -1782,7 +1782,7 @@ static bool fork_domain_child(struct winbindd_child *child)
                }
 
                child->lockout_policy_event = tevent_add_timer(
-                       server_event_context(), NULL, timeval_zero(),
+                       global_event_context(), NULL, timeval_zero(),
                        account_lockout_policy_handler,
                        child);
        }
@@ -1796,13 +1796,13 @@ static bool fork_domain_child(struct winbindd_child *child)
                if (calculate_next_machine_pwd_change(child->domain->name,
                                                       &next_change)) {
                        child->machine_password_change_event = tevent_add_timer(
-                               server_event_context(), NULL, next_change,
+                               global_event_context(), NULL, next_change,
                                machine_password_change_handler,
                                child);
                }
        }
 
-       fde = tevent_add_fd(server_event_context(), NULL, state.cli.sock,
+       fde = tevent_add_fd(global_event_context(), NULL, state.cli.sock,
                            TEVENT_FD_READ, child_handler, &state);
        if (fde == NULL) {
                DEBUG(1, ("tevent_add_fd failed\n"));
@@ -1814,7 +1814,7 @@ static bool fork_domain_child(struct winbindd_child *child)
                int ret;
                TALLOC_CTX *frame = talloc_stackframe();
 
-               ret = tevent_loop_once(server_event_context());
+               ret = tevent_loop_once(global_event_context());
                if (ret != 0) {
                        DEBUG(1, ("tevent_loop_once failed: %s\n",
                                  strerror(errno)));
index 75772ea..293ca37 100644 (file)
@@ -83,7 +83,7 @@ void gpupdate_init(void)
 {
        struct tevent_timer *time_event;
        struct timeval schedule;
-       TALLOC_CTX * ctx = talloc_new(server_event_context());
+       TALLOC_CTX * ctx = talloc_new(global_event_context());
        struct gpupdate_state *data = talloc(ctx, struct gpupdate_state);
        struct loadparm_context *lp_ctx =
                loadparm_init_s3(NULL, loadparm_s3_helpers());
@@ -107,7 +107,7 @@ void gpupdate_init(void)
        if (data->lp_ctx == NULL) {
                smb_panic("Could not load smb.conf\n");
        }
-       time_event = tevent_add_timer(server_event_context(), data->ctx,
+       time_event = tevent_add_timer(global_event_context(), data->ctx,
                                      schedule, gpupdate_callback, data);
        if (time_event == NULL) {
                DEBUG(0, ("Failed scheduling the gpupdate event\n"));
index 1e34fdf..2ac4f9b 100644 (file)
@@ -129,7 +129,7 @@ static NTSTATUS wb_irpc_DsrUpdateReadOnlyServerDnsRecords(struct irpc_message *m
        DEBUG(5, ("wb_irpc_DsrUpdateReadOnlyServerDnsRecords called\n"));
 
        return wb_irpc_forward_rpc_call(msg, msg,
-                                       server_event_context(),
+                                       global_event_context(),
                                        req, NDR_WINBIND_DSRUPDATEREADONLYSERVERDNSRECORDS,
                                        "winbind_DsrUpdateReadOnlyServerDnsRecords",
                                        domain, IRPC_CALL_TIMEOUT);
@@ -212,7 +212,7 @@ static NTSTATUS wb_irpc_SamLogon(struct irpc_message *msg,
        DEBUG(5, ("wb_irpc_SamLogon called\n"));
 
        return wb_irpc_forward_rpc_call(msg, msg,
-                                       server_event_context(),
+                                       global_event_context(),
                                        req, NDR_WINBIND_SAMLOGON,
                                        "winbind_SamLogon",
                                        domain, IRPC_CALL_TIMEOUT);
@@ -272,7 +272,7 @@ static NTSTATUS wb_irpc_LogonControl(struct irpc_message *msg,
 
        TALLOC_FREE(frame);
        return wb_irpc_forward_rpc_call(msg, msg,
-                                       server_event_context(),
+                                       global_event_context(),
                                        req, NDR_WINBIND_LOGONCONTROL,
                                        "winbind_LogonControl",
                                        domain, 45 /* timeout */);
@@ -312,7 +312,7 @@ static NTSTATUS wb_irpc_GetForestTrustInformation(struct irpc_message *msg,
        DEBUG(5, ("wb_irpc_GetForestTrustInformation called\n"));
 
        return wb_irpc_forward_rpc_call(msg, msg,
-                                       server_event_context(),
+                                       global_event_context(),
                                        req, NDR_WINBIND_GETFORESTTRUSTINFORMATION,
                                        "winbind_GetForestTrustInformation",
                                        domain, 45 /* timeout */);
@@ -330,7 +330,7 @@ static NTSTATUS wb_irpc_SendToSam(struct irpc_message *msg,
        DEBUG(5, ("wb_irpc_SendToSam called\n"));
 
        return wb_irpc_forward_rpc_call(msg, msg,
-                                       server_event_context(),
+                                       global_event_context(),
                                        req, NDR_WINBIND_SENDTOSAM,
                                        "winbind_SendToSam",
                                        domain, IRPC_CALL_TIMEOUT);
@@ -396,7 +396,7 @@ static NTSTATUS wb_irpc_lsa_LookupSids3_call(struct irpc_message *msg,
        }
 
        subreq = wb_lookupsids_send(msg,
-                                   server_event_context(),
+                                   global_event_context(),
                                    sids, req->in.sids->num_sids);
        if (subreq == NULL) {
                return NT_STATUS_NO_MEMORY;
@@ -573,7 +573,7 @@ static NTSTATUS wb_irpc_lsa_LookupNames4_call(struct irpc_message *msg,
                }
 
                subreq = wb_lookupname_send(msg,
-                                           server_event_context(),
+                                           global_event_context(),
                                            nstate->namespace,
                                            nstate->domain,
                                            nstate->name,
@@ -647,7 +647,7 @@ static void wb_irpc_lsa_LookupNames4_done(struct tevent_req *subreq)
         * to get a good lsa_RefDomainList
         */
        subreq = wb_lookupsids_send(state,
-                                   server_event_context(),
+                                   global_event_context(),
                                    state->domain_sids,
                                    state->num_domain_sids);
        if (subreq == NULL) {
@@ -754,7 +754,7 @@ static NTSTATUS wb_irpc_GetDCName(struct irpc_message *msg,
        state->req = req;
 
        subreq = wb_dsgetdcname_send(msg,
-                                    server_event_context(),
+                                    global_event_context(),
                                     req->in.domain_name,
                                     req->in.domain_guid,
                                     req->in.site_name,
index 95550ba..f91879e 100644 (file)
@@ -87,7 +87,7 @@ struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       subreq = wb_domain_request_send(state, server_event_context(), domain,
+       subreq = wb_domain_request_send(state, global_event_context(), domain,
                                        request);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
index 046517d..b7912db 100644 (file)
@@ -132,7 +132,7 @@ struct tevent_req *winbindd_pam_auth_crap_send(
                fstrcpy(request->data.auth_crap.workstation, lp_netbios_name());
        }
 
-       subreq = wb_domain_request_send(state, server_event_context(), domain,
+       subreq = wb_domain_request_send(state, global_event_context(), domain,
                                        request);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
index a6b8b66..c802649 100644 (file)
@@ -83,7 +83,7 @@ struct tevent_req *winbindd_pam_chauthtok_send(
                return tevent_req_post(req, ev);
        }
 
-       subreq = wb_domain_request_send(state, server_event_context(),
+       subreq = wb_domain_request_send(state, global_event_context(),
                                        contact_domain, request);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
index e9ee0ab..38d84be 100644 (file)
@@ -73,7 +73,7 @@ struct tevent_req *winbindd_pam_chng_pswd_auth_crap_send(
                return tevent_req_post(req, ev);
        }
 
-       subreq = wb_domain_request_send(state, server_event_context(),
+       subreq = wb_domain_request_send(state, global_event_context(),
                                        domain, request);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
index 8f2b488..30f69e1 100644 (file)
@@ -98,7 +98,7 @@ struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx,
                break;
        }
 
-       subreq = wb_domain_request_send(state, server_event_context(), domain,
+       subreq = wb_domain_request_send(state, global_event_context(), domain,
                                        request);
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
index f913d39..9bc25d9 100644 (file)
@@ -409,7 +409,7 @@ static void add_trusted_domains( struct winbindd_domain *domain )
        state->request.length = sizeof(state->request);
        state->request.cmd = WINBINDD_LIST_TRUSTDOM;
 
-       req = wb_domain_request_send(state, server_event_context(),
+       req = wb_domain_request_send(state, global_event_context(),
                                     domain, &state->request);
        if (req == NULL) {
                DEBUG(1, ("wb_domain_request_send failed\n"));