bbaumbach/samba-autobuild/.git
11 years agontdb: switch between secrets.tdb and secrets.ntdb depending on 'use ntdb'
Rusty Russell [Wed, 20 Feb 2013 04:29:42 +0000 (14:59 +1030)]
ntdb: switch between secrets.tdb and secrets.ntdb depending on 'use ntdb'

Since we open with dbwrap, it auto-converts old tdbs (which it will
rename to secrets.tdb.bak once it's done).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Wed Feb 20 07:09:19 CET 2013 on sn-devel-104

11 years agoparam: 'use ntdb' flag (off by default).
Rusty Russell [Wed, 20 Feb 2013 04:29:42 +0000 (14:59 +1030)]
param: 'use ntdb' flag (off by default).

For simplicity, we use this in the caller to choose between filenames.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
11 years agotdb_wrap: prevent tdbs called ".ntdb" or without extensions.
Rusty Russell [Wed, 20 Feb 2013 04:29:42 +0000 (14:59 +1030)]
tdb_wrap: prevent tdbs called ".ntdb" or without extensions.

This is another belt-and-braces check in case someone decides to turn
on the fancy new .ntdb extension, and we haven't converted it to ntdb.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
11 years agodbwrap_local_open: never open the .tdb if there is an .ntdb
Rusty Russell [Wed, 20 Feb 2013 04:29:42 +0000 (14:59 +1030)]
dbwrap_local_open: never open the .tdb if there is an .ntdb

This provides an extra safety check that everyone is using one or the
other: you can't create a tdb file if there's an ntdb file.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
11 years agodbwrap_local_open: open NTDB if extension is .ntdb
Rusty Russell [Wed, 20 Feb 2013 04:29:42 +0000 (14:59 +1030)]
dbwrap_local_open: open NTDB if extension is .ntdb

This switches dbwrap_local_open() based on the extension of the
database name, so it handles both TDB and NTDB files.

Moreover, if asked to open a .ntdb, and there's no ntdb file but
there's a .tdb file, it converts that then moves it to .tdb.bak before
opening, and turn the .tdb file into a dangling symlink to make sure
it's never accidentally re-created or used:

$ ls -l secrets.tdb
lrwxrwxrwx 1 rusty rusty 23 Feb 11 11:31 secrets.tdb -> This is now in an NTDB

This provides transparent upgrade if people decide to use NTDB on a
database.  Downgrade would be manual, eg:

ntdbdump foo.ntdb | tdbrestore foo.tdb && mv foo.ntdb foo.ntdb.bak

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
11 years agosource3: explicitly disable NTDB support.
Rusty Russell [Wed, 20 Feb 2013 04:29:42 +0000 (14:59 +1030)]
source3: explicitly disable NTDB support.

The next patch make dbwrap_local_open() call the ntdb backend for ntdb
files, but we don't want to add ntdb support to the old autoconf
build.  It's cleaner to use the existing DISABLE_NTDB flag rather than
test for _SAMBA_BUILD_ in dbwrap_local_open.c.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
11 years agodbwrap: dbwrap_ntdb.c
Rusty Russell [Wed, 20 Feb 2013 04:28:59 +0000 (14:58 +1030)]
dbwrap: dbwrap_ntdb.c

This is a dbwrap backend for ntdb.  It's a fairly straight conversion from
the tdb version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
11 years agontdb: fix database corruption when transaction doesn't change anything.
Rusty Russell [Sun, 17 Feb 2013 10:26:34 +0000 (20:56 +1030)]
ntdb: fix database corruption when transaction doesn't change anything.

ntdb's transaction code has an optimization which tdb's doesnt: it
only writes the parts of blocks whose contents have changed.  This
means we can actually have a transaction which turns out to need no
recovery region.

This breaks the recovery setup logic, which sets the current recovery
size to 0 if there's no recovery area, and assumes that we'll always
create a new recovery area since the recovery will always need > 0
bytes.

In fact, if we really haven't changed anything, we can skip the
transaction commit altogether: since this happens at least once with
Samba, it's worth doing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
11 years agos3:selftest: generate ${SELFTESTPREFIX}/subunit with the raw output
Stefan Metzmacher [Fri, 15 Feb 2013 13:29:51 +0000 (14:29 +0100)]
s3:selftest: generate ${SELFTESTPREFIX}/subunit with the raw output

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Feb 20 01:33:50 CET 2013 on sn-devel-104

11 years agos3:torture: call fault_setup() to get usage backtraces
Stefan Metzmacher [Fri, 15 Feb 2013 13:23:50 +0000 (14:23 +0100)]
s3:torture: call fault_setup() to get usage backtraces

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:include: avoid TEVENT_COMPAT_DEFINES
Stefan Metzmacher [Mon, 18 Feb 2013 10:04:18 +0000 (11:04 +0100)]
s3:include: avoid TEVENT_COMPAT_DEFINES

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:lib: s/event_add_timed/tevent_add_timer
Stefan Metzmacher [Mon, 18 Feb 2013 09:57:54 +0000 (10:57 +0100)]
s3:lib: s/event_add_timed/tevent_add_timer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:nmbd: s/event_add_timed/tevent_add_timer
Stefan Metzmacher [Mon, 18 Feb 2013 09:57:54 +0000 (10:57 +0100)]
s3:nmbd: s/event_add_timed/tevent_add_timer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:modules: s/event_add_timed/tevent_add_timer
Stefan Metzmacher [Mon, 18 Feb 2013 09:57:54 +0000 (10:57 +0100)]
s3:modules: s/event_add_timed/tevent_add_timer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:rpc_server: s/event_add_timed/tevent_add_timer
Stefan Metzmacher [Mon, 18 Feb 2013 09:57:54 +0000 (10:57 +0100)]
s3:rpc_server: s/event_add_timed/tevent_add_timer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:winbindd: s/event_add_timed/tevent_add_timer
Stefan Metzmacher [Mon, 18 Feb 2013 09:57:54 +0000 (10:57 +0100)]
s3:winbindd: s/event_add_timed/tevent_add_timer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:lib: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_
Stefan Metzmacher [Mon, 18 Feb 2013 09:53:02 +0000 (10:53 +0100)]
s3:lib: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:printing: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_
Stefan Metzmacher [Mon, 18 Feb 2013 09:53:02 +0000 (10:53 +0100)]
s3:printing: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:smbd: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_
Stefan Metzmacher [Mon, 18 Feb 2013 09:53:02 +0000 (10:53 +0100)]
s3:smbd: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:modules: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_
Stefan Metzmacher [Mon, 18 Feb 2013 09:53:02 +0000 (10:53 +0100)]
s3:modules: s/event_add_fd/tevent_add_fd and s/EVENT_FD_/TEVENT_FD_

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:lib: s/struct fd_event/struct tevent_fd
Stefan Metzmacher [Mon, 18 Feb 2013 09:24:12 +0000 (10:24 +0100)]
s3:lib: s/struct fd_event/struct tevent_fd

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:modules: s/struct fd_event/struct tevent_fd
Stefan Metzmacher [Mon, 18 Feb 2013 09:24:12 +0000 (10:24 +0100)]
s3:modules: s/struct fd_event/struct tevent_fd

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:printing: s/struct fd_event/struct tevent_fd
Stefan Metzmacher [Mon, 18 Feb 2013 09:24:12 +0000 (10:24 +0100)]
s3:printing: s/struct fd_event/struct tevent_fd

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:smbd: s/struct fd_event/struct tevent_fd
Stefan Metzmacher [Mon, 18 Feb 2013 09:24:12 +0000 (10:24 +0100)]
s3:smbd: s/struct fd_event/struct tevent_fd

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:lib: s/struct timed_event/struct tevent_timer
Stefan Metzmacher [Mon, 18 Feb 2013 09:18:29 +0000 (10:18 +0100)]
s3:lib: s/struct timed_event/struct tevent_timer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:nmbd: s/struct timed_event/struct tevent_timer
Stefan Metzmacher [Mon, 18 Feb 2013 09:18:29 +0000 (10:18 +0100)]
s3:nmbd: s/struct timed_event/struct tevent_timer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:modules: s/struct timed_event/struct tevent_timer
Stefan Metzmacher [Mon, 18 Feb 2013 09:18:29 +0000 (10:18 +0100)]
s3:modules: s/struct timed_event/struct tevent_timer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:rpc_server: s/struct timed_event/struct tevent_timer
Stefan Metzmacher [Mon, 18 Feb 2013 09:18:29 +0000 (10:18 +0100)]
s3:rpc_server: s/struct timed_event/struct tevent_timer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:smbd: s/EVENT_FD/TEVENT_FD
Stefan Metzmacher [Mon, 18 Feb 2013 09:18:57 +0000 (10:18 +0100)]
s3:smbd: s/EVENT_FD/TEVENT_FD

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:smbd: s/struct timed_event/struct tevent_timer
Stefan Metzmacher [Mon, 18 Feb 2013 09:18:29 +0000 (10:18 +0100)]
s3:smbd: s/struct timed_event/struct tevent_timer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:winbindd: s/struct timed_event/struct tevent_timer
Stefan Metzmacher [Mon, 18 Feb 2013 09:17:40 +0000 (10:17 +0100)]
s3:winbindd: s/struct timed_event/struct tevent_timer

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:lib/events: s/EVENT_FD/TEVENT_FD
Stefan Metzmacher [Mon, 18 Feb 2013 09:16:48 +0000 (10:16 +0100)]
s3:lib/events: s/EVENT_FD/TEVENT_FD

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:lib: s/struct event_context/struct tevent_context
Stefan Metzmacher [Mon, 18 Feb 2013 09:00:26 +0000 (10:00 +0100)]
s3:lib: s/struct event_context/struct tevent_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:libsmb: s/struct event_context/struct tevent_context
Stefan Metzmacher [Mon, 18 Feb 2013 08:59:58 +0000 (09:59 +0100)]
s3:libsmb: s/struct event_context/struct tevent_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:modules: s/struct event_context/struct tevent_context
Stefan Metzmacher [Mon, 18 Feb 2013 08:59:08 +0000 (09:59 +0100)]
s3:modules: s/struct event_context/struct tevent_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:nmbd: s/struct event_context/struct tevent_context
Stefan Metzmacher [Mon, 18 Feb 2013 08:58:40 +0000 (09:58 +0100)]
s3:nmbd: s/struct event_context/struct tevent_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:printing: s/struct event_context/struct tevent_context
Stefan Metzmacher [Mon, 18 Feb 2013 08:58:10 +0000 (09:58 +0100)]
s3:printing: s/struct event_context/struct tevent_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:rpc_server: s/struct event_context/struct tevent_context
Stefan Metzmacher [Mon, 18 Feb 2013 08:57:48 +0000 (09:57 +0100)]
s3:rpc_server: s/struct event_context/struct tevent_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:rpc_client: s/struct event_context/struct tevent_context
Stefan Metzmacher [Mon, 18 Feb 2013 08:57:22 +0000 (09:57 +0100)]
s3:rpc_client: s/struct event_context/struct tevent_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:smbd: s/struct event_context/struct tevent_context
Stefan Metzmacher [Mon, 18 Feb 2013 08:56:41 +0000 (09:56 +0100)]
s3:smbd: s/struct event_context/struct tevent_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:torture: s/struct event_context/struct tevent_context
Stefan Metzmacher [Mon, 18 Feb 2013 08:55:58 +0000 (09:55 +0100)]
s3:torture: s/struct event_context/struct tevent_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:winbindd: s/struct event_context/struct tevent_context
Stefan Metzmacher [Mon, 18 Feb 2013 08:55:02 +0000 (09:55 +0100)]
s3:winbindd: s/struct event_context/struct tevent_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:includes: remove event_context_init() define for s3_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:21:53 +0000 (09:21 +0100)]
s3:includes: remove event_context_init() define for s3_tevent_context_init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos3:winbindd: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:12:26 +0000 (09:12 +0100)]
s3:winbindd: 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:rpc_client: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:17:45 +0000 (09:17 +0100)]
s3:rpc_client: 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:torture: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:11:19 +0000 (09:11 +0100)]
s3:torture: 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:utils: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:11:52 +0000 (09:11 +0100)]
s3:utils: 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:libnet: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:17:22 +0000 (09:17 +0100)]
s3:libnet: 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: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:10:34 +0000 (09:10 +0100)]
s3:lib: 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:libads: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:09:57 +0000 (09:09 +0100)]
s3:libads: 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:libsmb: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:08:19 +0000 (09:08 +0100)]
s3:libsmb: 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:lib/com: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:13:23 +0000 (09:13 +0100)]
s4:lib/com: 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:auth/kerberos: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:12:58 +0000 (09:12 +0100)]
s4:auth/kerberos: make use of samba_tevent_context_init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agolibrpc/rpc: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:09:31 +0000 (09:09 +0100)]
librpc/rpc: make use of samba_tevent_context_init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agolibcli/smb: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:07:11 +0000 (09:07 +0100)]
libcli/smb: make use of samba_tevent_context_init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agolibcli/cldap: make use of samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 08:06:29 +0000 (09:06 +0100)]
libcli/cldap: make use of samba_tevent_context_init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agolib/util: add samba_tevent_context_init()
Stefan Metzmacher [Mon, 18 Feb 2013 07:54:51 +0000 (08:54 +0100)]
lib/util: add samba_tevent_context_init()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agobuild/autoconf: fix check for GNU ld version
Björn Jacke [Tue, 19 Feb 2013 14:30:34 +0000 (15:30 +0100)]
build/autoconf: fix check for GNU ld version

