metze/samba/wip.git
11 years agoHACK tevent_standard no fallback
Stefan Metzmacher [Wed, 20 Feb 2013 15:45:29 +0000 (16:45 +0100)]
HACK tevent_standard no fallback

11 years agoRevert "HACK tevent_standard no epoll"
Stefan Metzmacher [Thu, 21 Feb 2013 07:41:29 +0000 (08:41 +0100)]
Revert "HACK tevent_standard no epoll"

This reverts commit db830ce72e82372fcd5b40a126eaade9d31cdbf8.

11 years agoHACK tevent_standard no epoll
Stefan Metzmacher [Thu, 21 Feb 2013 07:41:13 +0000 (08:41 +0100)]
HACK tevent_standard no epoll

11 years agotevent: change version to 0.9.18
Stefan Metzmacher [Fri, 30 Nov 2012 08:43:23 +0000 (09:43 +0100)]
tevent: change version to 0.9.18

This release contains a lot of fixes:

- Adding new timer events is now faster, if there's
  a large number of timer events.

- sigprocmask does not work on FreeBSD to stop further signals in a signal
  handler.

- TEVENT_NUM_SIGNALS is calculated by configure in order
  to support realtime signals on freebsd.

- ./configure --disable-python was fixed for the standalone build.

- Several crash bugs in the poll backend are fixed.

- The poll backend removes deleted events from the
  cached pollfd array now.

- The poll doesn't pass pollfd.events == 0 to poll()
  and maintains a list of disabled events,
  instead of consuming 100% cpu and/or triggering
  the callers handler.

- The poll backend detects POLLNVAL and reports EBADF
  instead of consuming 100% cpu.

- The select backend supports separate handlers
  for TEVENT_FD_READ and TEVENT_FD_WRITE.

- The poll and select backends are now doing fair
  queuing of fd events.

- The epoll has better error checking
  and supports separate handlers
  for TEVENT_FD_READ and TEVENT_FD_WRITE.

- The standard backend was rewritten to be a tiny
  wrapper on top of epoll with a fallback to poll,
  which means that it doesn't use select directly anymore.

- TEVENT_TRACE_BEFORE_LOOP_ONCE and TEVENT_TRACE_AFTER_LOOP_ONCE
  are added in order to allow the application to hook in
  before and after the loop_once() backend function is called.
  The TEVENT_HAS_LOOP_ONCE_TRACE_POINTS define can be used to
  detect the new feature.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: optimize adding new zero timer events
Stefan Metzmacher [Fri, 22 Feb 2013 11:45:39 +0000 (12:45 +0100)]
tevent: optimize adding new zero timer events

Such events were used before we had immediate events.
It's likely that there're a lot of this events
and we need to add new ones in fifo order.

The tricky part is that tevent_common_add_timer()
should not use the optimization as it's used
by broken Samba versions, which don't use
tevent_common_loop_timer_delay() in source3/lib/events.c.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: optimize adding new timer events
Stefan Metzmacher [Fri, 22 Feb 2013 11:45:39 +0000 (12:45 +0100)]
tevent: optimize adding new timer events

As new timestamps typically get higher:-)
it's better to traverse the existing list from
the tail.

This is not completely optimal, but it should be better
than before.

A second optimization could be done for zero timestamps,
we would just remember the last_zero_timer,
but that would change the internal ABI.
Normally thatshould not be a poblem, but the Samba's
source3/lib/events.c abuses tevent_internal.h
from the current source tree, even if an external tevent.h
is used. The other problem is that it makes use of
tevent_common_add_timer() without using
tevent_common_loop_timer_delay().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: add a debug message in tevent_common_loop_timer_delay()
Stefan Metzmacher [Fri, 1 Mar 2013 08:25:32 +0000 (09:25 +0100)]
tevent: add a debug message in tevent_common_loop_timer_delay()

We should debug a message before and after running the handler.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: add test_event_fd2()
Stefan Metzmacher [Wed, 27 Feb 2013 15:43:44 +0000 (16:43 +0100)]
tevent: add test_event_fd2()

