metze/samba/wip.git
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>
11 years agotorture: Make sure we don't overrun the buffer.
Andreas Schneider [Tue, 19 Feb 2013 17:19:12 +0000 (18:19 +0100)]
torture: Make sure we don't overrun the buffer.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agotorture: Fix memcmp of short buffer.
Andreas Schneider [Tue, 19 Feb 2013 15:02:01 +0000 (16:02 +0100)]
torture: Fix memcmp of short buffer.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agotorture: Fix array access in spoolss test.
Andreas Schneider [Tue, 19 Feb 2013 08:32:30 +0000 (09:32 +0100)]
torture: Fix array access in spoolss test.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agopdb: Fix array overrun by one.
Andreas Schneider [Tue, 19 Feb 2013 08:23:53 +0000 (09:23 +0100)]
pdb: Fix array overrun by one.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos4-libcli: Check return value of smbcli_request_setup().
Andreas Schneider [Tue, 19 Feb 2013 08:00:51 +0000 (09:00 +0100)]
s4-libcli: Check return value of smbcli_request_setup().
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agopyauth: Check return value of lpcfg_from_py_object().
Andreas Schneider [Tue, 19 Feb 2013 07:58:00 +0000 (08:58 +0100)]
pyauth: Check return value of lpcfg_from_py_object().
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agondrdump: Check return value of ndr_pull_init_blob().
Andreas Schneider [Tue, 19 Feb 2013 07:56:22 +0000 (08:56 +0100)]
ndrdump: Check return value of ndr_pull_init_blob().
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos4-libcli: Check return code of smbcli_request_setup().
Andreas Schneider [Mon, 18 Feb 2013 17:00:38 +0000 (18:00 +0100)]
s4-libcli: Check return code of smbcli_request_setup().
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agolibrpc: Add NULL check for ndr functions for epm bindings.
Andreas Schneider [Mon, 18 Feb 2013 16:32:28 +0000 (17:32 +0100)]
librpc: Add NULL check for ndr functions for epm bindings.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos3-tldap: Make sure we don't deref a null pointer.
Andreas Schneider [Mon, 18 Feb 2013 16:30:19 +0000 (17:30 +0100)]
s3-tldap: Make sure we don't deref a null pointer.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agos4-libcli: Add null check for ndr functions in rap.
Andreas Schneider [Mon, 18 Feb 2013 16:26:14 +0000 (17:26 +0100)]
s4-libcli: Add null check for ndr functions in rap.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agonmbd: Fix request data data processing.
Andreas Schneider [Mon, 18 Feb 2013 16:21:31 +0000 (17:21 +0100)]
nmbd: Fix request data data processing.

answers->rdata is an array and will never be NULL.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agotorture: Fix samsync domain_name checks.
Andreas Schneider [Mon, 18 Feb 2013 16:17:19 +0000 (17:17 +0100)]
torture: Fix samsync domain_name checks.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agolibsmb: Fix possible null pointer dereference.
Andreas Schneider [Mon, 18 Feb 2013 16:11:15 +0000 (17:11 +0100)]
libsmb: Fix possible null pointer dereference.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agondr: Comparing an array to null is always true.
Andreas Schneider [Mon, 18 Feb 2013 16:08:21 +0000 (17:08 +0100)]
ndr: Comparing an array to null is always true.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agowinbind: Correctly cast name to messaging_send_buf().
Andreas Schneider [Mon, 18 Feb 2013 15:24:38 +0000 (16:24 +0100)]
winbind: Correctly cast name to messaging_send_buf().
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agowinbind: Use uint8_t type and use const where needed.
Andreas Schneider [Mon, 18 Feb 2013 14:48:24 +0000 (15:48 +0100)]
winbind: Use uint8_t type and use const where needed.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agomessages: Use uint8_t type.
Andreas Schneider [Mon, 18 Feb 2013 14:46:52 +0000 (15:46 +0100)]
messages: Use uint8_t type.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agowinbind: Make domain_name const in wcache_ndr_key().
Andreas Schneider [Mon, 18 Feb 2013 14:44:20 +0000 (15:44 +0100)]
winbind: Make domain_name const in wcache_ndr_key().
Reviewed-by: Alexander Bokovoy <ab@samba.org>
11 years agobuild: use -fstack-protector if available
Björn Jacke [Tue, 19 Feb 2013 18:09:25 +0000 (19:09 +0100)]
build: use -fstack-protector if available

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Matthieu Patou <mat@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Feb 22 15:38:21 CET 2013 on sn-devel-104