we need to look for the version once in the stdout and once in the stderr
output. Some version of ld output to stdout, some output to stderr. redirecting
stderr to stdout messes the output up in our case, that's why we have to do two
runs. See also bug #7825.

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Tue Feb 19 20:56:12 CET 2013 on sn-devel-104

11 years agos3:build fix the build with --fake-kaserver
Christian Ambach [Mon, 18 Feb 2013 16:34:25 +0000 (17:34 +0100)]
s3:build fix the build with --fake-kaserver

this fixes Bug 9643 - Build in source3 of bin/net fails when configure option
--with-fake-kaserver is used

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9643

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Feb 19 19:15:19 CET 2013 on sn-devel-104

11 years agos3:lib/afs fix the build
Christian Ambach [Mon, 18 Feb 2013 15:55:30 +0000 (16:55 +0100)]
s3:lib/afs fix the build

Fix Bug 9644 - Compile of source3/lib/afs.c fails

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9644

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
11 years agotdb: Slightly simplify transaction_write
Volker Lendecke [Tue, 19 Feb 2013 11:23:36 +0000 (12:23 +0100)]
tdb: Slightly simplify transaction_write

realloc(NULL, ...) is equivalent to malloc. We are already using this
realloc property for tdb->lockrecs. It should not make any difference
in speed, it just makes for a little simpler code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Feb 19 17:30:13 CET 2013 on sn-devel-104