This test fills the socket kernel buffers
and verifies that we don't report TEVENT_FD_WRITE
if the buffer is full.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: add test_event_fd1()
Stefan Metzmacher [Fri, 22 Feb 2013 20:48:44 +0000 (21:48 +0100)]
tevent: add test_event_fd1()

This test verifies that TEVENT_FD_* flags are handled correctly.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: use better names for the subtests
Stefan Metzmacher [Thu, 28 Feb 2013 09:12:42 +0000 (10:12 +0100)]
tevent: use better names for the subtests

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: Regression test to ensure that a tevent backend can cope with separate read...
Jeremy Allison [Thu, 14 Feb 2013 22:16:31 +0000 (14:16 -0800)]
tevent: Regression test to ensure that a tevent backend can cope with separate read/write events on a single fd.

This tests the multiplex fd changes to the epoll backend to
ensure they work correctly.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: use DEBUG_ERROR for the fallback message in epoll_panic()
Stefan Metzmacher [Fri, 1 Mar 2013 13:30:54 +0000 (14:30 +0100)]
tevent: use DEBUG_ERROR for the fallback message in epoll_panic()

A Samba autobuild passed without a fallback, so this is
really an error.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: If epoll_ctl(..EPOLL_CTL_ADD,..) failes with EEXIST, merge the two fde's...
Jeremy Allison [Thu, 14 Feb 2013 21:52:41 +0000 (13:52 -0800)]
tevent: If epoll_ctl(..EPOLL_CTL_ADD,..) failes with EEXIST, merge the two fde's into one epoll event.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: preferr the write handler in there're two possible handlers registered with...
Stefan Metzmacher [Wed, 20 Feb 2013 10:50:56 +0000 (11:50 +0100)]
tevent: preferr the write handler in there're two possible handlers registered with epoll

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: In epoll_event_loop() ensure we trigger the right handler for a multiplexed...
Stefan Metzmacher [Wed, 20 Feb 2013 13:49:17 +0000 (14:49 +0100)]
tevent: In epoll_event_loop() ensure we trigger the right handler for a multiplexed fde event.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: Add utility function epoll_handle_hup_or_err()
Jeremy Allison [Thu, 14 Feb 2013 23:53:38 +0000 (15:53 -0800)]
tevent: Add utility function epoll_handle_hup_or_err()

We'll use this to handle the EPOLL_ADDITIONAL_FD_FLAG_GOT_ERROR
and EPOLL_ADDITIONAL_FD_FLAG_REPORT_ERROR flags with multiplexed
events in the event loop.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: handle EPOLL_ADDITIONAL_FD_FLAG_HAS_MPX in epoll_update_event()
Stefan Metzmacher [Wed, 20 Feb 2013 16:17:31 +0000 (17:17 +0100)]
tevent: handle EPOLL_ADDITIONAL_FD_FLAG_HAS_MPX in epoll_update_event()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: handle multiplexed fde's in epoll_event_fd_destructor()
Stefan Metzmacher [Wed, 20 Feb 2013 17:01:57 +0000 (18:01 +0100)]
tevent: handle multiplexed fde's in epoll_event_fd_destructor()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: Fix epoll_mod_event() to cope with modifying a multiplexed fde event.
Stefan Metzmacher [Fri, 1 Mar 2013 12:57:05 +0000 (13:57 +0100)]
tevent: Fix epoll_mod_event() to cope with modifying a multiplexed fde event.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: Fix up epoll_del_event to cope with deleting a multiplexed fde event.
Jeremy Allison [Fri, 15 Feb 2013 18:16:44 +0000 (10:16 -0800)]
tevent: Fix up epoll_del_event to cope with deleting a multiplexed fde event.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: handle multiplexed fde's in epoll_add_event()
Stefan Metzmacher [Wed, 20 Feb 2013 16:14:52 +0000 (17:14 +0100)]
tevent: handle multiplexed fde's in epoll_add_event()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: Start to fix the epoll backend to support 2 fd events on the same fd correctly.
Jeremy Allison [Thu, 14 Feb 2013 21:50:56 +0000 (13:50 -0800)]
tevent: Start to fix the epoll backend to support 2 fd events on the same fd correctly.