11 years agoRevert "wafbuild: use -Wstack-protector if available"
Björn Jacke [Tue, 19 Feb 2013 18:07:34 +0000 (19:07 +0100)]
Revert "wafbuild: use -Wstack-protector if available"

This reverts commit e6643fbf48afccd0acedb65fbe24d3ce84d44c40.

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Matthieu Patou <mat@samba.org>
11 years agobuild/autoconf: put ld check variable in quotes
Björn Jacke [Wed, 20 Feb 2013 16:06:49 +0000 (17:06 +0100)]
build/autoconf: put ld check variable in quotes

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agodsdb-descriptor: Avoid segfault copying an SD without an owner or group
Andrew Bartlett [Mon, 11 Feb 2013 03:46:43 +0000 (14:46 +1100)]
dsdb-descriptor: Avoid segfault copying an SD without an owner or group

This is an unusual SD, but it does exist is some very old upgraded databases.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Feb 22 11:06:17 CET 2013 on sn-devel-104

11 years agodsdb-descriptor: Spell out security descriptor flags as constants
Andrew Bartlett [Mon, 11 Feb 2013 03:45:57 +0000 (14:45 +1100)]
dsdb-descriptor: Spell out security descriptor flags as constants

Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotorture-drs: Fix comment in replica_sync test
Andrew Bartlett [Tue, 15 Jan 2013 21:52:41 +0000 (08:52 +1100)]
torture-drs: Fix comment in replica_sync test

Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agotorture-drs: Make the samba4.drs.repl_schema.python emit failures, not errors on...
Andrew Bartlett [Thu, 7 Feb 2013 08:35:15 +0000 (19:35 +1100)]
torture-drs: Make the samba4.drs.repl_schema.python emit failures, not errors on add failure

This then allows this particular failure to be masked with a knownfail.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agoldb: Add missing dependency on replace for ldb
Andrew Bartlett [Fri, 15 Feb 2013 02:32:06 +0000 (13:32 +1100)]
ldb: Add missing dependency on replace for ldb

This brings in rep_timegm() on Solaris for example.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agobuild: Remove includes.h dep in winbind client libraries
Andrew Bartlett [Tue, 19 Feb 2013 00:44:19 +0000 (11:44 +1100)]
build: Remove includes.h dep in winbind client libraries

Our LGPL winbind client libs do not link against our server-side code, and
should not use the server-side includes.h.

This removes a build-time dep on talloc that was brought in via includes.h as
this code also does not use talloc.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agobuild: Remove unused includes.h reference to avoid build-time talloc dep
Andrew Bartlett [Tue, 19 Feb 2013 00:15:20 +0000 (11:15 +1100)]
build: Remove unused includes.h reference to avoid build-time talloc dep

talloc is not a dependency of this library, but is required by includes.h.

By not including includes.h, we avoid needing to add an otherwise false talloc dep.

(this comes up if talloc.h is not installed as a system package).

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
11 years agobuild:autoconf: fix output of syslog-facility check
Björn Jacke [Wed, 20 Feb 2013 18:57:24 +0000 (19:57 +0100)]
build:autoconf: fix output of syslog-facility check

thanks to Thomas Bork for reporting!

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 21 00:00:06 CET 2013 on sn-devel-104

11 years agos3:rpc_client fix a crash
Christian Ambach [Wed, 20 Feb 2013 15:59:05 +0000 (16:59 +0100)]
s3:rpc_client fix a crash

state->cli->dc does not have to be set (e.g. when running
net rpc join against an older Samba PDC), so check it before dereferencing it

This fixes Bug 9669 - net rpc join crashes against a Samba 3.0.33 PDC

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Feb 20 19:00:52 CET 2013 on sn-devel-104

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>