11 years agotdb: Make tdb_release_transaction_locks use tdb_allrecord_unlock
Volker Lendecke [Sat, 16 Feb 2013 21:08:52 +0000 (22:08 +0100)]
tdb: Make tdb_release_transaction_locks use tdb_allrecord_unlock

The transaction code uses tdb_alrecord_lock/upgrade, so it should also
use the tdb_allrecord_unlock function just for symmetry reasons

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotdb: Don't segfault if tdb_open_ex for check failed
Volker Lendecke [Sat, 16 Feb 2013 21:07:41 +0000 (22:07 +0100)]
tdb: Don't segfault if tdb_open_ex for check failed

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotdb: Factor out the retry loop from tdb_allrecord_upgrade
Volker Lendecke [Sat, 16 Feb 2013 15:49:56 +0000 (16:49 +0100)]
tdb: Factor out the retry loop from tdb_allrecord_upgrade

For the mutex code we will have to lock the hashchain and the record
lock area independently. So we will have to call the loop twice. And,
it's a small refactoring for the better anyway I think.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotdb: Simplify fcntl_lock() a bit
Volker Lendecke [Sat, 16 Feb 2013 13:17:57 +0000 (14:17 +0100)]
tdb: Simplify fcntl_lock() a bit

All arguments but the cmd are the same. To me this looks a bit better
and saves some bytes in the object code.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotdb: Use tdb_null in freelistcheck
Volker Lendecke [Sat, 16 Feb 2013 12:39:28 +0000 (13:39 +0100)]
tdb: Use tdb_null in freelistcheck

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotdb: Enhance lock tracking a bit
Volker Lendecke [Thu, 14 Feb 2013 15:10:31 +0000 (16:10 +0100)]
tdb: Enhance lock tracking a bit

