mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
Use a custom init function for samba4 that sets a samba4
specific debug function.
By default do not debug, this is the most appropriate action for a library
as we cannot assume what stderr is use for in the main app.
The main app is responsible to set ev_debug_stderr if they so desire.
(This used to be commit e566a2f308
)
This commit is contained in:
@ -581,7 +581,7 @@ int main(int argc, const char ** argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ev = event_context_init(talloc_autofree_context());
|
ev = s4_event_context_init(talloc_autofree_context());
|
||||||
|
|
||||||
gensec_init(cmdline_lp_ctx);
|
gensec_init(cmdline_lp_ctx);
|
||||||
dump_args();
|
dump_args();
|
||||||
|
@ -3228,7 +3228,7 @@ static int do_message_op(const char *netbios_name, const char *desthost,
|
|||||||
|
|
||||||
lp_smbcli_options(cmdline_lp_ctx, &smb_options);
|
lp_smbcli_options(cmdline_lp_ctx, &smb_options);
|
||||||
|
|
||||||
ev_ctx = event_context_init(talloc_autofree_context());
|
ev_ctx = s4_event_context_init(talloc_autofree_context());
|
||||||
|
|
||||||
DEBUG( 3, ( "Client started (version %s).\n", SAMBA_VERSION_STRING ) );
|
DEBUG( 3, ( "Client started (version %s).\n", SAMBA_VERSION_STRING ) );
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ int main(int argc, char *argv[])
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
ev = event_context_init(NULL);
|
ev = s4_event_context_init(NULL);
|
||||||
assert(ev);
|
assert(ev);
|
||||||
|
|
||||||
tcx->ibwctx = ibw_init(tcx->attrs, tcx->nattrs,
|
tcx->ibwctx = ibw_init(tcx->attrs, tcx->nattrs,
|
||||||
|
@ -650,7 +650,7 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork)
|
|||||||
domain_socket_name = talloc_strdup(talloc_autofree_context(), ctdb->daemon.name);
|
domain_socket_name = talloc_strdup(talloc_autofree_context(), ctdb->daemon.name);
|
||||||
talloc_set_destructor(domain_socket_name, unlink_destructor);
|
talloc_set_destructor(domain_socket_name, unlink_destructor);
|
||||||
|
|
||||||
ctdb->ev = event_context_init(NULL);
|
ctdb->ev = s4_event_context_init(NULL);
|
||||||
|
|
||||||
/* start frozen, then let the first election sort things out */
|
/* start frozen, then let the first election sort things out */
|
||||||
if (!ctdb_blocking_freeze(ctdb)) {
|
if (!ctdb_blocking_freeze(ctdb)) {
|
||||||
|
@ -1487,7 +1487,7 @@ int ctdb_start_recoverd(struct ctdb_context *ctdb)
|
|||||||
|
|
||||||
/* get a new event context */
|
/* get a new event context */
|
||||||
talloc_free(ctdb->ev);
|
talloc_free(ctdb->ev);
|
||||||
ctdb->ev = event_context_init(ctdb);
|
ctdb->ev = s4_event_context_init(ctdb);
|
||||||
|
|
||||||
event_add_fd(ctdb->ev, ctdb, fd[0], EVENT_FD_READ|EVENT_FD_AUTOCLOSE,
|
event_add_fd(ctdb->ev, ctdb, fd[0], EVENT_FD_READ|EVENT_FD_AUTOCLOSE,
|
||||||
ctdb_recoverd_parent, &fd[0]);
|
ctdb_recoverd_parent, &fd[0]);
|
||||||
|
@ -141,7 +141,7 @@ int main(int argc, const char *argv[])
|
|||||||
|
|
||||||
block_signal(SIGPIPE);
|
block_signal(SIGPIPE);
|
||||||
|
|
||||||
ev = event_context_init(NULL);
|
ev = s4_event_context_init(NULL);
|
||||||
|
|
||||||
ctdb = ctdb_cmdline_init(ev);
|
ctdb = ctdb_cmdline_init(ev);
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ int main(int argc, const char *argv[])
|
|||||||
while (extra_argv[extra_argc]) extra_argc++;
|
while (extra_argv[extra_argc]) extra_argc++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ev = event_context_init(NULL);
|
ev = s4_event_context_init(NULL);
|
||||||
|
|
||||||
/* initialise ctdb */
|
/* initialise ctdb */
|
||||||
ctdb = ctdb_cmdline_client(ev);
|
ctdb = ctdb_cmdline_client(ev);
|
||||||
|
@ -211,7 +211,7 @@ int main(int argc, const char *argv[])
|
|||||||
while (extra_argv[extra_argc]) extra_argc++;
|
while (extra_argv[extra_argc]) extra_argc++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ev = event_context_init(NULL);
|
ev = s4_event_context_init(NULL);
|
||||||
|
|
||||||
ctdb = ctdb_cmdline_client(ev);
|
ctdb = ctdb_cmdline_client(ev);
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ int main(int argc, const char *argv[])
|
|||||||
while (extra_argv[extra_argc]) extra_argc++;
|
while (extra_argv[extra_argc]) extra_argc++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ev = event_context_init(NULL);
|
ev = s4_event_context_init(NULL);
|
||||||
|
|
||||||
ctdb = ctdb_cmdline_client(ev);
|
ctdb = ctdb_cmdline_client(ev);
|
||||||
|
|
||||||
|
@ -977,7 +977,7 @@ int main(int argc, const char *argv[])
|
|||||||
|
|
||||||
control = extra_argv[0];
|
control = extra_argv[0];
|
||||||
|
|
||||||
ev = event_context_init(NULL);
|
ev = s4_event_context_init(NULL);
|
||||||
|
|
||||||
/* initialise ctdb */
|
/* initialise ctdb */
|
||||||
ctdb = ctdb_cmdline_client(ev);
|
ctdb = ctdb_cmdline_client(ev);
|
||||||
|
@ -121,7 +121,7 @@ int samdb_copy_template(struct ldb_context *ldb,
|
|||||||
/* FIXME: need to remove this wehn we finally pass the event
|
/* FIXME: need to remove this wehn we finally pass the event
|
||||||
* context around in ldb */
|
* context around in ldb */
|
||||||
if (event_ctx == NULL) {
|
if (event_ctx == NULL) {
|
||||||
event_ctx = event_context_init(templates_ldb);
|
event_ctx = s4_event_context_init(templates_ldb);
|
||||||
}
|
}
|
||||||
|
|
||||||
templates_ldb = ldb_wrap_connect(ldb, event_ctx, lp_ctx,
|
templates_ldb = ldb_wrap_connect(ldb, event_ctx, lp_ctx,
|
||||||
|
@ -43,7 +43,6 @@ typedef void (*event_aio_handler_t)(struct event_context *, struct aio_event *,
|
|||||||
int, void *);
|
int, void *);
|
||||||
|
|
||||||
#ifdef _SAMBA_BUILD_
|
#ifdef _SAMBA_BUILD_
|
||||||
struct event_context *s4_event_context_init_byname(TALLOC_CTX *mem_ctx, const char *name);
|
|
||||||
struct event_context *s4_event_context_init(TALLOC_CTX *mem_ctx);
|
struct event_context *s4_event_context_init(TALLOC_CTX *mem_ctx);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -43,9 +43,9 @@ int ev_set_debug(struct event_context *ev,
|
|||||||
/*
|
/*
|
||||||
debug function for ev_set_debug_stderr
|
debug function for ev_set_debug_stderr
|
||||||
*/
|
*/
|
||||||
static void ev_debug_stderr(void *context, enum ev_debug_level level,
|
void ev_debug_stderr(void *context, enum ev_debug_level level,
|
||||||
const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0);
|
const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0);
|
||||||
static void ev_debug_stderr(void *context, enum ev_debug_level level,
|
void ev_debug_stderr(void *context, enum ev_debug_level level,
|
||||||
const char *fmt, va_list ap)
|
const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
if (level <= EV_DEBUG_WARNING) {
|
if (level <= EV_DEBUG_WARNING) {
|
||||||
@ -63,13 +63,18 @@ int ev_set_debug_stderr(struct event_context *ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
log a message
|
* log a message
|
||||||
|
*
|
||||||
|
* The default debug action is to ignore debugging messages.
|
||||||
|
* This is the most appropriate action for a library.
|
||||||
|
* Applications using the library must decide where to
|
||||||
|
* redirect debugging messages
|
||||||
*/
|
*/
|
||||||
void ev_debug(struct event_context *ev, enum ev_debug_level level, const char *fmt, ...)
|
void ev_debug(struct event_context *ev, enum ev_debug_level level, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
if (ev->debug_ops.debug == NULL) {
|
if (ev->debug_ops.debug == NULL) {
|
||||||
ev_set_debug_stderr(ev);
|
return;
|
||||||
}
|
}
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
ev->debug_ops.debug(ev->debug_ops.context, level, fmt, ap);
|
ev->debug_ops.debug(ev->debug_ops.context, level, fmt, ap);
|
||||||
|
@ -55,3 +55,54 @@ NTSTATUS s4_events_aio_init(void)
|
|||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
this is used to catch debug messages from events
|
||||||
|
*/
|
||||||
|
static void ev_wrap_debug(void *context, enum ev_debug_level level,
|
||||||
|
const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0);
|
||||||
|
|
||||||
|
static void ev_wrap_debug(void *context, enum ev_debug_level level,
|
||||||
|
const char *fmt, va_list ap)
|
||||||
|
{
|
||||||
|
int samba_level = -1;
|
||||||
|
char *s = NULL;
|
||||||
|
switch (level) {
|
||||||
|
case EV_DEBUG_FATAL:
|
||||||
|
samba_level = 0;
|
||||||
|
break;
|
||||||
|
case EV_DEBUG_ERROR:
|
||||||
|
samba_level = 1;
|
||||||
|
break;
|
||||||
|
case EV_DEBUG_WARNING:
|
||||||
|
samba_level = 2;
|
||||||
|
break;
|
||||||
|
case EV_DEBUG_TRACE:
|
||||||
|
samba_level = 5;
|
||||||
|
break;
|
||||||
|
|
||||||
|
};
|
||||||
|
vasprintf(&s, fmt, ap);
|
||||||
|
if (!s) return;
|
||||||
|
DEBUG(samba_level, ("events: %s\n", s));
|
||||||
|
free(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
create a event_context structure. This must be the first events
|
||||||
|
call, and all subsequent calls pass this event_context as the first
|
||||||
|
element. Event handlers also receive this as their first argument.
|
||||||
|
|
||||||
|
This samba4 specific call sets the samba4 debug handler.
|
||||||
|
*/
|
||||||
|
struct event_context *s4_event_context_init(TALLOC_CTX *mem_ctx)
|
||||||
|
{
|
||||||
|
struct event_context *ev;
|
||||||
|
|
||||||
|
ev = event_context_init_byname(mem_ctx, NULL);
|
||||||
|
if (ev) {
|
||||||
|
ev_set_debug(ev, ev_wrap_debug, NULL);
|
||||||
|
}
|
||||||
|
return ev;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -758,12 +758,12 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
|
|||||||
module->private_data = ildb;
|
module->private_data = ildb;
|
||||||
ildb->module = module;
|
ildb->module = module;
|
||||||
|
|
||||||
event_ctx = ldb_get_opaque(ldb, "EventContext");
|
event_ctx = ldb_get_event_context(ldb);
|
||||||
|
|
||||||
/* FIXME: We must make the event context an explicit parameter, but we
|
/* FIXME: We must make the event context an explicit parameter, but we
|
||||||
* need to build the events library separately first. Hack a new event
|
* need to build the events library separately first. Hack a new event
|
||||||
* context so that CMD line utilities work until we have libevents for
|
* context so that CMD line utilities work until we have them all
|
||||||
* standalone builds ready */
|
* converted */
|
||||||
if (event_ctx == NULL) {
|
if (event_ctx == NULL) {
|
||||||
event_ctx = event_context_init(NULL);
|
event_ctx = event_context_init(NULL);
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ PyObject *py_messaging_connect(PyTypeObject *self, PyObject *args, PyObject *kwa
|
|||||||
|
|
||||||
ret->mem_ctx = talloc_new(NULL);
|
ret->mem_ctx = talloc_new(NULL);
|
||||||
|
|
||||||
ev = event_context_init(ret->mem_ctx);
|
ev = s4_event_context_init(ret->mem_ctx);
|
||||||
|
|
||||||
if (messaging_path == NULL) {
|
if (messaging_path == NULL) {
|
||||||
messaging_path = lp_messaging_path(ret, global_loadparm);
|
messaging_path = lp_messaging_path(ret, global_loadparm);
|
||||||
@ -330,7 +330,7 @@ PyObject *py_irpc_connect(PyTypeObject *self, PyObject *args, PyObject *kwargs)
|
|||||||
|
|
||||||
ret->server_name = server;
|
ret->server_name = server;
|
||||||
|
|
||||||
ev = event_context_init(ret->mem_ctx);
|
ev = s4_event_context_init(ret->mem_ctx);
|
||||||
|
|
||||||
if (messaging_path == NULL) {
|
if (messaging_path == NULL) {
|
||||||
messaging_path = lp_messaging_path(ret, global_loadparm);
|
messaging_path = lp_messaging_path(ret, global_loadparm);
|
||||||
|
@ -3486,7 +3486,7 @@ SWIGINTERN PyObject *_wrap_hive_key(PyObject *SWIGUNUSEDPARM(self), PyObject *ar
|
|||||||
|
|
||||||
arg3 = NULL;
|
arg3 = NULL;
|
||||||
arg4 = NULL;
|
arg4 = NULL;
|
||||||
arg5 = event_context_init(NULL);
|
arg5 = s4_event_context_init(NULL);
|
||||||
arg6 = loadparm_init(NULL);
|
arg6 = loadparm_init(NULL);
|
||||||
arg1 = NULL;
|
arg1 = NULL;
|
||||||
arg7 = &tmp7;
|
arg7 = &tmp7;
|
||||||
@ -3574,7 +3574,7 @@ SWIGINTERN PyObject *_wrap_open_ldb(PyObject *SWIGUNUSEDPARM(self), PyObject *ar
|
|||||||
|
|
||||||
arg3 = NULL;
|
arg3 = NULL;
|
||||||
arg4 = NULL;
|
arg4 = NULL;
|
||||||
arg5 = event_context_init(NULL);
|
arg5 = s4_event_context_init(NULL);
|
||||||
arg6 = loadparm_init(NULL);
|
arg6 = loadparm_init(NULL);
|
||||||
arg1 = NULL;
|
arg1 = NULL;
|
||||||
arg7 = &tmp7;
|
arg7 = &tmp7;
|
||||||
@ -3735,7 +3735,7 @@ SWIGINTERN PyObject *_wrap_open_samba(PyObject *SWIGUNUSEDPARM(self), PyObject *
|
|||||||
(char *) "ev_ctx",(char *) "lp_ctx",(char *) "session_info",(char *) "credentials", NULL
|
(char *) "ev_ctx",(char *) "lp_ctx",(char *) "session_info",(char *) "credentials", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
arg3 = event_context_init(NULL);
|
arg3 = s4_event_context_init(NULL);
|
||||||
arg4 = loadparm_init(NULL);
|
arg4 = loadparm_init(NULL);
|
||||||
arg5 = NULL;
|
arg5 = NULL;
|
||||||
arg6 = NULL;
|
arg6 = NULL;
|
||||||
|
@ -118,7 +118,7 @@ int main(int argc, const char **argv)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ev_ctx = event_context_init(NULL);
|
ev_ctx = s4_event_context_init(NULL);
|
||||||
|
|
||||||
h1 = open_backend(pc, ev_ctx, cmdline_lp_ctx, backend1, remote1);
|
h1 = open_backend(pc, ev_ctx, cmdline_lp_ctx, backend1, remote1);
|
||||||
if (h1 == NULL)
|
if (h1 == NULL)
|
||||||
|
@ -49,7 +49,7 @@ int main(int argc, char **argv)
|
|||||||
while((opt = poptGetNextOpt(pc)) != -1) {
|
while((opt = poptGetNextOpt(pc)) != -1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ev = event_context_init(NULL);
|
ev = s4_event_context_init(NULL);
|
||||||
|
|
||||||
if (remote) {
|
if (remote) {
|
||||||
h = reg_common_open_remote (remote, cmdline_lp_ctx, cmdline_credentials);
|
h = reg_common_open_remote (remote, cmdline_lp_ctx, cmdline_credentials);
|
||||||
|
@ -517,7 +517,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
ctx = talloc_zero(NULL, struct regshell_context);
|
ctx = talloc_zero(NULL, struct regshell_context);
|
||||||
|
|
||||||
ev_ctx = event_context_init(ctx);
|
ev_ctx = s4_event_context_init(ctx);
|
||||||
|
|
||||||
if (remote != NULL) {
|
if (remote != NULL) {
|
||||||
ctx->registry = reg_common_open_remote(remote, cmdline_lp_ctx,
|
ctx->registry = reg_common_open_remote(remote, cmdline_lp_ctx,
|
||||||
|
@ -129,7 +129,7 @@ int main(int argc, char **argv)
|
|||||||
while((opt = poptGetNextOpt(pc)) != -1) {
|
while((opt = poptGetNextOpt(pc)) != -1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ev_ctx = event_context_init(NULL);
|
ev_ctx = s4_event_context_init(NULL);
|
||||||
|
|
||||||
if (remote != NULL) {
|
if (remote != NULL) {
|
||||||
h = reg_common_open_remote(remote, cmdline_lp_ctx, cmdline_credentials);
|
h = reg_common_open_remote(remote, cmdline_lp_ctx, cmdline_credentials);
|
||||||
|
@ -47,7 +47,7 @@ static PyObject *py_nbt_node_init(PyObject *self, PyObject *args, PyObject *kwar
|
|||||||
if (ret->mem_ctx == NULL)
|
if (ret->mem_ctx == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ev = event_context_init(ret->mem_ctx);
|
ev = s4_event_context_init(ret->mem_ctx);
|
||||||
ret->socket = nbt_name_socket_init(ret->mem_ctx, ev, lp_iconv_convenience(global_loadparm));
|
ret->socket = nbt_name_socket_init(ret->mem_ctx, ev, lp_iconv_convenience(global_loadparm));
|
||||||
return (PyObject *)ret;
|
return (PyObject *)ret;
|
||||||
}
|
}
|
||||||
|
@ -2621,7 +2621,7 @@ SWIGINTERN PyObject *_wrap_smbcli_sock_connect_byname(PyObject *SWIGUNUSEDPARM(s
|
|||||||
(char *) "host",(char *) "ports",(char *) "resolve_ctx",(char *) "event_ctx", NULL
|
(char *) "host",(char *) "ports",(char *) "resolve_ctx",(char *) "event_ctx", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
arg5 = event_context_init(NULL);
|
arg5 = s4_event_context_init(NULL);
|
||||||
arg3 = NULL;
|
arg3 = NULL;
|
||||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:smbcli_sock_connect_byname",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
|
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:smbcli_sock_connect_byname",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
|
||||||
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
|
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
|
||||||
|
@ -47,7 +47,7 @@ static PyObject *py_net_join(PyObject *cls, PyObject *args, PyObject *kwargs)
|
|||||||
|
|
||||||
/* FIXME: we really need to get a context from the caller or we may end
|
/* FIXME: we really need to get a context from the caller or we may end
|
||||||
* up with 2 event contexts */
|
* up with 2 event contexts */
|
||||||
ev = event_context_init(NULL);
|
ev = s4_event_context_init(NULL);
|
||||||
mem_ctx = talloc_new(ev);
|
mem_ctx = talloc_new(ev);
|
||||||
|
|
||||||
libnet_ctx = py_net_ctx(cls, ev);
|
libnet_ctx = py_net_ctx(cls, ev);
|
||||||
|
@ -336,7 +336,7 @@ static PyObject *dcerpc_interface_new(PyTypeObject *self, PyObject *args, PyObje
|
|||||||
}
|
}
|
||||||
ret = PyObject_New(dcerpc_InterfaceObject, &dcerpc_InterfaceType);
|
ret = PyObject_New(dcerpc_InterfaceObject, &dcerpc_InterfaceType);
|
||||||
|
|
||||||
event_ctx = event_context_init(mem_ctx);
|
event_ctx = s4_event_context_init(mem_ctx);
|
||||||
|
|
||||||
/* Create a dummy interface table struct. TODO: In the future, we should rather just allow
|
/* Create a dummy interface table struct. TODO: In the future, we should rather just allow
|
||||||
* connecting without requiring an interface table.
|
* connecting without requiring an interface table.
|
||||||
|
@ -115,7 +115,7 @@ static void prefork_new_task(struct event_context *ev,
|
|||||||
pid = getpid();
|
pid = getpid();
|
||||||
|
|
||||||
/* This is now the child code. We need a completely new event_context to work with */
|
/* This is now the child code. We need a completely new event_context to work with */
|
||||||
ev2 = event_context_init(NULL);
|
ev2 = s4_event_context_init(NULL);
|
||||||
|
|
||||||
/* the service has given us a private pointer that
|
/* the service has given us a private pointer that
|
||||||
encapsulates the context it needs for this new connection -
|
encapsulates the context it needs for this new connection -
|
||||||
@ -173,7 +173,7 @@ static void prefork_new_task(struct event_context *ev,
|
|||||||
talloc_free(ev2);
|
talloc_free(ev2);
|
||||||
|
|
||||||
/* But we need a events system to handle reaping children */
|
/* But we need a events system to handle reaping children */
|
||||||
ev_parent = event_context_init(NULL);
|
ev_parent = s4_event_context_init(NULL);
|
||||||
|
|
||||||
/* TODO: Handle some events... */
|
/* TODO: Handle some events... */
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ static void standard_accept_connection(struct event_context *ev,
|
|||||||
pid = getpid();
|
pid = getpid();
|
||||||
|
|
||||||
/* This is now the child code. We need a completely new event_context to work with */
|
/* This is now the child code. We need a completely new event_context to work with */
|
||||||
ev2 = event_context_init(NULL);
|
ev2 = s4_event_context_init(NULL);
|
||||||
|
|
||||||
/* the service has given us a private pointer that
|
/* the service has given us a private pointer that
|
||||||
encapsulates the context it needs for this new connection -
|
encapsulates the context it needs for this new connection -
|
||||||
@ -161,7 +161,7 @@ static void standard_new_task(struct event_context *ev,
|
|||||||
pid = getpid();
|
pid = getpid();
|
||||||
|
|
||||||
/* This is now the child code. We need a completely new event_context to work with */
|
/* This is now the child code. We need a completely new event_context to work with */
|
||||||
ev2 = event_context_init(NULL);
|
ev2 = s4_event_context_init(NULL);
|
||||||
|
|
||||||
/* the service has given us a private pointer that
|
/* the service has given us a private pointer that
|
||||||
encapsulates the context it needs for this new connection -
|
encapsulates the context it needs for this new connection -
|
||||||
|
@ -77,7 +77,7 @@ static void thread_accept_connection(struct event_context *ev,
|
|||||||
struct new_conn_state *state;
|
struct new_conn_state *state;
|
||||||
struct event_context *ev2;
|
struct event_context *ev2;
|
||||||
|
|
||||||
ev2 = event_context_init(ev);
|
ev2 = s4_event_context_init(ev);
|
||||||
if (ev2 == NULL) return;
|
if (ev2 == NULL) return;
|
||||||
|
|
||||||
state = talloc(ev2, struct new_conn_state);
|
state = talloc(ev2, struct new_conn_state);
|
||||||
@ -160,7 +160,7 @@ static void thread_new_task(struct event_context *ev,
|
|||||||
struct new_task_state *state;
|
struct new_task_state *state;
|
||||||
struct event_context *ev2;
|
struct event_context *ev2;
|
||||||
|
|
||||||
ev2 = event_context_init(ev);
|
ev2 = s4_event_context_init(ev);
|
||||||
if (ev2 == NULL) return;
|
if (ev2 == NULL) return;
|
||||||
|
|
||||||
state = talloc(ev2, struct new_task_state);
|
state = talloc(ev2, struct new_task_state);
|
||||||
|
@ -313,7 +313,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
|
|||||||
|
|
||||||
/* the event context is the top level structure in smbd. Everything else
|
/* the event context is the top level structure in smbd. Everything else
|
||||||
should hang off that */
|
should hang off that */
|
||||||
event_ctx = event_context_init(talloc_autofree_context());
|
event_ctx = s4_event_context_init(talloc_autofree_context());
|
||||||
|
|
||||||
if (event_ctx == NULL) {
|
if (event_ctx == NULL) {
|
||||||
DEBUG(0,("Initializing event context failed\n"));
|
DEBUG(0,("Initializing event context failed\n"));
|
||||||
|
@ -3219,7 +3219,7 @@ static bool split_unc_name(const char *unc, char **server, char **share)
|
|||||||
|
|
||||||
printf("seed=%u\n", options.seed);
|
printf("seed=%u\n", options.seed);
|
||||||
|
|
||||||
ev = event_context_init(talloc_autofree_context());
|
ev = s4_event_context_init(talloc_autofree_context());
|
||||||
|
|
||||||
gensec_init(lp_ctx);
|
gensec_init(lp_ctx);
|
||||||
|
|
||||||
|
@ -637,7 +637,7 @@ static void usage(poptContext pc)
|
|||||||
servers[1] = servers[0];
|
servers[1] = servers[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
ev = event_context_init(talloc_autofree_context());
|
ev = s4_event_context_init(talloc_autofree_context());
|
||||||
|
|
||||||
gensec_init(lp_ctx);
|
gensec_init(lp_ctx);
|
||||||
|
|
||||||
|
@ -550,7 +550,7 @@ static void usage(void)
|
|||||||
DEBUG(0,("seed=%u\n", seed));
|
DEBUG(0,("seed=%u\n", seed));
|
||||||
srandom(seed);
|
srandom(seed);
|
||||||
|
|
||||||
ev = event_context_init(talloc_autofree_context());
|
ev = s4_event_context_init(talloc_autofree_context());
|
||||||
|
|
||||||
locking_init(1);
|
locking_init(1);
|
||||||
lp_smbcli_options(lp_ctx, &options);
|
lp_smbcli_options(lp_ctx, &options);
|
||||||
|
@ -355,7 +355,7 @@ static void usage(poptContext pc)
|
|||||||
|
|
||||||
lp_ctx = cmdline_lp_ctx;
|
lp_ctx = cmdline_lp_ctx;
|
||||||
|
|
||||||
ev = event_context_init(talloc_autofree_context());
|
ev = s4_event_context_init(talloc_autofree_context());
|
||||||
|
|
||||||
gensec_init(lp_ctx);
|
gensec_init(lp_ctx);
|
||||||
|
|
||||||
|
@ -689,7 +689,7 @@ int main(int argc,char *argv[])
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
torture = torture_context_init(event_context_init(NULL), ui_ops);
|
torture = torture_context_init(s4_event_context_init(NULL), ui_ops);
|
||||||
if (basedir != NULL) {
|
if (basedir != NULL) {
|
||||||
if (basedir[0] != '/') {
|
if (basedir[0] != '/') {
|
||||||
fprintf(stderr, "Please specify an absolute path to --basedir\n");
|
fprintf(stderr, "Please specify an absolute path to --basedir\n");
|
||||||
|
@ -185,7 +185,7 @@ static int binary_net(int argc, const char **argv)
|
|||||||
|
|
||||||
dcerpc_init();
|
dcerpc_init();
|
||||||
|
|
||||||
ev = event_context_init(NULL);
|
ev = s4_event_context_init(NULL);
|
||||||
if (!ev) {
|
if (!ev) {
|
||||||
d_printf("Failed to create an event context\n");
|
d_printf("Failed to create an event context\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -359,7 +359,7 @@ int main(int argc, const char *argv[])
|
|||||||
|
|
||||||
load_interfaces(NULL, lp_interfaces(cmdline_lp_ctx), &ifaces);
|
load_interfaces(NULL, lp_interfaces(cmdline_lp_ctx), &ifaces);
|
||||||
|
|
||||||
ev = event_context_init(talloc_autofree_context());
|
ev = s4_event_context_init(talloc_autofree_context());
|
||||||
|
|
||||||
while (poptPeekArg(pc)) {
|
while (poptPeekArg(pc)) {
|
||||||
const char *name = poptGetArg(pc);
|
const char *name = poptGetArg(pc);
|
||||||
|
@ -462,7 +462,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ev = event_context_init(state);
|
ev = s4_event_context_init(state);
|
||||||
if (!ev) {
|
if (!ev) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user