Add a utility function epoll_add_multiplex_fd() and
a new flag EPOLL_ADDITIONAL_FD_FLAG_HAS_MPX.

This will be called by epoll_add_event() to merge two
fde events with the same file descriptor.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: ignore EBADF from epoll_ctl() and disable the event
Stefan Metzmacher [Wed, 20 Feb 2013 12:33:19 +0000 (13:33 +0100)]
tevent: ignore EBADF from epoll_ctl() and disable the event

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: unify handling of HAS_EVENT and REPORT_ERROR in epoll_{add,mod,del}_event()
Stefan Metzmacher [Wed, 20 Feb 2013 16:38:10 +0000 (17:38 +0100)]
tevent: unify handling of HAS_EVENT and REPORT_ERROR in epoll_{add,mod,del}_event()

epoll_{add,mod,del}_event() are only called via epoll_update_event()
and epoll_update_event() should not remove REPORT_ERROR itself.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: always go through epoll_change_event()
Stefan Metzmacher [Wed, 20 Feb 2013 10:26:00 +0000 (11:26 +0100)]
tevent: always go through epoll_change_event()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: s/epoll_change_event/epoll_update_event
Stefan Metzmacher [Wed, 20 Feb 2013 11:55:11 +0000 (12:55 +0100)]
tevent: s/epoll_change_event/epoll_update_event

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: the content of event is ignored by EPOLL_CTL_DEL
Stefan Metzmacher [Wed, 20 Feb 2013 16:15:52 +0000 (17:15 +0100)]
tevent: the content of event is ignored by EPOLL_CTL_DEL

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: call epoll_panic() if EPOLL_CTL_DEL failed
Stefan Metzmacher [Fri, 15 Feb 2013 09:31:36 +0000 (10:31 +0100)]
tevent: call epoll_panic() if EPOLL_CTL_DEL failed

Only ENOENT is ignored as it is no error.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: use helper variables to hold the epoll_ctl() result
Stefan Metzmacher [Wed, 20 Feb 2013 12:12:27 +0000 (13:12 +0100)]
tevent: use helper variables to hold the epoll_ctl() result

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: remove unused if (epoll_ev->epoll_fd == -1) return; checks
Stefan Metzmacher [Wed, 20 Feb 2013 12:07:34 +0000 (13:07 +0100)]
tevent: remove unused if (epoll_ev->epoll_fd == -1) return; checks

We'll never leave epoll_check_reopen() with epoll_fd == -1.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: add std_event_loop_wait()
Stefan Metzmacher [Sun, 17 Feb 2013 15:41:41 +0000 (16:41 +0100)]
tevent: add std_event_loop_wait()

We also need to fallback in tevent_loop_wait()
otherwise we might miss events in the poll->fresh list.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: don't call TALLOC_FREE(ev->additional_data) in std_fallback_to_poll()
Stefan Metzmacher [Sun, 17 Feb 2013 15:40:20 +0000 (16:40 +0100)]
tevent: don't call TALLOC_FREE(ev->additional_data) in std_fallback_to_poll()

The epoll backend has done the cleanup already.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: avoid any operation on epoll_ev after a epoll_panic()
Stefan Metzmacher [Fri, 15 Feb 2013 15:33:56 +0000 (16:33 +0100)]
tevent: avoid any operation on epoll_ev after a epoll_panic()

This calls TALLOC_FREE(ev->additional_data), which is epoll_ev
within epoll_panic() before calling the fallback handler.

In order to notice that a epoll_panic() happened, a caller can
register a pointer to a bool variable under epoll_ev->panic_state.

As epoll_check_reopen() can fail due to a epoll_panic(),
we need to force the replay flag if we have called any event handler.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: add epoll_{create,ctl}_panic_fallback() for testing
Stefan Metzmacher [Fri, 15 Feb 2013 11:10:26 +0000 (12:10 +0100)]
tevent: add epoll_{create,ctl}_panic_fallback() for testing

