From 8b81e7c7c65f3923aaa7a366733000517b44756e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Jan 2009 09:44:53 +0100 Subject: Happy New Year! metze --- source4/smbd/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4') 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")); -- cgit From a54c558ca6e6eee1c16817bfb9d9b7dcabd578b8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Jan 2009 17:52:14 +0100 Subject: Revert "s4 winbind: Avoid a "discards const" compiler warning." This reverts commit dd8d4b6fd178df6847052dac207a4aafc0697d71. s3call->response.extra_data.data is a pointer and no fstring! metze --- source4/winbind/wb_samba3_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4') 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; } -- cgit From 0e95c9a1eb82a50281c94b226fbae2ac3210e5f5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Jan 2009 18:10:26 +0100 Subject: Revert "s4 winbind: Copy SID to avoid "discard const" warning" This reverts commit 102028ec722d942d7f91eb92e8da4f1480d140d1. state->ctx is the composite_context, which is a temporary context! metze --- source4/winbind/wb_init_domain.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4') 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); } -- cgit From 54c0f626f51c33245ae8f7778cc6ad6b48ae0f93 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Jan 2009 16:06:31 +0100 Subject: s4:pyregistry: use tevent_context_init() metze --- source4/lib/registry/pyregistry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4') 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); -- cgit From 3f8f99eaecf7a07126969594c41c00392b85cefd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Jan 2009 12:06:39 +0100 Subject: s4:tevent: move event_context_find() to tevent_s4.c metze --- source4/lib/events/tevent_s4.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source4') diff --git a/source4/lib/events/tevent_s4.c b/source4/lib/events/tevent_s4.c index b3de7e667a..e50ff57e90 100644 --- a/source4/lib/events/tevent_s4.c +++ b/source4/lib/events/tevent_s4.c @@ -70,3 +70,20 @@ struct tevent_context *s4_event_context_init(TALLOC_CTX *mem_ctx) 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 = event_context_init(mem_ctx); + } + return ev; +} -- cgit From 25387d89427d1cc79c80d4915ecc00100712be87 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Jan 2009 15:33:23 +0100 Subject: s4:lib/events: deprecate event_context_find() metze --- source4/lib/events/events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4') 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__ */ -- cgit From 34cc50cb63a1a9e466d833de781e57b2f7c0b8ab Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Jan 2009 15:34:37 +0100 Subject: s4:lib/events: convert to use tevent_* functions instead of compat macros metze --- source4/lib/events/tevent_s4.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'source4') diff --git a/source4/lib/events/tevent_s4.c b/source4/lib/events/tevent_s4.c index e50ff57e90..34a34a8e0b 100644 --- a/source4/lib/events/tevent_s4.c +++ b/source4/lib/events/tevent_s4.c @@ -17,38 +17,37 @@ */ #include "includes.h" -#include -#include +#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,9 +62,9 @@ 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; } @@ -83,7 +82,7 @@ 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 = event_context_init(mem_ctx); + ev = tevent_context_init(mem_ctx); } return ev; } -- cgit From 2885a7ab6e2a44a76148380f47e2d0cde69d8b38 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Jan 2009 16:27:48 +0100 Subject: s4:selftest: report tevent tests as 'tevent.python' metze --- source4/selftest/tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4') 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 -- cgit From 268f3e93a4dd66ce43dc53278eff01f801ba5083 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Jan 2009 16:41:21 +0100 Subject: s4:lib/events: remove unused events_internal.h external users need to use tevent_internal.h anyway metze --- source4/headermap.txt | 3 --- source4/lib/events/config.mk | 2 +- source4/lib/events/events_internal.h | 5 ----- 3 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 source4/lib/events/events_internal.h (limited to 'source4') 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_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__ */ -- cgit From 2234173220c51c2e37818149ddf41421672904c0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 2 Jan 2009 11:38:24 -0800 Subject: Fix warnings in make test code. Jeremy. --- source4/torture/util_smb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c index f88a641059..732b84af73 100644 --- a/source4/torture/util_smb.c +++ b/source4/torture/util_smb.c @@ -656,7 +656,10 @@ double torture_create_procs(struct torture_context *tctx, pid_t mypid = getpid(); srandom(((int)mypid) ^ ((int)time(NULL))); - asprintf(&myname, "CLIENT%d", i); + if (asprintf(&myname, "CLIENT%d", i) == -1) { + printf("asprintf failed\n"); + return -1; + } lp_set_cmdline(tctx->lp_ctx, "netbios name", myname); free(myname); -- cgit From de58ef45ac0510bfa510fed54010f1de67e83953 Mon Sep 17 00:00:00 2001 From: "scudette@gmail.com" Date: Fri, 2 Jan 2009 22:39:58 +1100 Subject: Fixes uninitialised access as reported by valgrind. --- source4/lib/registry/regf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c index a869ed4440..d6fb413b51 100644 --- a/source4/lib/registry/regf.c +++ b/source4/lib/registry/regf.c @@ -543,7 +543,7 @@ static WERROR regf_get_value(TALLOC_CTX *ctx, struct hive_key *key, if (vk->data_length & 0x80000000) { vk->data_length &=~0x80000000; - data->data = (uint8_t *)&vk->data_offset; + data->data = talloc_memdup(ctx, (uint8_t *)&vk->data_offset, vk->data_length); data->length = vk->data_length; } else { *data = hbin_get(regf, vk->data_offset); -- cgit From cc9771d3daa84994ceec427127a71a3cf0a34b9a Mon Sep 17 00:00:00 2001 From: "scudette@gmail.com" Date: Fri, 2 Jan 2009 22:40:32 +1100 Subject: Memory leak fixed due to accumulation of open reg keys. --- source4/lib/registry/tools/regtree.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'source4') diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index cca009a0e2..948ed49312 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -55,13 +55,16 @@ static void print_tree(int level, struct registry_key *p, &keyname, NULL, NULL)); i++) { - SMB_ASSERT(strlen(keyname) > 0); + + SMB_ASSERT(strlen(keyname) > 0); if (!W_ERROR_IS_OK(reg_open_key(mem_ctx, p, keyname, &subkey))) - continue; + continue; + print_tree(level+1, subkey, (fullpath && strlen(name))? - talloc_asprintf(mem_ctx, "%s\\%s", - name, keyname): - keyname, fullpath, novals); + talloc_asprintf(mem_ctx, "%s\\%s", + name, keyname): + keyname, fullpath, novals); + talloc_free(subkey); } talloc_free(mem_ctx); -- cgit From 793f1cdbd918f2245255176572027763664d9d0b Mon Sep 17 00:00:00 2001 From: "scudette@gmail.com" Date: Fri, 2 Jan 2009 22:41:04 +1100 Subject: Changed code to use proper talloc context instead of NULL to control memory leak. --- source4/lib/registry/regf.c | 2 +- source4/lib/registry/tools/common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/lib/registry/regf.c b/source4/lib/registry/regf.c index d6fb413b51..4cbcb09a10 100644 --- a/source4/lib/registry/regf.c +++ b/source4/lib/registry/regf.c @@ -2045,7 +2045,7 @@ WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx, const char *location, struct tdr_pull *pull; int i; - regf = (struct regf_data *)talloc_zero(NULL, struct regf_data); + regf = (struct regf_data *)talloc_zero(parent_ctx, struct regf_data); regf->iconv_convenience = iconv_convenience; diff --git a/source4/lib/registry/tools/common.c b/source4/lib/registry/tools/common.c index c9f1248bf8..d997cb0fde 100644 --- a/source4/lib/registry/tools/common.c +++ b/source4/lib/registry/tools/common.c @@ -51,7 +51,7 @@ struct registry_key *reg_common_open_file(const char *path, struct registry_context *h = NULL; WERROR error; - error = reg_open_hive(NULL, path, NULL, creds, ev_ctx, lp_ctx, &hive_root); + error = reg_open_hive(ev_ctx, path, NULL, creds, ev_ctx, lp_ctx, &hive_root); if(!W_ERROR_IS_OK(error)) { fprintf(stderr, "Unable to open '%s': %s \n", -- cgit From 120dc0e5aa2778a6ad2da80672b0e51ed77f2f53 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Fri, 2 Jan 2009 22:46:08 +0100 Subject: s4 winbind: Correctly silence a "discard const" warning Thanks to metze for pointing out the error. --- source4/winbind/wb_samba3_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c index ea3050503d..6af92668a3 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; - s3call->response.extra_data.data = path; - + s3call->response.extra_data.data = discard_const(path); + s3call->response.length += strlen(path) + 1; return NT_STATUS_OK; } -- cgit From b00f6d169c1b5b4da5d8c5167d81a659e1deca13 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 3 Jan 2009 09:14:23 +0100 Subject: tevent: raise version to 0.9.1 This 0.9.1 isn't compatible with 0.9.0, but it makes only sense to raise the major version after we have reached 1.0.0. metze --- source4/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/configure.ac b/source4/configure.ac index debdc39d58..ef8ad66f68 100644 --- a/source4/configure.ac +++ b/source4/configure.ac @@ -60,7 +60,7 @@ SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= 1.1.3, SMB_INCLUDE_MK(../lib/tdb/python.mk) -SMB_EXT_LIB_FROM_PKGCONFIG(LIBTEVENT, tevent >= 0.9.0, +SMB_EXT_LIB_FROM_PKGCONFIG(LIBTEVENT, tevent >= 0.9.1, [], [ m4_include(../lib/tevent/libtevent.m4) -- cgit From b1be241ca5d7f02be93bd3582b98d428b1e207ce Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 3 Jan 2009 12:43:18 +0100 Subject: s4:sysdep/inotify: use tevent_fd_set_auto_close() metze --- source4/ntvfs/sysdep/inotify.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/ntvfs/sysdep/inotify.c b/source4/ntvfs/sysdep/inotify.c index f7aa91dd0e..42aac0b097 100644 --- a/source4/ntvfs/sysdep/inotify.c +++ b/source4/ntvfs/sysdep/inotify.c @@ -23,8 +23,8 @@ #include "includes.h" #include "system/filesys.h" +#include #include "ntvfs/sysdep/sys_notify.h" -#include "lib/events/events.h" #include "../lib/util/dlinklist.h" #include "libcli/raw/smb.h" #include "param/param.h" @@ -249,8 +249,11 @@ static void inotify_handler(struct tevent_context *ev, struct tevent_fd *fde, static NTSTATUS inotify_setup(struct sys_notify_context *ctx) { struct inotify_private *in; + struct tevent_fd *fde; + in = talloc(ctx, struct inotify_private); NT_STATUS_HAVE_NO_MEMORY(in); + in->fd = inotify_init(); if (in->fd == -1) { DEBUG(0,("Failed to init inotify - %s\n", strerror(errno))); @@ -263,8 +266,19 @@ static NTSTATUS inotify_setup(struct sys_notify_context *ctx) ctx->private_data = in; /* add a event waiting for the inotify fd to be readable */ - event_add_fd(ctx->ev, in, in->fd, EVENT_FD_READ|EVENT_FD_AUTOCLOSE, inotify_handler, in); - + fde = tevent_add_fd(ctx->ev, in, in->fd, + TEVENT_FD_READ, inotify_handler, in); + if (!fde) { + if (errno == 0) { + errno = ENOMEM; + } + DEBUG(0,("Failed to tevent_add_fd() - %s\n", strerror(errno))); + talloc_free(in); + return map_nt_error_from_unix(errno); + } + + tevent_fd_set_auto_close(fde); + return NT_STATUS_OK; } -- cgit From 5fa0d3d56824f4ef3dfdb0f97c836554a62c4875 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 3 Jan 2009 12:47:24 +0100 Subject: s4:socket: use a socket_wrapper aware function to auto close the fd event for sockets metze --- source4/auth/kerberos/krb5_init_context.c | 9 +++++---- source4/lib/socket/socket.c | 9 +++++++++ source4/lib/socket/socket.h | 6 ++++++ source4/libcli/ldap/ldap_client.c | 7 ++++--- source4/smbd/service_stream.c | 25 +++++++++++++++---------- 5 files changed, 39 insertions(+), 17 deletions(-) (limited to 'source4') diff --git a/source4/auth/kerberos/krb5_init_context.c b/source4/auth/kerberos/krb5_init_context.c index 2f0a2317a0..6830bb7189 100644 --- a/source4/auth/kerberos/krb5_init_context.c +++ b/source4/auth/kerberos/krb5_init_context.c @@ -284,11 +284,12 @@ krb5_error_code smb_krb5_send_and_recv_func(krb5_context context, * drop) and mark as AUTOCLOSE along with the fde */ /* Ths is equivilant to EVENT_FD_READABLE(smb_krb5->fde) */ - smb_krb5->fde = event_add_fd(ev, smb_krb5->sock, - socket_get_fd(smb_krb5->sock), - EVENT_FD_READ|EVENT_FD_AUTOCLOSE, - smb_krb5_socket_handler, smb_krb5); + smb_krb5->fde = tevent_add_fd(ev, smb_krb5->sock, + socket_get_fd(smb_krb5->sock), + TEVENT_FD_READ, + smb_krb5_socket_handler, smb_krb5); /* its now the job of the event layer to close the socket */ + tevent_fd_set_close_fn(smb_krb5->fde, socket_tevent_fd_close_fn); socket_set_flags(smb_krb5->sock, SOCKET_FLAG_NOCLOSE); event_add_timed(ev, smb_krb5, diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c index 26cdac99a3..9d30e0a77e 100644 --- a/source4/lib/socket/socket.c +++ b/source4/lib/socket/socket.c @@ -37,6 +37,15 @@ static int socket_destructor(struct socket_context *sock) return 0; } +_PUBLIC_ void socket_tevent_fd_close_fn(struct tevent_context *ev, + struct tevent_fd *fde, + int fd, + void *private_data) +{ + /* this might be the socket_wrapper swrap_close() */ + close(fd); +} + _PUBLIC_ NTSTATUS socket_create_with_ops(TALLOC_CTX *mem_ctx, const struct socket_ops *ops, struct socket_context **new_sock, enum socket_type type, uint32_t flags) diff --git a/source4/lib/socket/socket.h b/source4/lib/socket/socket.h index 7a27e3070b..e9338127c4 100644 --- a/source4/lib/socket/socket.h +++ b/source4/lib/socket/socket.h @@ -21,6 +21,7 @@ #define _SAMBA_SOCKET_H struct tevent_context; +struct tevent_fd; struct socket_context; enum socket_type { @@ -205,6 +206,11 @@ NTSTATUS socket_connect_multi(TALLOC_CTX *mem_ctx, const char *server_address, void set_socket_options(int fd, const char *options); void socket_set_flags(struct socket_context *socket, unsigned flags); +void socket_tevent_fd_close_fn(struct tevent_context *ev, + struct tevent_fd *fde, + int fd, + void *private_data); + extern bool testnonblock; #endif /* _SAMBA_SOCKET_H */ diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c index 18784135cc..8c68103997 100644 --- a/source4/libcli/ldap/ldap_client.c +++ b/source4/libcli/ldap/ldap_client.c @@ -387,14 +387,15 @@ static void ldap_connect_got_sock(struct composite_context *ctx, struct ldap_connection *conn) { /* setup a handler for events on this socket */ - conn->event.fde = event_add_fd(conn->event.event_ctx, conn->sock, - socket_get_fd(conn->sock), - EVENT_FD_READ | EVENT_FD_AUTOCLOSE, ldap_io_handler, conn); + conn->event.fde = tevent_add_fd(conn->event.event_ctx, conn->sock, + socket_get_fd(conn->sock), + TEVENT_FD_READ, ldap_io_handler, conn); if (conn->event.fde == NULL) { composite_error(ctx, NT_STATUS_INTERNAL_ERROR); return; } + tevent_fd_set_close_fn(conn->event.fde, socket_tevent_fd_close_fn); socket_set_flags(conn->sock, SOCKET_FLAG_NOCLOSE); talloc_steal(conn, conn->sock); diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c index ef98919f93..a5642c258f 100644 --- a/source4/smbd/service_stream.c +++ b/source4/smbd/service_stream.c @@ -258,6 +258,7 @@ NTSTATUS stream_setup_socket(struct tevent_context *event_context, NTSTATUS status; struct stream_socket *stream_socket; struct socket_address *socket_address; + struct tevent_fd *fde; int i; stream_socket = talloc_zero(event_context, struct stream_socket); @@ -322,20 +323,24 @@ NTSTATUS stream_setup_socket(struct tevent_context *event_context, return status; } - /* By specifying EVENT_FD_AUTOCLOSE below, we indicate that we - * will close the socket using the events system. This avoids - * nasty interactions with waiting for talloc to close the socket. */ - - socket_set_flags(stream_socket->sock, SOCKET_FLAG_NOCLOSE); - /* Add the FD from the newly created socket into the event * subsystem. it will call the accept handler whenever we get * new connections */ - event_add_fd(event_context, stream_socket->sock, - socket_get_fd(stream_socket->sock), - EVENT_FD_READ|EVENT_FD_AUTOCLOSE, - stream_accept_handler, stream_socket); + fde = tevent_add_fd(event_context, stream_socket->sock, + socket_get_fd(stream_socket->sock), + TEVENT_FD_READ, + stream_accept_handler, stream_socket); + if (!fde) { + DEBUG(0,("Failed to setup fd event\n")); + talloc_free(stream_socket); + return NT_STATUS_NO_MEMORY; + } + + /* we let events system to the close on the socket. This avoids + * nasty interactions with waiting for talloc to close the socket. */ + tevent_fd_set_close_fn(fde, socket_tevent_fd_close_fn); + socket_set_flags(stream_socket->sock, SOCKET_FLAG_NOCLOSE); stream_socket->private = talloc_reference(stream_socket, private); stream_socket->ops = stream_ops; -- cgit From c652b426126d97ae8fad256bf5b96beed414a385 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 3 Jan 2009 11:36:04 +0100 Subject: tevent: raise version to 0.9.2 after AUTOCLOSE changes metze --- source4/configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/configure.ac b/source4/configure.ac index ef8ad66f68..4ce55c82ba 100644 --- a/source4/configure.ac +++ b/source4/configure.ac @@ -60,7 +60,7 @@ SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= 1.1.3, SMB_INCLUDE_MK(../lib/tdb/python.mk) -SMB_EXT_LIB_FROM_PKGCONFIG(LIBTEVENT, tevent >= 0.9.1, +SMB_EXT_LIB_FROM_PKGCONFIG(LIBTEVENT, tevent >= 0.9.2, [], [ m4_include(../lib/tevent/libtevent.m4) -- cgit From c72cbce6eed1eab67649d7965eb16212d52bf833 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 3 Jan 2009 12:48:20 +0100 Subject: s4:auth/kerberos: convert to tevent_* api metze --- source4/auth/kerberos/config.mk | 2 +- source4/auth/kerberos/krb5_init_context.c | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) (limited to 'source4') diff --git a/source4/auth/kerberos/config.mk b/source4/auth/kerberos/config.mk index b724b8df37..822bf398a7 100644 --- a/source4/auth/kerberos/config.mk +++ b/source4/auth/kerberos/config.mk @@ -2,7 +2,7 @@ # Start SUBSYSTEM KERBEROS [SUBSYSTEM::KERBEROS] PUBLIC_DEPENDENCIES = HEIMDAL_KRB5 NDR_KRB5PAC samba_socket LIBCLI_RESOLVE -PRIVATE_DEPENDENCIES = ASN1_UTIL auth_sam_reply LIBPACKET LIBNDR +PRIVATE_DEPENDENCIES = ASN1_UTIL auth_sam_reply LIBTEVENT LIBPACKET LIBNDR # End SUBSYSTEM KERBEROS ################################# diff --git a/source4/auth/kerberos/krb5_init_context.c b/source4/auth/kerberos/krb5_init_context.c index 6830bb7189..6e885842f3 100644 --- a/source4/auth/kerberos/krb5_init_context.c +++ b/source4/auth/kerberos/krb5_init_context.c @@ -22,11 +22,11 @@ #include "includes.h" #include "system/kerberos.h" +#include #include "auth/kerberos/kerberos.h" #include "lib/socket/socket.h" #include "lib/stream/packet.h" #include "system/network.h" -#include "lib/events/events.h" #include "param/param.h" #include "libcli/resolve/resolve.h" @@ -159,9 +159,9 @@ static void smb_krb5_socket_send(struct smb_krb5_socket *smb_krb5) if (!NT_STATUS_IS_OK(status)) return; - EVENT_FD_READABLE(smb_krb5->fde); + TEVENT_FD_READABLE(smb_krb5->fde); - EVENT_FD_NOT_WRITEABLE(smb_krb5->fde); + TEVENT_FD_NOT_WRITEABLE(smb_krb5->fde); return; } @@ -175,22 +175,22 @@ static void smb_krb5_socket_handler(struct tevent_context *ev, struct tevent_fd struct smb_krb5_socket *smb_krb5 = talloc_get_type(private, struct smb_krb5_socket); switch (smb_krb5->hi->proto) { case KRB5_KRBHST_UDP: - if (flags & EVENT_FD_READ) { + if (flags & TEVENT_FD_READ) { smb_krb5_socket_recv(smb_krb5); return; } - if (flags & EVENT_FD_WRITE) { + if (flags & TEVENT_FD_WRITE) { smb_krb5_socket_send(smb_krb5); return; } /* not reached */ return; case KRB5_KRBHST_TCP: - if (flags & EVENT_FD_READ) { + if (flags & TEVENT_FD_READ) { packet_recv(smb_krb5->packet); return; } - if (flags & EVENT_FD_WRITE) { + if (flags & TEVENT_FD_WRITE) { packet_queue_run(smb_krb5->packet); return; } @@ -292,17 +292,16 @@ krb5_error_code smb_krb5_send_and_recv_func(krb5_context context, tevent_fd_set_close_fn(smb_krb5->fde, socket_tevent_fd_close_fn); socket_set_flags(smb_krb5->sock, SOCKET_FLAG_NOCLOSE); - event_add_timed(ev, smb_krb5, - timeval_current_ofs(timeout, 0), - smb_krb5_request_timeout, smb_krb5); + tevent_add_timer(ev, smb_krb5, + timeval_current_ofs(timeout, 0), + smb_krb5_request_timeout, smb_krb5); - smb_krb5->status = NT_STATUS_OK; smb_krb5->reply = data_blob(NULL, 0); switch (hi->proto) { case KRB5_KRBHST_UDP: - EVENT_FD_WRITEABLE(smb_krb5->fde); + TEVENT_FD_WRITEABLE(smb_krb5->fde); smb_krb5->request = send_blob; break; case KRB5_KRBHST_TCP: @@ -330,7 +329,7 @@ krb5_error_code smb_krb5_send_and_recv_func(krb5_context context, return EINVAL; } while ((NT_STATUS_IS_OK(smb_krb5->status)) && !smb_krb5->reply.length) { - if (event_loop_once(ev) != 0) { + if (tevent_loop_once(ev) != 0) { talloc_free(smb_krb5); return EINVAL; } -- cgit From 1c8580cfa937bef1b15842b5b0615d7926b12402 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 3 Jan 2009 12:49:50 +0100 Subject: s4:libcli/ldap: convert to tevent_* api metze --- source4/libcli/ldap/config.mk | 2 +- source4/libcli/ldap/ldap_client.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'source4') diff --git a/source4/libcli/ldap/config.mk b/source4/libcli/ldap/config.mk index 2e50596dad..11157c5b63 100644 --- a/source4/libcli/ldap/config.mk +++ b/source4/libcli/ldap/config.mk @@ -1,5 +1,5 @@ [SUBSYSTEM::LIBCLI_LDAP] -PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBEVENTS LIBPACKET +PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBTEVENT LIBPACKET PRIVATE_DEPENDENCIES = LIBCLI_COMPOSITE samba_socket NDR_SAMR LIBTLS ASN1_UTIL \ LDAP_ENCODE LIBNDR LP_RESOLVE gensec diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c index 8c68103997..e30d5032fb 100644 --- a/source4/libcli/ldap/ldap_client.c +++ b/source4/libcli/ldap/ldap_client.c @@ -23,10 +23,10 @@ */ #include "includes.h" +#include +#include "lib/socket/socket.h" #include "../lib/util/asn1.h" #include "../lib/util/dlinklist.h" -#include "lib/events/events.h" -#include "lib/socket/socket.h" #include "libcli/ldap/ldap.h" #include "libcli/ldap/ldap_proto.h" #include "libcli/ldap/ldap_client.h" @@ -229,11 +229,11 @@ static void ldap_io_handler(struct tevent_context *ev, struct tevent_fd *fde, { struct ldap_connection *conn = talloc_get_type(private_data, struct ldap_connection); - if (flags & EVENT_FD_WRITE) { + if (flags & TEVENT_FD_WRITE) { packet_queue_run(conn->packet); if (!tls_enabled(conn->sock)) return; } - if (flags & EVENT_FD_READ) { + if (flags & TEVENT_FD_READ) { ldap_read_io_handler(private_data, flags); } } @@ -622,8 +622,8 @@ _PUBLIC_ struct ldap_request *ldap_request_send(struct ldap_connection *conn, req->state = LDAP_REQUEST_DONE; /* we can't call the async callback now, as it isn't setup, so call it as next event */ - event_add_timed(conn->event.event_ctx, req, timeval_zero(), - ldap_request_complete, req); + tevent_add_timer(conn->event.event_ctx, req, timeval_zero(), + ldap_request_complete, req); return req; } @@ -631,17 +631,17 @@ _PUBLIC_ struct ldap_request *ldap_request_send(struct ldap_connection *conn, DLIST_ADD(conn->pending, req); /* put a timeout on the request */ - req->time_event = event_add_timed(conn->event.event_ctx, req, - timeval_current_ofs(conn->timeout, 0), - ldap_request_timeout, req); + req->time_event = tevent_add_timer(conn->event.event_ctx, req, + timeval_current_ofs(conn->timeout, 0), + ldap_request_timeout, req); return req; failed: req->status = status; req->state = LDAP_REQUEST_ERROR; - event_add_timed(conn->event.event_ctx, req, timeval_zero(), - ldap_request_complete, req); + tevent_add_timer(conn->event.event_ctx, req, timeval_zero(), + ldap_request_complete, req); return req; } @@ -654,7 +654,7 @@ failed: _PUBLIC_ NTSTATUS ldap_request_wait(struct ldap_request *req) { while (req->state < LDAP_REQUEST_DONE) { - if (event_loop_once(req->conn->event.event_ctx) != 0) { + if (tevent_loop_once(req->conn->event.event_ctx) != 0) { req->status = NT_STATUS_UNEXPECTED_NETWORK_ERROR; break; } @@ -769,7 +769,7 @@ _PUBLIC_ NTSTATUS ldap_result_n(struct ldap_request *req, int n, struct ldap_mes NT_STATUS_HAVE_NO_MEMORY(req); while (req->state < LDAP_REQUEST_DONE && n >= req->num_replies) { - if (event_loop_once(req->conn->event.event_ctx) != 0) { + if (tevent_loop_once(req->conn->event.event_ctx) != 0) { return NT_STATUS_UNEXPECTED_NETWORK_ERROR; } } -- cgit From 47d532fa685d46752650225c807f579ce658b323 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 3 Jan 2009 15:24:31 +0100 Subject: s4:smbd: convert to tevent_* api metze --- source4/smbd/config.mk | 3 ++- source4/smbd/server.c | 18 +++++++++--------- source4/smbd/service_named_pipe.c | 6 +++--- source4/smbd/service_stream.c | 30 ++++++++++++++++++++---------- source4/smbd/service_task.c | 1 - 5 files changed, 34 insertions(+), 24 deletions(-) (limited to 'source4') diff --git a/source4/smbd/config.mk b/source4/smbd/config.mk index e0b09f4b8c..a76d10cbe7 100644 --- a/source4/smbd/config.mk +++ b/source4/smbd/config.mk @@ -2,7 +2,7 @@ [SUBSYSTEM::service] PRIVATE_DEPENDENCIES = \ - LIBEVENTS MESSAGING samba_socket NDR_NAMED_PIPE_AUTH + LIBTEVENT MESSAGING samba_socket NDR_NAMED_PIPE_AUTH service_OBJ_FILES = $(addprefix $(smbdsrcdir)/, \ service.o \ @@ -21,6 +21,7 @@ $(eval $(call proto_header_template,$(smbdsrcdir)/pidfile.h,$(PIDFILE_OBJ_FILES: [BINARY::samba] INSTALLDIR = SBINDIR PRIVATE_DEPENDENCIES = \ + LIBEVENTS \ process_model \ service \ LIBSAMBA-HOSTCONFIG \ diff --git a/source4/smbd/server.c b/source4/smbd/server.c index 1eb3e42501..df970661f1 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -323,7 +323,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ if (opt_interactive) { /* terminate when stdin goes away */ - stdin_event_flags = EVENT_FD_READ; + stdin_event_flags = TEVENT_FD_READ; } else { /* stay alive forever */ stdin_event_flags = 0; @@ -333,15 +333,15 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ #ifdef SIGTTIN signal(SIGTTIN, SIG_IGN); #endif - event_add_fd(event_ctx, event_ctx, 0, stdin_event_flags, - server_stdin_handler, - discard_const(binary_name)); + tevent_add_fd(event_ctx, event_ctx, 0, stdin_event_flags, + server_stdin_handler, + discard_const(binary_name)); if (max_runtime) { - event_add_timed(event_ctx, event_ctx, - timeval_current_ofs(max_runtime, 0), - max_runtime_handler, - discard_const(binary_name)); + tevent_add_timer(event_ctx, event_ctx, + timeval_current_ofs(max_runtime, 0), + max_runtime_handler, + discard_const(binary_name)); } DEBUG(0,("%s: using '%s' process model\n", binary_name, model)); @@ -354,7 +354,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ /* wait for events - this is where smbd sits for most of its life */ - event_loop_wait(event_ctx); + tevent_loop_wait(event_ctx); /* as everything hangs off this event context, freeing it should initiate a clean shutdown of all services */ diff --git a/source4/smbd/service_named_pipe.c b/source4/smbd/service_named_pipe.c index 94fd501ffe..02b71de7c3 100644 --- a/source4/smbd/service_named_pipe.c +++ b/source4/smbd/service_named_pipe.c @@ -20,7 +20,7 @@ */ #include "includes.h" -#include "lib/events/events.h" +#include #include "lib/socket/socket.h" #include "smbd/service.h" #include "param/param.h" @@ -49,7 +49,7 @@ static void named_pipe_handover_connection(void *private_data) private_data, struct named_pipe_connection); struct stream_connection *conn = pipe_conn->connection; - EVENT_FD_NOT_WRITEABLE(conn->event.fde); + TEVENT_FD_NOT_WRITEABLE(conn->event.fde); if (!NT_STATUS_IS_OK(pipe_conn->status)) { stream_terminate_connection(conn, nt_errstr(pipe_conn->status)); @@ -64,7 +64,7 @@ static void named_pipe_handover_connection(void *private_data) talloc_free(pipe_conn); /* we're now ready to start receiving events on this stream */ - EVENT_FD_READABLE(conn->event.fde); + TEVENT_FD_READABLE(conn->event.fde); /* * hand over to the real pipe implementation, diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c index a5642c258f..6dff01f4f3 100644 --- a/source4/smbd/service_stream.c +++ b/source4/smbd/service_stream.c @@ -21,8 +21,8 @@ */ #include "includes.h" +#include #include "process_model.h" -#include "lib/events/events.h" #include "lib/socket/socket.h" #include "smbd/service.h" #include "smbd/service_stream.h" @@ -72,7 +72,7 @@ void stream_terminate_connection(struct stream_connection *srv_conn, const char * * and we don't want to read or write to the connection... */ - event_set_fd_flags(srv_conn->event.fde, 0); + tevent_fd_set_flags(srv_conn->event.fde, 0); return; } @@ -88,9 +88,9 @@ void stream_terminate_connection(struct stream_connection *srv_conn, const char static void stream_io_handler(struct stream_connection *conn, uint16_t flags) { conn->processing++; - if (flags & EVENT_FD_WRITE) { + if (flags & TEVENT_FD_WRITE) { conn->ops->send_handler(conn, flags); - } else if (flags & EVENT_FD_READ) { + } else if (flags & TEVENT_FD_READ) { conn->ops->recv_handler(conn, flags); } conn->processing--; @@ -144,9 +144,14 @@ NTSTATUS stream_new_connection_merge(struct tevent_context *ev, srv_conn->msg_ctx = msg_ctx; srv_conn->event.ctx = ev; srv_conn->lp_ctx = lp_ctx; - srv_conn->event.fde = event_add_fd(ev, srv_conn, socket_get_fd(sock), - EVENT_FD_READ, - stream_io_handler_fde, srv_conn); + srv_conn->event.fde = tevent_add_fd(ev, srv_conn, socket_get_fd(sock), + TEVENT_FD_READ, + stream_io_handler_fde, srv_conn); + if (!srv_conn->event.fde) { + talloc_free(srv_conn); + return NT_STATUS_NO_MEMORY; + } + *_srv_conn = srv_conn; return NT_STATUS_OK; } @@ -179,14 +184,19 @@ static void stream_new_connection(struct tevent_context *ev, srv_conn->ops = stream_socket->ops; srv_conn->event.ctx = ev; srv_conn->lp_ctx = lp_ctx; - srv_conn->event.fde = event_add_fd(ev, srv_conn, socket_get_fd(sock), - 0, stream_io_handler_fde, srv_conn); if (!socket_check_access(sock, "smbd", lp_hostsallow(NULL, lp_default_service(lp_ctx)), lp_hostsdeny(NULL, lp_default_service(lp_ctx)))) { stream_terminate_connection(srv_conn, "denied by access rules"); return; } + srv_conn->event.fde = tevent_add_fd(ev, srv_conn, socket_get_fd(sock), + 0, stream_io_handler_fde, srv_conn); + if (!srv_conn->event.fde) { + stream_terminate_connection(srv_conn, "tevent_add_fd() failed"); + return; + } + /* setup to receive internal messages on this connection */ srv_conn->msg_ctx = messaging_init(srv_conn, lp_messaging_path(srv_conn, lp_ctx), @@ -214,7 +224,7 @@ static void stream_new_connection(struct tevent_context *ev, talloc_free(s); /* we're now ready to start receiving events on this stream */ - EVENT_FD_READABLE(srv_conn->event.fde); + TEVENT_FD_READABLE(srv_conn->event.fde); /* call the server specific accept code */ stream_socket->ops->accept_connection(srv_conn); diff --git a/source4/smbd/service_task.c b/source4/smbd/service_task.c index 34ce755b93..d3951a4a9a 100644 --- a/source4/smbd/service_task.c +++ b/source4/smbd/service_task.c @@ -21,7 +21,6 @@ #include "includes.h" #include "process_model.h" -#include "lib/events/events.h" #include "smbd/service.h" #include "smbd/service_task.h" #include "lib/messaging/irpc.h" -- cgit From f9cb82d547ec6fd05c8c5196016ed8f33dc8b300 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 4 Jan 2009 17:57:40 +0100 Subject: s4:build: add SMB_MAKE_SETTINGS() macro metze --- source4/build/m4/public.m4 | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source4') diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4 index 5be4189e06..e51a8ac146 100644 --- a/source4/build/m4/public.m4 +++ b/source4/build/m4/public.m4 @@ -155,6 +155,14 @@ SMB_INFO_ENABLES="$SMB_INFO_ENABLES \$enabled{$1} = \"$2\";" ]) +dnl SMB_MAKE_SETTINGS(text) +AC_DEFUN([SMB_MAKE_SETTINGS], +[ +MAKE_SETTINGS="$MAKE_SETTINGS +$1 +" +]) + dnl SMB_WRITE_MAKEVARS(path, skip_vars) AC_DEFUN([SMB_WRITE_MAKEVARS], [ -- cgit From 033428d7da12a6ddc741aa6c70c65eca57b6d182 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 4 Jan 2009 17:58:56 +0100 Subject: tevent: move samba4 stuff from libtevent.m4 to samba.m4 metze --- source4/configure.ac | 7 +------ source4/ntvfs/posix/config.m4 | 3 +-- source4/ntvfs/posix/config.mk | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'source4') diff --git a/source4/configure.ac b/source4/configure.ac index 4ce55c82ba..6c8fb0efc2 100644 --- a/source4/configure.ac +++ b/source4/configure.ac @@ -61,12 +61,7 @@ SMB_EXT_LIB_FROM_PKGCONFIG(LIBTDB, tdb >= 1.1.3, SMB_INCLUDE_MK(../lib/tdb/python.mk) SMB_EXT_LIB_FROM_PKGCONFIG(LIBTEVENT, tevent >= 0.9.2, - [], - [ - m4_include(../lib/tevent/libtevent.m4) - SMB_INCLUDE_MK(../lib/tevent/config.mk) - AC_CONFIG_FILES(../lib/tevent/tevent.pc) - ] + [],[m4_include(../lib/tevent/samba.m4)] ) SMB_INCLUDE_MK(../lib/tevent/python.mk) diff --git a/source4/ntvfs/posix/config.m4 b/source4/ntvfs/posix/config.m4 index fe1997b437..a6f79dfbb3 100644 --- a/source4/ntvfs/posix/config.m4 +++ b/source4/ntvfs/posix/config.m4 @@ -30,8 +30,7 @@ if test x"$ac_cv_func_ext_blkid_get_cache" = x"yes"; then SMB_ENABLE(BLKID,YES) fi -AC_CHECK_HEADERS(libaio.h) SMB_ENABLE(pvfs_aio,NO) -if test x"$ac_cv_header_libaio_h" = x"yes"; then +if test x"$tevent_cv_aio_support" = x"yes"; then SMB_ENABLE(pvfs_aio,YES) fi diff --git a/source4/ntvfs/posix/config.mk b/source4/ntvfs/posix/config.mk index ec1cdf3659..1d7949214a 100644 --- a/source4/ntvfs/posix/config.mk +++ b/source4/ntvfs/posix/config.mk @@ -29,7 +29,7 @@ pvfs_acl_nfs4_OBJ_FILES = $(ntvfssrcdir)/posix/pvfs_acl_nfs4.o ################################################ [SUBSYSTEM::pvfs_aio] -PRIVATE_DEPENDENCIES = LIBTEVENT LIBAIO_LINUX +PRIVATE_DEPENDENCIES = LIBTEVENT LIBTEVENT_EXT ################################################ pvfs_aio_OBJ_FILES = $(ntvfssrcdir)/posix/pvfs_aio.o -- cgit