lock-tracking.c mirrors the in-kernel fcntl structures to detect
unexpected use of fcntl calls. During my mutex work I changed our fcntl
use so that we unlock the allrecord_lock in two pieces: The range covering
the hash locks and the range covering the data area for the individual
traverse record locks. Splitting locks is not covered by lock-tracking.c.

This patch extends lock-tracking.c with this little piece. It's still
far from complete to track the full range of fcntl semantics. It is not
strictly needed right now, but it does not hurt either.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos3:smbd: preserve file type mode bits in file_set_dosmode()
Michael Adam [Tue, 19 Feb 2013 12:27:10 +0000 (13:27 +0100)]
s3:smbd: preserve file type mode bits in file_set_dosmode()

When translating between dos modes and unix modes, these bits were dropped from
the stat->st_ex_mode field.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Feb 19 15:45:31 CET 2013 on sn-devel-104

11 years agogencache: fix an extra newline in a DEBUG message in gencache_set_data_blob()
Michael Adam [Wed, 13 Feb 2013 08:46:33 +0000 (09:46 +0100)]
gencache: fix an extra newline in a DEBUG message in gencache_set_data_blob()

by using timestring() instead of ctime()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agogencache: fix an extra newline in a DEBUG message in gencache_iterate_fn()
Michael Adam [Wed, 13 Feb 2013 08:45:09 +0000 (09:45 +0100)]
gencache: fix an extra newline in a DEBUG message in gencache_iterate_fn()