This makes sure we only do random panics if a fallback handler
is registered.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: use DLIST_DEMOTE() before calling on fde handler after select() and poll()
Stefan Metzmacher [Thu, 21 Feb 2013 14:44:30 +0000 (15:44 +0100)]
tevent: use DLIST_DEMOTE() before calling on fde handler after select() and poll()

This makes sure we don't preferr events which are at the beginning
of the list.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: debug a FATAL message on EBADF from the select backend
Stefan Metzmacher [Thu, 28 Feb 2013 13:43:55 +0000 (14:43 +0100)]
tevent: debug a FATAL message on EBADF from the select backend

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: Fix multiple handler on the same fd bug in the tevent select backend.
Jeremy Allison [Wed, 27 Feb 2013 18:18:44 +0000 (10:18 -0800)]
tevent: Fix multiple handler on the same fd bug in the tevent select backend.

When we're deciding what handlers to call in the select backend,
we didn't take into account the fact that the same fd may have
been added into the read FD_SET and the write FD_SET but with
different handlers.

We must match on both the file descriptor and the flags requested
before calling the handler.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: revalidate fde->flags after poll()
Stefan Metzmacher [Fri, 1 Mar 2013 15:43:35 +0000 (16:43 +0100)]
tevent: revalidate fde->flags after poll()

This is important to avoid races between threads if the poll_mt
backend is used.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: ignore POLLNVAL from poll() and disable the event
Stefan Metzmacher [Fri, 22 Feb 2013 20:45:11 +0000 (21:45 +0100)]
tevent: ignore POLLNVAL from poll() and disable the event

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: traverse the ev->fd_event list instead of the poll_ev->fds array
Stefan Metzmacher [Thu, 21 Feb 2013 14:41:17 +0000 (15:41 +0100)]
tevent: traverse the ev->fd_event list instead of the poll_ev->fds array

That has the same complexity but simplifies the code.

It also seems to fix a real problem, which was found
by the following test failure in Samba's autobuild,
while removing the epoll support from the "standard" backend.

    [402/1555 in 19m8s] samba3.raw.composite(plugin_s4_dc)
    smbtorture 4.1.0pre1-DEVELOPERBUILD
    Using seed 1361531675
    Testing savefile
    Testing parallel fetchfile with 10 ops
    waiting for completion
    maximum runtime exceeded for smbtorture - terminating
    UNEXPECTED(error): samba3.raw.composite.fetchfile (subunit.RemotedTestCase)(plugin_s4_dc)
    REASON: _StringException: _StringException: was started but never finished!
    UNEXPECTED(error): samba3.raw.composite.fetchfile(plugin_s4_dc) (subunit.RemotedTestCase)
    REASON: was started but never finished!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: maintain a list of disabled events in the poll backend
Stefan Metzmacher [Thu, 28 Feb 2013 16:07:28 +0000 (17:07 +0100)]
tevent: maintain a list of disabled events in the poll backend

We need to avoid passing pollfd.events == 0, to poll(),
as it will report POLLERR and POLLHUP events, but our caller
does not expect the event handler to be called.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: merge poll_fresh_fde_destructor() into poll_event_fd_destructor()
Stefan Metzmacher [Thu, 28 Feb 2013 16:04:00 +0000 (17:04 +0100)]
tevent: merge poll_fresh_fde_destructor() into poll_event_fd_destructor()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: use tevent_poll_event_add_fd_internal() in poll_event_add_fd()
Stefan Metzmacher [Thu, 28 Feb 2013 16:02:45 +0000 (17:02 +0100)]
tevent: use tevent_poll_event_add_fd_internal() in poll_event_add_fd()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: make sure we cleanup the array passed to poll() after deleting an event
Stefan Metzmacher [Thu, 21 Feb 2013 13:41:24 +0000 (14:41 +0100)]
tevent: make sure we cleanup the array passed to poll() after deleting an event

