summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-01-02 11:39:04 -0800
committerJeremy Allison <jra@samba.org>2009-01-02 11:39:04 -0800
commit11576353f645d7d7f44a74d27545b946c6175658 (patch)
treea756a430d3fea82ac8a24144613d5d7e04d163f1 /source4
parent2234173220c51c2e37818149ddf41421672904c0 (diff)
parent268f3e93a4dd66ce43dc53278eff01f801ba5083 (diff)
downloadsamba-11576353f645d7d7f44a74d27545b946c6175658.tar.gz
samba-11576353f645d7d7f44a74d27545b946c6175658.tar.bz2
samba-11576353f645d7d7f44a74d27545b946c6175658.zip
Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
Diffstat (limited to 'source4')
-rw-r--r--source4/headermap.txt3
-rw-r--r--source4/lib/events/config.mk2
-rw-r--r--source4/lib/events/events.h2
-rw-r--r--source4/lib/events/events_internal.h5
-rw-r--r--source4/lib/events/tevent_s4.c38
-rw-r--r--source4/lib/registry/pyregistry.c2
-rwxr-xr-xsource4/selftest/tests.sh2
-rw-r--r--source4/smbd/server.c2
-rw-r--r--source4/winbind/wb_init_domain.c3
-rw-r--r--source4/winbind/wb_samba3_cmd.c4
10 files changed, 35 insertions, 28 deletions
diff --git a/source4/headermap.txt b/source4/headermap.txt
index d5e70a7304..c27ec2f2de 100644
--- a/source4/headermap.txt
+++ b/source4/headermap.txt
@@ -49,11 +49,8 @@ param/share.h: share.h
../lib/util/util_tdb.h: util_tdb.h
../lib/util/util_ldb.h: util_ldb.h
../lib/util/wrap_xattr.h: wrap_xattr.h
-lib/events/events.h: events/events.h
-lib/events/events_internal.h: events/events_internal.h
libcli/ldap/ldap_ndr.h: ldap_ndr.h
lib/events/events.h: events.h
-lib/events/events_internal.h: events_internal.h
../lib/tevent/tevent.h: tevent.h
../lib/tevent/tevent_internal.h: tevent_internal.h
auth/session.h: samba/session.h
diff --git a/source4/lib/events/config.mk b/source4/lib/events/config.mk
index a1b2cd218a..c07a21bc75 100644
--- a/source4/lib/events/config.mk
+++ b/source4/lib/events/config.mk
@@ -4,4 +4,4 @@ CFLAGS = -Ilib/events
LIBEVENTS_OBJ_FILES = $(addprefix $(libeventssrcdir)/, tevent_s4.o)
-PUBLIC_HEADERS += $(addprefix $(libeventssrcdir)/, events.h events_internal.h)
+PUBLIC_HEADERS += $(addprefix $(libeventssrcdir)/, events.h)
diff --git a/source4/lib/events/events.h b/source4/lib/events/events.h
index 698ff2919b..1b2dbde32b 100644
--- a/source4/lib/events/events.h
+++ b/source4/lib/events/events.h
@@ -3,5 +3,5 @@
#define TEVENT_COMPAT_DEFINES 1
#include <../lib/tevent/tevent.h>
struct tevent_context *s4_event_context_init(TALLOC_CTX *mem_ctx);
-struct tevent_context *event_context_find(TALLOC_CTX *mem_ctx);
+struct tevent_context *event_context_find(TALLOC_CTX *mem_ctx) _DEPRECATED_;
#endif /* __LIB_EVENTS_H__ */
diff --git a/source4/lib/events/events_internal.h b/source4/lib/events/events_internal.h
deleted file mode 100644
index 055bfe1a92..0000000000
--- a/source4/lib/events/events_internal.h
+++ /dev/null
@@ -1,5 +0,0 @@
-#ifndef __LIB_EVENTS_INTERNAL_H__
-#define __LIB_EVENTS_INTERNAL_H__
-#define TEVENT_COMPAT_DEFINES 1
-#include <../lib/tevent/tevent_internal.h>
-#endif /* __LIB_EVENTS_INTERNAL_H__ */
diff --git a/source4/lib/events/tevent_s4.c b/source4/lib/events/tevent_s4.c
index b3de7e667a..34a34a8e0b 100644
--- a/source4/lib/events/tevent_s4.c
+++ b/source4/lib/events/tevent_s4.c
@@ -17,38 +17,37 @@
*/
#include "includes.h"
-#include <events.h>
-#include <events_internal.h>
+#include "lib/events/events.h"
/*
this is used to catch debug messages from events
*/
-static void ev_wrap_debug(void *context, enum ev_debug_level level,
+static void ev_wrap_debug(void *context, enum tevent_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,
+static void ev_wrap_debug(void *context, enum tevent_debug_level level,
const char *fmt, va_list ap)
{
int samba_level = -1;
char *s = NULL;
switch (level) {
- case EV_DEBUG_FATAL:
+ case TEVENT_DEBUG_FATAL:
samba_level = 0;
break;
- case EV_DEBUG_ERROR:
+ case TEVENT_DEBUG_ERROR:
samba_level = 1;
break;
- case EV_DEBUG_WARNING:
+ case TEVENT_DEBUG_WARNING:
samba_level = 2;
break;
- case EV_DEBUG_TRACE:
+ case TEVENT_DEBUG_TRACE:
samba_level = 5;
break;
};
vasprintf(&s, fmt, ap);
if (!s) return;
- DEBUG(samba_level, ("events: %s\n", s));
+ DEBUG(samba_level, ("tevent: %s\n", s));
free(s);
}
@@ -63,10 +62,27 @@ struct tevent_context *s4_event_context_init(TALLOC_CTX *mem_ctx)
{
struct tevent_context *ev;
- ev = event_context_init_byname(mem_ctx, NULL);
+ ev = tevent_context_init_byname(mem_ctx, NULL);
if (ev) {
- ev_set_debug(ev, ev_wrap_debug, NULL);
+ tevent_set_debug(ev, ev_wrap_debug, NULL);
}
return ev;
}
+/*
+ find an event context that is a parent of the given memory context,
+ or create a new event context as a child of the given context if
+ none is found
+
+ This should be used in preference to event_context_init() in places
+ where you would prefer to use the existing event context if possible
+ (which is most situations)
+*/
+struct tevent_context *event_context_find(TALLOC_CTX *mem_ctx)
+{
+ struct tevent_context *ev = talloc_find_parent_bytype(mem_ctx, struct tevent_context);
+ if (ev == NULL) {
+ ev = tevent_context_init(mem_ctx);
+ }
+ return ev;
+}
diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c
index 2d2f2fb685..357305c4de 100644
--- a/source4/lib/registry/pyregistry.c
+++ b/source4/lib/registry/pyregistry.c
@@ -357,7 +357,7 @@ static PyObject *py_open_ldb_file(PyObject *self, PyObject *args, PyObject *kwar
session_info = NULL; /* FIXME */
result = reg_open_ldb_file(NULL, location, session_info, credentials,
- event_context_init(NULL), lp_ctx, &key);
+ tevent_context_init(NULL), lp_ctx, &key);
PyErr_WERROR_IS_ERR_RAISE(result);
return py_talloc_import(&PyHiveKey, key);
diff --git a/source4/selftest/tests.sh b/source4/selftest/tests.sh
index 0a5bdf62cd..56cbacbdaf 100755
--- a/source4/selftest/tests.sh
+++ b/source4/selftest/tests.sh
@@ -401,7 +401,7 @@ plantest "samr.python" dc $SUBUNITRUN samba.tests.dcerpc.sam
plantest "dcerpc.bare.python" dc $SUBUNITRUN samba.tests.dcerpc.bare
plantest "unixinfo.python" dc $SUBUNITRUN samba.tests.dcerpc.unix
plantest "samdb.python" none $SUBUNITRUN samba.tests.samdb
-plantest "events.python" none PYTHONPATH="$PYTHONPATH:../lib/tevent" $SUBUNITRUN tests
+plantest "tevent.python" none PYTHONPATH="$PYTHONPATH:../lib/tevent" $SUBUNITRUN tests
plantest "messaging.python" none PYTHONPATH="$PYTHONPATH:lib/messaging/tests" $SUBUNITRUN bindings
plantest "samba3sam.python" none PYTHONPATH="$PYTHONPATH:dsdb/samdb/ldb_modules/tests" $SUBUNITRUN samba3sam
plantest "subunit.python" none $SUBUNITRUN subunit
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index c1683a48dc..1eb3e42501 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -266,7 +266,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
umask(0);
DEBUG(0,("%s version %s started.\n", binary_name, SAMBA_VERSION_STRING));
- DEBUGADD(0,("Copyright Andrew Tridgell and the Samba Team 1992-2008\n"));
+ DEBUGADD(0,("Copyright Andrew Tridgell and the Samba Team 1992-2009\n"));
if (sizeof(uint16_t) < 2 || sizeof(uint32_t) < 4 || sizeof(uint64_t) < 8) {
DEBUG(0,("ERROR: Samba is not configured correctly for the word size on your machine\n"));
diff --git a/source4/winbind/wb_init_domain.c b/source4/winbind/wb_init_domain.c
index 637cf10bb7..5953474c52 100644
--- a/source4/winbind/wb_init_domain.c
+++ b/source4/winbind/wb_init_domain.c
@@ -402,8 +402,7 @@ static void init_domain_recv_samr(struct composite_context *ctx)
talloc_steal(state->domain->libnet_ctx->samr.pipe, state->domain->samr_binding);
state->domain->libnet_ctx->samr.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
state->domain->libnet_ctx->samr.name = state->domain->info->name;
- state->domain->libnet_ctx->samr.sid = dom_sid_dup(state->ctx,
- state->domain->info->sid);
+ state->domain->libnet_ctx->samr.sid = state->domain->info->sid;
composite_done(state->ctx);
}
diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c
index 6cad76b08b..ea3050503d 100644
--- a/source4/winbind/wb_samba3_cmd.c
+++ b/source4/winbind/wb_samba3_cmd.c
@@ -115,8 +115,8 @@ NTSTATUS wbsrv_samba3_priv_pipe_dir(struct wbsrv_samba3_call *s3call)
{
const char *path = s3call->wbconn->listen_socket->service->priv_socket_path;
s3call->response.result = WINBINDD_OK;
- WBSRV_SAMBA3_SET_STRING(s3call->response.extra_data.data, path);
-
+ s3call->response.extra_data.data = path;
+
s3call->response.length += strlen(path) + 1;
return NT_STATUS_OK;
}