by using timestring() instead of ctime()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agogencache: fix an extra newline in a DEBUG message in gencache_iterate_blobs_fn()
Michael Adam [Wed, 13 Feb 2013 08:43:19 +0000 (09:43 +0100)]
gencache: fix an extra newline in a DEBUG message in gencache_iterate_blobs_fn()

by using timestring() instead of ctime()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agolib/util/time: strip a potential trailing newline in the asctime case.
Michael Adam [Wed, 13 Feb 2013 15:51:54 +0000 (16:51 +0100)]
lib/util/time: strip a potential trailing newline in the asctime case.

If strftime() is not available, asctime() is used, and this usually
appends a newline character to the result. This is not desired for
timestamp().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agogencache: unify a DEBUG message in gencache_set_data_blob()
Michael Adam [Mon, 11 Feb 2013 12:41:12 +0000 (13:41 +0100)]
gencache: unify a DEBUG message in gencache_set_data_blob()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agogencache: unify a DEBUG message in gencache_iterate_fn()
Michael Adam [Mon, 11 Feb 2013 12:42:58 +0000 (13:42 +0100)]
gencache: unify a DEBUG message in gencache_iterate_fn()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agogencache: unify a DEBUG message in gencache_iterate_blobs_fn()
Michael Adam [Mon, 11 Feb 2013 12:42:28 +0000 (13:42 +0100)]
gencache: unify a DEBUG message in gencache_iterate_blobs_fn()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agogencache: unify a DEBUG message in gencache_del()
Michael Adam [Mon, 11 Feb 2013 12:43:32 +0000 (13:43 +0100)]
gencache: unify a DEBUG message in gencache_del()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agopackaging(RHEL-CTDB): remove unpackaged manpages (samba and samba-tool)
Michael Adam [Thu, 25 Oct 2012 09:35:50 +0000 (05:35 -0400)]
packaging(RHEL-CTDB): remove unpackaged manpages (samba and samba-tool)

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agopackaging(RHEL-CTDB): package the fake-acls vfs module
Michael Adam [Thu, 25 Oct 2012 09:34:23 +0000 (05:34 -0400)]
packaging(RHEL-CTDB): package the fake-acls vfs module

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos3:net: new implementation of "servid wipedbs" with smbXsrv_*
Gregor Beck [Thu, 13 Dec 2012 12:00:28 +0000 (13:00 +0100)]
s3:net: new implementation of "servid wipedbs" with smbXsrv_*

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Feb 19 13:56:57 CET 2013 on sn-devel-104