If we don't cleanup the array passed to poll after an
event was deleted, we may pass a bad file descriptor to poll().

This was found by the following test failure in Samba's
autobuild, while removing the epoll support from
the "standard" backend.

    [48/1555 in 4m37s] samba3.smbtorture_s3.plain(s3dc).LOCK4
    UNEXPECTED(failure): samba3.smbtorture_s3.plain(s3dc).LOCK4.smbtorture(s3dc)
    REASON: _StringException: _StringException: using seed 1361530718
    host=127.0.0.2 share=tmp user=metze myname=sn-devel-104
    Running LOCK4
    starting locktest4
    Failed to create file: NT_STATUS_INVALID_HANDLE
    finished locktest4
    TEST LOCK4 FAILED!
    LOCK4 took 190.492 secs

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: don't skip a fd event if the previous one was deleted during poll()
Stefan Metzmacher [Sun, 17 Feb 2013 22:21:28 +0000 (23:21 +0100)]
tevent: don't skip a fd event if the previous one was deleted during poll()

In a threaded environment it can happen that an tevent_fd is talloc_free'ed
while the main thread sleeps in the poll() syscall.

In such a case poll_event_fd_destructor() would set poll_ev->fdes[i] = NULL.

We then skip the removed event, but before we also skipped the one
that was located at the end of the array. We moved it to possition
'i', but the next loop uses 'i=i+1'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: remember the errno from select(), poll() and epoll_wait()
Stefan Metzmacher [Fri, 15 Feb 2013 10:24:59 +0000 (11:24 +0100)]
tevent: remember the errno from select(), poll() and epoll_wait()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: add trace points BEFORE_LOOP_ONCE and AFTER_LOOP_ONCE
Michael Adam [Tue, 26 Feb 2013 14:54:57 +0000 (15:54 +0100)]
tevent: add trace points BEFORE_LOOP_ONCE and AFTER_LOOP_ONCE

The define TEVENT_HAS_LOOP_ONCE_TRACE_POINTS can be used to
detect the new feature, without writing configure tests.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: fix compiler warning in tevent_context_init_byname()
Stefan Metzmacher [Sun, 17 Feb 2013 15:36:25 +0000 (16:36 +0100)]
tevent: fix compiler warning in tevent_context_init_byname()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: fix some compiler warnings in testsuite.c
Stefan Metzmacher [Fri, 22 Feb 2013 20:48:11 +0000 (21:48 +0100)]
tevent: fix some compiler warnings in testsuite.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: fix a comment typo in tevent_epoll.c
Michael Adam [Tue, 26 Feb 2013 14:51:38 +0000 (15:51 +0100)]
tevent: fix a comment typo in tevent_epoll.c

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: fix --disable-python cause configure fails (bug #8718)
Galen.Liu [Mon, 4 Feb 2013 06:43:01 +0000 (07:43 +0100)]
tevent: fix --disable-python cause configure fails (bug #8718)

When we disable python, it will cause build fail!
so, the patch will fix it.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotevent: define TEVENT_NUM_SIGNALS based on configure checks
Stefan Metzmacher [Fri, 22 Feb 2013 13:26:16 +0000 (14:26 +0100)]
tevent: define TEVENT_NUM_SIGNALS based on configure checks

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agolib/replace: add AC_CHECK_VALUEOF() macro
Stefan Metzmacher [Fri, 22 Feb 2013 13:53:07 +0000 (14:53 +0100)]
lib/replace: add AC_CHECK_VALUEOF() macro

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agowafsamba: add CHECK_VALUEOF() helper
Stefan Metzmacher [Fri, 22 Feb 2013 13:20:07 +0000 (14:20 +0100)]
wafsamba: add CHECK_VALUEOF() helper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agos3:lib/events: make use of tevent_common_loop_timer_delay()
Stefan Metzmacher [Fri, 1 Mar 2013 08:27:29 +0000 (09:27 +0100)]
s3:lib/events: make use of tevent_common_loop_timer_delay()

This is critical as we also use tevent_common_add_timer().
And if the common code does internal changes, it may affects
both tevent_common_add_timer() and tevent_common_loop_timer_delay()
together!

Without this we rely on a specific behavior and version of
tevent.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
11 years agoFix bug # 9666 - Broken filtering of link-local addresses.
Timur Bakeyev [Thu, 28 Feb 2013 00:25:07 +0000 (16:25 -0800)]
Fix bug # 9666 - Broken filtering of link-local addresses.

This patch should address the problem with Link Local addresses
on FreeBSD and Linux.

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 28 20:56:57 CET 2013 on sn-devel-104

11 years agos3:pylibsmb: make sure we get tevent debug messages
Stefan Metzmacher [Thu, 21 Feb 2013 07:29:18 +0000 (08:29 +0100)]
s3:pylibsmb: make sure we get tevent debug messages

Pair-Programmed-With: Michael Adam <obnox@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Feb 28 14:34:24 CET 2013 on sn-devel-104

11 years agos3:lib/events: make use of samba_tevent_set_debug()
Stefan Metzmacher [Thu, 21 Feb 2013 07:39:05 +0000 (08:39 +0100)]
s3:lib/events: make use of samba_tevent_set_debug()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos4:lib/events: make use of samba_tevent_set_debug()
Stefan Metzmacher [Thu, 21 Feb 2013 07:35:50 +0000 (08:35 +0100)]
s4:lib/events: make use of samba_tevent_set_debug()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agolib/util: add samba_tevent_set_debug()
Stefan Metzmacher [Thu, 21 Feb 2013 08:00:56 +0000 (09:00 +0100)]
lib/util: add samba_tevent_set_debug()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agolib/util: allow samba_tevent_debug() to take a name as context
Stefan Metzmacher [Thu, 21 Feb 2013 07:23:42 +0000 (08:23 +0100)]
lib/util: allow samba_tevent_debug() to take a name as context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agoauth/pycredentials: make use of samba_tevent_context_init()
Stefan Metzmacher [Thu, 21 Feb 2013 07:32:35 +0000 (08:32 +0100)]
auth/pycredentials: make use of samba_tevent_context_init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos4:pyregistry: make use of samba_tevent_context_init()
Stefan Metzmacher [Thu, 21 Feb 2013 07:31:41 +0000 (08:31 +0100)]
s4:pyregistry: make use of samba_tevent_context_init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos4:pygensec: make use of samba_tevent_context_init()
Stefan Metzmacher [Thu, 21 Feb 2013 07:30:51 +0000 (08:30 +0100)]
s4:pygensec: make use of samba_tevent_context_init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:lib/events: add missing TEVENT_TRACE_BEFORE/AFTER_WAIT handling
Stefan Metzmacher [Thu, 28 Feb 2013 09:54:21 +0000 (10:54 +0100)]
s3:lib/events: add missing TEVENT_TRACE_BEFORE/AFTER_WAIT handling

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos4:winbindd: fix spacing and line length in cmd_getpwnam_recv_domain()
Michael Adam [Wed, 27 Feb 2013 00:28:51 +0000 (01:28 +0100)]
s4:winbindd: fix spacing and line length in cmd_getpwnam_recv_domain()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 28 03:54:41 CET 2013 on sn-devel-104

11 years agos3:smbd: fix missing space in debug message in initial_break_processing()
Michael Adam [Tue, 26 Feb 2013 08:39:17 +0000 (09:39 +0100)]
s3:smbd: fix missing space in debug message in initial_break_processing()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
11 years agobuild: Do not force a specific perl from ${PERL} when running pod2man
Andrew Bartlett [Thu, 7 Feb 2013 22:12:20 +0000 (09:12 +1100)]
build: Do not force a specific perl from ${PERL} when running pod2man

pod2man should have the right #!/usr/bin/perl line already, and forcing it may
cause us to use the wrong perl.

Essentially treat this like any other system binary, rather than forcing
it to use the first perl we found.

This essentially reverts e80f576db66ad04592ac436ed74ceb9b96452060.
Current SLES11 does not seem to have the issue this was added to
address.

Andrew Bartlett

Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Feb 28 02:14:25 CET 2013 on sn-devel-104

11 years agoFix bug #9039 'map untrusted to domain' treats WORKSTATION as bogus domain.
Daniel Kobras [Sat, 23 Feb 2013 00:24:26 +0000 (16:24 -0800)]
Fix bug #9039 'map untrusted to domain' treats WORKSTATION as bogus domain.

s3: never try to map global SAM name

Do not treat the global SAM name as a BOGUS domain, and exempt
local users from mapping, instead. This change reinstates the
exact mapping behaviour of Samba 3.2 if parameter 'map untrusted
to domain' is set.

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agoMake sure that domain joins work correctly when the DC disallows NTLM auth.
Richard Sharpe [Wed, 27 Feb 2013 04:22:05 +0000 (20:22 -0800)]
Make sure that domain joins work correctly when the DC disallows NTLM auth.

Signed-Off-By: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-By: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Feb 27 21:49:25 CET 2013 on sn-devel-104

11 years agos4:winbindd: do not drop the workgroup name in the getgrgid call
Michael Adam [Wed, 27 Feb 2013 00:04:46 +0000 (01:04 +0100)]
s4:winbindd: do not drop the workgroup name in the getgrgid call

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Feb 27 05:44:39 CET 2013 on sn-devel-104

11 years agos4:winbindd: do not drop the workgroup name in the getgrnam and getgrent calls.
Michael Adam [Tue, 26 Feb 2013 23:45:55 +0000 (00:45 +0100)]
s4:winbindd: do not drop the workgroup name in the getgrnam and getgrent calls.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
11 years agoFix bug #9674 - Samba denies owner Read Control when there is a DENY entry while...
Richard Sharpe [Sat, 23 Feb 2013 16:41:27 +0000 (08:41 -0800)]
Fix bug #9674 - Samba denies owner Read Control when there is a DENY entry while W2K08 does not.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Feb 23 19:28:15 CET 2013 on sn-devel-104

11 years agoMake systemctl reference indirect in packaging/NetworkManager/30-winbind-systemd
Alexander Bokovoy [Fri, 22 Feb 2013 10:07:19 +0000 (12:07 +0200)]
Make systemctl reference indirect in packaging/NetworkManager/30-winbind-systemd

Some distributions have clever dependency generators when building packages
and generate dependencies for each executable called out in shell scripts.
The end result is that a package built out of samba would contain explicit dependency
to systemd even though it is usable without systemd.

Making systemctl reference indirect avoids explicit dependency.

Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Fri Feb 22 18:18:20 CET 2013 on sn-devel-104

11 years agos3-rpc_server: Make sure that fd is really closed on error.
Andreas Schneider [Wed, 20 Feb 2013 09:52:37 +0000 (10:52 +0100)]
s3-rpc_server: Make sure that fd is really closed on error.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agolib-util: Don't leak file descriptor on error.
Andreas Schneider [Wed, 20 Feb 2013 09:48:05 +0000 (10:48 +0100)]
lib-util: Don't leak file descriptor on error.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos3-vfs: Don't leak file descriptor on error.
Andreas Schneider [Wed, 20 Feb 2013 09:45:06 +0000 (10:45 +0100)]
s3-vfs: Don't leak file descriptor on error.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos4-lib: Don't leak plugin handle on error.
Andreas Schneider [Wed, 20 Feb 2013 09:42:54 +0000 (10:42 +0100)]
s4-lib: Don't leak plugin handle on error.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos3-libsmb: Don't leak memory on error.
Andreas Schneider [Wed, 20 Feb 2013 09:38:13 +0000 (10:38 +0100)]
s3-libsmb: Don't leak memory on error.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agondrdump: Don't leak plugin handle on error.
Andreas Schneider [Wed, 20 Feb 2013 09:36:52 +0000 (10:36 +0100)]
ndrdump: Don't leak plugin handle on error.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agosmbpasswd: Don't leak memory.
Andreas Schneider [Wed, 20 Feb 2013 09:25:55 +0000 (10:25 +0100)]
smbpasswd: Don't leak memory.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agosmbget: Fix file descriptor leak.
Andreas Schneider [Wed, 20 Feb 2013 09:23:45 +0000 (10:23 +0100)]
smbget: Fix file descriptor leak.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos4-policy: Fix memory leaks in push_recursive().
Andreas Schneider [Wed, 20 Feb 2013 09:22:00 +0000 (10:22 +0100)]
s4-policy: Fix memory leaks in push_recursive().
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos4-cifsdd: Don't leak memory.
Andreas Schneider [Wed, 20 Feb 2013 09:09:20 +0000 (10:09 +0100)]
s4-cifsdd: Don't leak memory.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos4-registry: Don't leak file descriptor.
Andreas Schneider [Wed, 20 Feb 2013 09:10:15 +0000 (10:10 +0100)]
s4-registry: Don't leak file descriptor.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos4-registry: Don't leak memory on error.
Andreas Schneider [Wed, 20 Feb 2013 09:03:13 +0000 (10:03 +0100)]
s4-registry: Don't leak memory on error.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agowinbind: Don't leak centry memory.
Andreas Schneider [Wed, 20 Feb 2013 08:51:43 +0000 (09:51 +0100)]
winbind: Don't leak centry memory.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos4-client: Don't leak memory.
Andreas Schneider [Wed, 20 Feb 2013 08:48:59 +0000 (09:48 +0100)]
s4-client: Don't leak memory.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos3-torture: Don't leak memory.
Andreas Schneider [Wed, 20 Feb 2013 08:47:19 +0000 (09:47 +0100)]
s3-torture: Don't leak memory.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agowbinfo: Fix several memory leaks.
Andreas Schneider [Wed, 20 Feb 2013 08:43:44 +0000 (09:43 +0100)]
wbinfo: Fix several memory leaks.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agowinbind: Don't leak memory on return.
Andreas Schneider [Wed, 20 Feb 2013 08:41:55 +0000 (09:41 +0100)]
winbind: Don't leak memory on return.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos3-smbd: Don't leak subcntarr array.
Andreas Schneider [Wed, 20 Feb 2013 08:31:17 +0000 (09:31 +0100)]
s3-smbd: Don't leak subcntarr array.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agotorture: Don't leak file resource handle in spoolss test.
Andreas Schneider [Wed, 20 Feb 2013 08:26:02 +0000 (09:26 +0100)]
torture: Don't leak file resource handle in spoolss test.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos3-vfs: Don't leak file descriptor.
Andreas Schneider [Wed, 20 Feb 2013 08:16:25 +0000 (09:16 +0100)]
s3-vfs: Don't leak file descriptor.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos3-param: Don't leak file descriptor.
Andreas Schneider [Wed, 20 Feb 2013 08:15:26 +0000 (09:15 +0100)]
s3-param: Don't leak file descriptor.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos3-lsasd: Don't leak file descriptors.
Andreas Schneider [Wed, 20 Feb 2013 08:11:48 +0000 (09:11 +0100)]
s3-lsasd: Don't leak file descriptors.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos3-spoolss: Don't leak memory.
Andreas Schneider [Wed, 20 Feb 2013 08:06:51 +0000 (09:06 +0100)]
s3-spoolss: Don't leak memory.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos3-net: Don't leak username.
Andreas Schneider [Wed, 20 Feb 2013 08:03:17 +0000 (09:03 +0100)]
s3-net: Don't leak username.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos4-client: Don't leak file descriptor.
Andreas Schneider [Wed, 20 Feb 2013 08:23:37 +0000 (09:23 +0100)]
s4-client: Don't leak file descriptor.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos4-client: Don't leak resource handle.
Andreas Schneider [Wed, 20 Feb 2013 07:58:02 +0000 (08:58 +0100)]
s4-client: Don't leak resource handle.
Reviewed-by: Alexander Bokovoy <ab@samba.org>