11 years agolib/util_tdb: factor out tdb_data_talloc_copy()
Gregor Beck [Thu, 10 Jan 2013 10:09:09 +0000 (11:09 +0100)]
lib/util_tdb: factor out tdb_data_talloc_copy()

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos3:smbXsrv_open: add smbXsrv_open_global_traverse()
Gregor Beck [Wed, 12 Dec 2012 15:06:50 +0000 (16:06 +0100)]
s3:smbXsrv_open: add smbXsrv_open_global_traverse()

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos3:smbXsrv_tcon: pass record in smbXsrv_tcon_global_traverse()
Gregor Beck [Thu, 13 Dec 2012 14:27:07 +0000 (15:27 +0100)]
s3:smbXsrv_tcon: pass record in smbXsrv_tcon_global_traverse()

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos3:smbXsrv_session: pass record in smbXsrv_session_global_traverse()
Gregor Beck [Thu, 13 Dec 2012 14:26:49 +0000 (15:26 +0100)]
s3:smbXsrv_session: pass record in smbXsrv_session_global_traverse()

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos3:smbd:smb2: fix segfault (access after free) in durable disconnect code
Michael Adam [Mon, 18 Feb 2013 22:21:24 +0000 (23:21 +0100)]
s3:smbd:smb2: fix segfault (access after free) in durable disconnect code

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

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Feb 19 11:12:01 CET 2013 on sn-devel-104

11 years agosamba_upgradeprovision: Use tdb_util.tdb_copy not shutil.copy2
Andrew Bartlett [Sun, 17 Feb 2013 07:15:52 +0000 (18:15 +1100)]
samba_upgradeprovision: Use tdb_util.tdb_copy not shutil.copy2

This is really important, because copying a file will both ignore
locks held by another process and break any locks we hold (due to
POSIX brain-damage regarding multiple fds on one file in a process).

By leaving this to tdbbackup in a child, both of these issues are avoided.

Andrew Bartlett

Reviewed-by: Matthieu Patou <mat@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Feb 19 07:48:18 CET 2013 on sn-devel-104

11 years agosamba_upgradeprovision: Do not update privileges.ldb any more (unchanged since 2009)
Andrew Bartlett [Sun, 17 Feb 2013 07:41:00 +0000 (18:41 +1100)]
samba_upgradeprovision: Do not update privileges.ldb any more (unchanged since 2009)

This update was only a total oblitoration of the existing database
and not a merge, and the shutil.copy would both disregard and break
locks on the database that are held at this point.

Andrew Bartlett

Reviewed-by: Matthieu Patou <mat@samba.org>
11 years agoscripting: Make tdb_copy a common util function in samba.tdb_util
Andrew Bartlett [Sun, 17 Feb 2013 07:14:06 +0000 (18:14 +1100)]
scripting: Make tdb_copy a common util function in samba.tdb_util

This will allow samba_upgradeprovision to also call it.

Andrew Bartlett

Reviewed-by: Matthieu Patou <mat@samba.org>
11 years agoscripting: Make tdb_copy use the python subprocess module
Andrew Bartlett [Sun, 17 Feb 2013 06:57:42 +0000 (17:57 +1100)]
scripting: Make tdb_copy use the python subprocess module

This makes the code more robust to spaces in the file names (etc).

Andrew Bartlett

Reviewed-by: Matthieu Patou <mat@samba.org>
11 years agosamba_upgradeprovision: Remove options to fix FS ACLs
Andrew Bartlett [Fri, 15 Feb 2013 21:51:51 +0000 (08:51 +1100)]
samba_upgradeprovision: Remove options to fix FS ACLs

samba-tool ntacl sysvolreset handles this better, and makes this tool
much less confusing internally.

Andrew Bartlett

Reviewed-by: Matthieu Patou <mat@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Feb 19 06:06:41 CET 2013 on sn-devel-104

11 years agos3:smbd: add debugging to close code (regarding disconnect of a durable)
Michael Adam [Tue, 12 Feb 2013 16:44:51 +0000 (17:44 +0100)]
s3:smbd: add debugging to close code (regarding disconnect of a durable)

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Feb 18 17:42:45 CET 2013 on sn-devel-104

11 years agos4:torture: fix segfault in test_durable_open_open2_oplock()
Stefan Metzmacher [Wed, 13 Feb 2013 13:11:57 +0000 (14:11 +0100)]
s4:torture: fix segfault in test_durable_open_open2_oplock()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
11 years agos4:torture:smb2: fix segfault on error condition in the durable-open.delete_on_close2...
Michael Adam [Wed, 13 Feb 2013 14:05:40 +0000 (15:05 +0100)]
s4:torture:smb2: fix segfault on error condition in the durable-open.delete_on_close2 test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos4:torture:smb2: fix segfault on error condition in the durable-open.delete_on_close1...
Michael Adam [Wed, 13 Feb 2013 14:04:10 +0000 (15:04 +0100)]
s4:torture:smb2: fix segfault on error condition in the durable-open.delete_on_close1 test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos4:torture:smb2: fix segfault on error condition in the durable-open.reopen4 test
Michael Adam [Wed, 13 Feb 2013 14:03:00 +0000 (15:03 +0100)]
s4:torture:smb2: fix segfault on error condition in the durable-open.reopen4 test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos4:torture:smb2: fix segfault on error condition in the durable-open.reopen3 test
Michael Adam [Wed, 13 Feb 2013 14:01:47 +0000 (15:01 +0100)]
s4:torture:smb2: fix segfault on error condition in the durable-open.reopen3 test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos4:torture:smb2: fix segfault on error condition in the durable-open.reopen2a test
Michael Adam [Wed, 13 Feb 2013 14:00:26 +0000 (15:00 +0100)]
s4:torture:smb2: fix segfault on error condition in the durable-open.reopen2a test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos4:torture:smb2: fix segfault on error condition in durable-open.reopen2 test
Michael Adam [Wed, 13 Feb 2013 13:58:29 +0000 (14:58 +0100)]
s4:torture:smb2: fix segfault on error condition in durable-open.reopen2 test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos4:torture:smb2:durable: make test functions static
Michael Adam [Tue, 12 Feb 2013 20:51:06 +0000 (21:51 +0100)]
s4:torture:smb2:durable: make test functions static

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos4:torture: add a durable-open-disconnect test (suite)
Michael Adam [Tue, 12 Feb 2013 16:45:23 +0000 (17:45 +0100)]
s4:torture: add a durable-open-disconnect test (suite)

this opens a durable, disconnects it and exits

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agos3:smbd: use smbXsrv_open_close() instead of smbXsrv_open_update()
Stefan Metzmacher [Wed, 13 Feb 2013 13:26:43 +0000 (08:26 -0500)]
s3:smbd: use smbXsrv_open_close() instead of smbXsrv_open_update()

This makes sure we store the correct disconnect_time for disconnected
durable handles.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>