samba.git
5 years agoMove waf into third_party/.
Jelmer Vernooij [Wed, 25 Mar 2015 11:13:40 +0000 (11:13 +0000)]
Move waf into third_party/.

Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agos3: libsmbclient: Add missing talloc stackframe.
Jeremy Allison [Thu, 26 Mar 2015 17:09:46 +0000 (10:09 -0700)]
s3: libsmbclient: Add missing talloc stackframe.

Bug 11177 - no talloc stackframe at ../source3/libsmb/clifsinfo.c:444, leaking memory

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Mar 26 22:21:30 CET 2015 on sn-devel-104

5 years agodocs: fix duplicate word in explanation of parameter 'logging'.
Michael Adam [Thu, 26 Mar 2015 12:45:50 +0000 (13:45 +0100)]
docs: fix duplicate word in explanation of parameter 'logging'.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
5 years agolibnetapi: Fix 241166 Fixing logically dead code
Anoop C S [Thu, 26 Mar 2015 08:35:19 +0000 (14:05 +0530)]
libnetapi: Fix 241166 Fixing logically dead code

Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Mar 26 17:30:27 CET 2015 on sn-devel-104

5 years agoregistry: Fix 1273042 Identical code for if/else branch
Anoop C S [Thu, 26 Mar 2015 12:36:44 +0000 (18:06 +0530)]
registry: Fix 1273042 Identical code for if/else branch

Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
5 years agoctdb: Fix CID 1125615 Copy into fixed size buffer
Volker Lendecke [Thu, 26 Mar 2015 12:11:14 +0000 (13:11 +0100)]
ctdb: Fix CID 1125615 Copy into fixed size buffer

Might be a "can't happen", but strcpy always looks fishy

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoctdb: Fix CID 1125634 Out-of-bounds write
Volker Lendecke [Thu, 26 Mar 2015 12:06:26 +0000 (13:06 +0100)]
ctdb: Fix CID 1125634 Out-of-bounds write

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agolib: Fix CID 1273009 Dereference after null check
Volker Lendecke [Thu, 26 Mar 2015 09:21:20 +0000 (10:21 +0100)]
lib: Fix CID 1273009 Dereference after null check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoloadparm: Fix CID 1273054 Improper use of negative value
Volker Lendecke [Thu, 26 Mar 2015 09:14:22 +0000 (10:14 +0100)]
loadparm: Fix CID 1273054 Improper use of negative value

Probably a "can't happen", but formally lpcfg_map_parameter can return -1

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoreplace: clean-up strlcpy and add note on return value
David Disseldorp [Thu, 26 Mar 2015 11:21:44 +0000 (12:21 +0100)]
replace: clean-up strlcpy and add note on return value

The existing implementation uses single line ifs, making the code hard
to visually parse.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agovfs_fruit: enhance handling of malformed AppleDouble files
Ralph Boehme [Mon, 2 Mar 2015 17:15:06 +0000 (18:15 +0100)]
vfs_fruit: enhance handling of malformed AppleDouble files

Trying for fixup a broken AppleDouble file with a resourcefork entry
offset + length > filesystem resulted in a crashing memmove() in
ad_convert().

Add a specific safety check that stats the ._ file and limits the
resource fork length to the filesize.

While we're at it, now that we know the filesize in ad_unpack(), add
additional checks that verify this.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar 26 12:39:01 CET 2015 on sn-devel-104

5 years agolib: tdb: Use sigaction when testing for robust mutexes.
Jeremy Allison [Fri, 20 Mar 2015 17:59:08 +0000 (10:59 -0700)]
lib: tdb: Use sigaction when testing for robust mutexes.

Working fix that copes with oldact.sa_handler == NULL
if no handler initially set.

Fixes bug #11175 - Lots of winbindd zombie processes on Solaris platform.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Mar 26 04:29:42 CET 2015 on sn-devel-104

5 years agos3: client - "client use spnego principal = yes" code checks wrong name.
Jeremy Allison [Thu, 19 Mar 2015 20:10:33 +0000 (13:10 -0700)]
s3: client - "client use spnego principal = yes" code checks wrong name.

Bug 10888 - smbclient doesn't ignore "not_defined_in_RFC4178@please_ignore"

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

Code patch from <martin.wilck@ts.fujitsu.com>

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 26 00:56:25 CET 2015 on sn-devel-104

5 years agodocs: Mark 'client use spnego principal' as deprecated and also a bad idea.
Jeremy Allison [Thu, 19 Mar 2015 20:09:21 +0000 (13:09 -0700)]
docs: Mark 'client use spnego principal' as deprecated and also a bad idea.

Bug 10888 - smbclient doesn't ignore "not_defined_in_RFC4178@please_ignore"

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
5 years agoAdd multiplex state to dcerpc flags and control over multiplex PFC flag in bind_ack...
Julien Kerihuel [Wed, 25 Mar 2015 04:06:03 +0000 (21:06 -0700)]
Add multiplex state to dcerpc flags and control over multiplex PFC flag in bind_ack and and dcesrv_alter replies

Signed-off-by: Julien Kerihuel <j.kerihuel@openchange.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
5 years agopidl/python: add prototypes into header section of generated c-files.
Günther Deschner [Wed, 25 Mar 2015 16:38:12 +0000 (17:38 +0100)]
pidl/python: add prototypes into header section of generated c-files.

This stops emmiting hundreds of warnings when compiling with
-Wmissing-prototypes.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Mar 25 20:45:01 CET 2015 on sn-devel-104

5 years agoRevert "lib: tdb: Use sigaction when testing for robust mutexes."
Andreas Schneider [Wed, 25 Mar 2015 10:39:54 +0000 (11:39 +0100)]
Revert "lib: tdb: Use sigaction when testing for robust mutexes."

This fails on Linux platforms with robust mutex support with the
following error:

tdb(/home/asn/workspace/projects/samba/git/st/nt4_dc/lockdir/gencache_notrans.tdb):
    tdb_mutex_open_ok[/home/asn/workspace/projects/samba/git/st/nt4_dc/lockdir/gencache_notrans.tdb]:
    Can use mutexes only with MUTEX_LOCKING or NOLOCK

We also see winbind is not able to start with this error message trying
to open the serverid.tdb.

This reverts commit d1914367289b58f26544ee6e116490d662d9c41c.

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Mar 25 14:58:38 CET 2015 on sn-devel-104

5 years agolib/util: fix the default code path for debug_set_settings()
Stefan Metzmacher [Wed, 25 Mar 2015 10:56:57 +0000 (10:56 +0000)]
lib/util: fix the default code path for debug_set_settings()

logging_param is typically "" instead of NULL!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
5 years agoutil_tdb: mark tdb_pack() and friends as deprecated
David Disseldorp [Tue, 24 Mar 2015 15:11:05 +0000 (16:11 +0100)]
util_tdb: mark tdb_pack() and friends as deprecated

Following a discussion[1] with Volker, add a note to the tdb_unpack()
and tdb_pack[_append]() prototypes describing them as deprecated.

1. https://lists.samba.org/archive/samba-technical/2015-March/106548.html

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Mar 25 11:05:02 CET 2015 on sn-devel-104

5 years agolib: tdb: Use sigaction when testing for robust mutexes.
Jeremy Allison [Fri, 20 Mar 2015 17:59:08 +0000 (10:59 -0700)]
lib: tdb: Use sigaction when testing for robust mutexes.

Fixes bug #11175 - Lots of winbindd zombie processes on Solaris platform.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Mar 24 14:43:22 CET 2015 on sn-devel-104

5 years agoExplicitly include util/debug.h from server stubs generated by pidl.
Jelmer Vernooij [Sat, 21 Mar 2015 23:20:59 +0000 (00:20 +0100)]
Explicitly include util/debug.h from server stubs generated by pidl.

This is necessary since Server.pm generates calls to DEBUG().

Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 24 02:40:00 CET 2015 on sn-devel-104

5 years agolib: Remove unused [un]map_file
Volker Lendecke [Sun, 22 Mar 2015 08:50:25 +0000 (09:50 +0100)]
lib: Remove unused [un]map_file

Reviewed-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
5 years agocodepages/*.dat are gone
Volker Lendecke [Sat, 21 Mar 2015 19:50:45 +0000 (20:50 +0100)]
codepages/*.dat are gone

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agosmbd: Convert valid.dat to C code
Volker Lendecke [Sat, 21 Mar 2015 19:46:11 +0000 (20:46 +0100)]
smbd: Convert valid.dat to C code

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib: load_case_tables() -> smb_init_locale()
Volker Lendecke [Sat, 21 Mar 2015 19:00:06 +0000 (20:00 +0100)]
lib: load_case_tables() -> smb_init_locale()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib: Remove load_case_tables_library()
Volker Lendecke [Sat, 21 Mar 2015 18:49:17 +0000 (19:49 +0100)]
lib: Remove load_case_tables_library()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib: Convert [up|low]case.dat to C
Volker Lendecke [Sat, 21 Mar 2015 12:22:34 +0000 (13:22 +0100)]
lib: Convert [up|low]case.dat to C

This creates a bit more source code, but it removes the requirement to
explicitly mmap the files

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agolib: Fix CID 1272834 Unchecked return value
Volker Lendecke [Wed, 18 Mar 2015 07:47:37 +0000 (07:47 +0000)]
lib: Fix CID 1272834 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
5 years agoWHATSNEW: Add logging backends
Christof Schmitt [Thu, 19 Mar 2015 20:15:24 +0000 (13:15 -0700)]
WHATSNEW: Add logging backends

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Mon Mar 23 23:59:37 CET 2015 on sn-devel-104

5 years agodebug: Add GPFS tracing backend
Christof Schmitt [Thu, 19 Feb 2015 23:32:44 +0000 (16:32 -0700)]
debug: Add GPFS tracing backend

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agogpfswrap: Add wrappers for tracing API
Christof Schmitt [Tue, 24 Feb 2015 23:18:59 +0000 (16:18 -0700)]
gpfswrap: Add wrappers for tracing API

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agogpfswrap: Move gpfswrap to lib/util
Christof Schmitt [Thu, 19 Feb 2015 23:02:11 +0000 (16:02 -0700)]
gpfswrap: Move gpfswrap to lib/util

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Add lttng backend
Christof Schmitt [Fri, 9 Jan 2015 23:17:08 +0000 (16:17 -0700)]
debug: Add lttng backend

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Add systemd backend
Christof Schmitt [Fri, 20 Mar 2015 21:36:58 +0000 (14:36 -0700)]
debug: Add systemd backend

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoparam: Mark syslog and syslog_only as deprecated
Christof Schmitt [Fri, 9 Jan 2015 22:13:37 +0000 (15:13 -0700)]
param: Mark syslog and syslog_only as deprecated

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Remove now unused syslog variables from debug_settings
Christof Schmitt [Fri, 9 Jan 2015 22:07:36 +0000 (15:07 -0700)]
debug: Remove now unused syslog variables from debug_settings

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Simplify Debug1
Christof Schmitt [Fri, 9 Jan 2015 22:00:04 +0000 (15:00 -0700)]
debug: Simplify Debug1

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Use backends instead of explicitly logging to syslog or file
Christof Schmitt [Fri, 9 Jan 2015 21:56:38 +0000 (14:56 -0700)]
debug: Use backends instead of explicitly logging to syslog or file

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Remove codepath to open file in Debug1
Christof Schmitt [Fri, 9 Jan 2015 21:51:00 +0000 (14:51 -0700)]
debug: Remove codepath to open file in Debug1

This is not used, the log file is already open from the call to
reopen_logs_internal.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Set backends from logging parameter in smb.conf
Christof Schmitt [Fri, 9 Jan 2015 21:46:32 +0000 (14:46 -0700)]
debug: Set backends from logging parameter in smb.conf

Fallback to the settings of 'syslog' and 'syslog only' if logging has not
been set.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoparam: Add new 'logging' parameter
Christof Schmitt [Fri, 9 Jan 2015 21:21:32 +0000 (14:21 -0700)]
param: Add new 'logging' parameter

This parameter allows to configure multiple backends at the same time.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Add syslog backend
Christof Schmitt [Mon, 23 Mar 2015 02:30:31 +0000 (13:30 +1100)]
debug: Add syslog backend

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Add file backend
Christof Schmitt [Fri, 9 Jan 2015 21:00:02 +0000 (14:00 -0700)]
debug: Add file backend

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Add infrastructure for supporting multiple backends
Christof Schmitt [Fri, 9 Jan 2015 20:49:13 +0000 (13:49 -0700)]
debug: Add infrastructure for supporting multiple backends

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Move mapping from level to syslog priority to helper function
Christof Schmitt [Fri, 9 Jan 2015 20:29:48 +0000 (13:29 -0700)]
debug: Move mapping from level to syslog priority to helper function

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Move logging to callback to separate function
Christof Schmitt [Fri, 9 Jan 2015 20:17:49 +0000 (13:17 -0700)]
debug: Move logging to callback to separate function

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Always store short version of prog_name in debug state
Christof Schmitt [Tue, 24 Feb 2015 21:09:18 +0000 (14:09 -0700)]
debug: Always store short version of prog_name in debug state

Storing the prog_name in the debug state is not necessary at this point,
but it will be used later.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Remove some unneeded function declarations
Christof Schmitt [Wed, 17 Dec 2014 16:59:52 +0000 (09:59 -0700)]
debug: Remove some unneeded function declarations

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agodebug: Remove FORMAT_BUFR_MAX, use FORMAT_BUFR_SIZE - 1 instead
Christof Schmitt [Fri, 20 Mar 2015 21:19:09 +0000 (14:19 -0700)]
debug: Remove FORMAT_BUFR_MAX, use FORMAT_BUFR_SIZE - 1 instead

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agobuild: Move systemd checks to lib/util
Christof Schmitt [Fri, 20 Mar 2015 19:13:14 +0000 (12:13 -0700)]
build: Move systemd checks to lib/util

Only lib/util uses the systemd library, so it makes sense to have the
checks there. This also removes the need for the ctdb build script to
specify an empty tag for the systemd library.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agolib: Move get_iconv_handle() call down
Volker Lendecke [Mon, 23 Mar 2015 15:03:47 +0000 (15:03 +0000)]
lib: Move get_iconv_handle() call down

We only need this in the slow path. A good compiler might detect this,
but as get_iconv_handle() might have side-effects from a compiler's
point of view, I'm not sure it's legal to skip the call in the fast
path. Might be premature optimization, but it's low hanging fruit :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Mar 23 21:21:15 CET 2015 on sn-devel-104

5 years agos4:torture: avoid use of uninitialized variable in error case.
Michael Adam [Mon, 23 Mar 2015 00:55:02 +0000 (01:55 +0100)]
s4:torture: avoid use of uninitialized variable in error case.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Mar 23 18:40:18 CET 2015 on sn-devel-104

5 years agos4:torture: avoid free of uninitialized variable in error case.
Michael Adam [Mon, 23 Mar 2015 00:52:32 +0000 (01:52 +0100)]
s4:torture: avoid free of uninitialized variable in error case.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agos4:torture: avoid free of uninitialized variable in error case.
Michael Adam [Mon, 23 Mar 2015 00:51:16 +0000 (01:51 +0100)]
s4:torture: avoid free of uninitialized variable in error case.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agos4:torture: avoid free of uninitialized variables in error-case.
Michael Adam [Mon, 23 Mar 2015 00:48:32 +0000 (01:48 +0100)]
s4:torture: avoid free of uninitialized variables in error-case.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agolib/crypto: fix header guard for crypto.h
Michael Adam [Mon, 23 Mar 2015 00:41:57 +0000 (01:41 +0100)]
lib/crypto: fix header guard for crypto.h

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
5 years agolibnetapi: Fix CID 1272947 Fix logically dead code
Anoop C S [Mon, 23 Mar 2015 11:41:31 +0000 (17:11 +0530)]
libnetapi: Fix CID 1272947 Fix logically dead code

Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agodsdb: Fix CID 1034681 Copy-paste error
Volker Lendecke [Tue, 17 Mar 2015 20:43:50 +0000 (21:43 +0100)]
dsdb: Fix CID 1034681 Copy-paste error

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agosmbd: Fix a typo
Volker Lendecke [Mon, 23 Mar 2015 14:38:35 +0000 (14:38 +0000)]
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
5 years agoctdb-tools: Use a broadcast to connected nodes for "reloadnodes"
Martin Schwenke [Wed, 25 Feb 2015 00:43:10 +0000 (11:43 +1100)]
ctdb-tools: Use a broadcast to connected nodes for "reloadnodes"

There is no reason to serialise these or even handle remote nodes
first.  Using a broadcast is more efficient and is less code.

Update expected test results to reflect changed order of messages.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Mar 23 15:04:00 CET 2015 on sn-devel-104

5 years agoctdb-tests: Add unit tests for "reloadnodes" sanity checking
Martin Schwenke [Wed, 4 Feb 2015 03:57:03 +0000 (14:57 +1100)]
ctdb-tests: Add unit tests for "reloadnodes" sanity checking

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tools: Sanity check changes before processing "reloadnodes"
Martin Schwenke [Fri, 30 Jan 2015 09:14:26 +0000 (20:14 +1100)]
ctdb-tools: Sanity check changes before processing "reloadnodes"

"ctdb reloadnodes" currently does no sanity checking of the nodes
file.  This can cause chaos if a line is deleted from the nodes file
rather than commented out.  It also repeatedly produces a spurious
warning for each deleted node, even if the node was deleted a long
time ago.

Instead compare the nodemap with the contents of the local nodes file
to sanity check before attempting any reloads.  Note that this is
still imperfect if the nodes files are inconsistent across nodes but
it is better.  Also ensure that any nodes that are to be deleted are
already disconnected.  Avoid trying to talk to deleted nodes.

The current implementation is a bit unfortunate when it comes to
deleting nodes.  The most obvious alternative to the above complexity
would be to reloadnodes on the specified node first, then fetch the
node map (in which newly deleted nodes would be marked as such) and
then handle the remote nodes.  However, the implementation of
reloadnodes is asynchronous and it only actions the reload after 1
second.  This is presumably to avoid the recovery master noticing the
inconsistency between nodemaps and triggering a recovery before all
nodes have had their nodemaps updated.

Note that this recovery can still occur if the check is done at an
inconvenient time.  A better long term approach might be to quiesce
the recovery master checks while reloadnodes is in progress.

Update a unit test to reflect the change.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tests: Add "ctdb reloadnodes" unit tests
Martin Schwenke [Tue, 17 Mar 2015 09:12:22 +0000 (20:12 +1100)]
ctdb-tests: Add "ctdb reloadnodes" unit tests

A basic test and some for cross-node consistency checking.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tools: Add cross-node file comparison to "reloadnodes"
Martin Schwenke [Tue, 24 Feb 2015 05:13:46 +0000 (16:13 +1100)]
ctdb-tools: Add cross-node file comparison to "reloadnodes"

This compares the nodes file on the current node with that on all
nodes.  If any are different then do not reload nodes.

If any nodes files can't be fetched then do not reload nodes.  This
could be because some nodes are running an older version without this
feature.  This is unsupported: why make a major cluster
reconfiguration while a cluster is half upgraded?

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tests: Test stub for ctrl_getnodesfile()
Martin Schwenke [Tue, 24 Feb 2015 05:13:09 +0000 (16:13 +1100)]
ctdb-tests: Test stub for ctrl_getnodesfile()

Also stub support for CTDB_CONTROL_GET_NODES_FILE

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-daemon: New control CTDB_CONTROL_GET_NODES_FILE
Martin Schwenke [Fri, 20 Feb 2015 10:19:01 +0000 (21:19 +1100)]
ctdb-daemon: New control CTDB_CONTROL_GET_NODES_FILE

This is like CTDB_CONTROL_GET_NODEMAP but it loads from the nodes file
instead of the daemon.

Also new client function ctdb_ctrl_getnodesfile()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tools: "reloadnodes" should only run against current node
Martin Schwenke [Wed, 28 Jan 2015 00:54:39 +0000 (11:54 +1100)]
ctdb-tools: "reloadnodes" should only run against current node

It should not be possible to specify "-n <othernode>", unless
<othernode> is the current node.  To support this, add new function
assert_current_node_only().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tools: Remove unused struct pnn_node and function read_pnn_node_file()
Martin Schwenke [Tue, 24 Feb 2015 00:18:34 +0000 (11:18 +1100)]
ctdb-tools: Remove unused struct pnn_node and function read_pnn_node_file()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tools: Reimplement read_natgw_nodes_file() using ctdb_read_nodes_file()
Martin Schwenke [Tue, 24 Feb 2015 00:17:20 +0000 (11:17 +1100)]
ctdb-tools: Reimplement read_natgw_nodes_file() using ctdb_read_nodes_file()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tools: Reimplement read_nodes_file() using ctdb_get_nodes_file()
Martin Schwenke [Mon, 23 Feb 2015 11:05:36 +0000 (22:05 +1100)]
ctdb-tools: Reimplement read_nodes_file() using ctdb_get_nodes_file()

Update the implementation of "ctdb xpnn" and "ctdb listnodes"
accordingly.  Update associated tests too.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-daemon: Move ctdb_read_nodes_file() to utilities
Martin Schwenke [Sat, 21 Feb 2015 19:49:04 +0000 (06:49 +1100)]
ctdb-daemon: Move ctdb_read_nodes_file() to utilities

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-daemon: Factor out node parsing code
Martin Schwenke [Tue, 17 Feb 2015 04:35:07 +0000 (15:35 +1100)]
ctdb-daemon: Factor out node parsing code

New function ctdb_read_nodes_file() reads a nodes file into a node
map, which is a useful intermediate format.  This function should
replace the node reading code in the ctdb CLI tool.  It will also be
useful for sanity checking of nodes files across the cluster.

New function convert_node_map_to_list() converts a node map to a node
array (and associated node count).  This fills in the details that
aren't present in the node map.  This may also useful as a separate
function later if node list reloading stages the data after a sanity
check - the approach is not yet finalised.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-daemon: Store node addresses as ctdb_sock_addr rather than strings
Martin Schwenke [Fri, 20 Feb 2015 00:47:23 +0000 (11:47 +1100)]
ctdb-daemon: Store node addresses as ctdb_sock_addr rather than strings

Every time a nodemap is contructed the node IP addresses all need to
be parsed.  This isn't very productive use of CPU.

Instead, parse each string once when the nodes file is loaded.  This
results in much simpler code.

This code also removes the use of ctdb_address.  Duplicating the port
is pointless without an abstraction layer around ctdb_address.  If
CTDB gets an incompatible transport in the future then add an
abstraction layer.

Note that the infiniband code is not updated.  Compilation of the
infiniband code is already broken.  Fixing it will be a separate,
properly tested effort.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

5 years agoctdb-common: Drop ctdb context from ctdb_parse_address()
Martin Schwenke [Sun, 22 Feb 2015 23:34:33 +0000 (10:34 +1100)]
ctdb-common: Drop ctdb context from ctdb_parse_address()

Having it require a CTDB context stops ctdb_parse_address() from being
used in more generic code.  Just use the existing talloc context for
memory allocations.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-daemon: Remove function ctdb_add_deleted_node()
Martin Schwenke [Tue, 10 Feb 2015 09:50:05 +0000 (20:50 +1100)]
ctdb-daemon: Remove function ctdb_add_deleted_node()

Just add a flags parameter to ctdb_add_nodes() and use the same code.
Less is more.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-daemon: Set node PNN in one place
Martin Schwenke [Tue, 17 Feb 2015 04:21:15 +0000 (15:21 +1100)]
ctdb-daemon: Set node PNN in one place

This is currently set in 2 places.  One of them makes the node loading
code difficult to refactor.  Also, when the surrounding code in either
place is touched then it might get broken.

This only needs to be done once at startup, not on every reload.  So
do it once in a very obvious way, sacrificing a few CPU cycles for
some added clarity.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-daemon: Move VNN map initialisation out of node loading
Martin Schwenke [Tue, 17 Feb 2015 01:34:41 +0000 (12:34 +1100)]
ctdb-daemon: Move VNN map initialisation out of node loading

Each node reload unnecessarily and incorrectly resets the VNN map,
causing a potentially unnecessary recovery.  When nodes are reloaded
any newly deleted nodes should already be disconnected and any newly
added nodes should also be disconnected.  This means that reloading
the nodes file should not cause a change in the VNN map.

The current implementation also leaks memory every time the nodes are
reloaded.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tests: Fix error return for ctdb_client_async_control_stub()
Martin Schwenke [Tue, 17 Mar 2015 09:14:08 +0000 (20:14 +1100)]
ctdb-tests: Fix error return for ctdb_client_async_control_stub()

It should be -1 even without a failure callback registered.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agoctdb-tests: Add asserts to ensure that pointers are set
Martin Schwenke [Tue, 17 Mar 2015 00:03:52 +0000 (11:03 +1100)]
ctdb-tests: Add asserts to ensure that pointers are set

These can be unset if a NODEMAP, IFACES or VNNMAP section is missing.
Affected functions would then dereference a NULL pointer and the test
program would crash.  Adding some helpful messages makes the problem
easier to diagnose when writing tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
5 years agotorture: Fix the usage of the MEMORY credential cache.
Andreas Schneider [Thu, 26 Feb 2015 16:03:44 +0000 (17:03 +0100)]
torture: Fix the usage of the MEMORY credential cache.

Pair-Programmed-With: Guenther Deschner <gd@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Mar 21 02:03:34 CET 2015 on sn-devel-104

5 years agokdc-db-glue: Remove unused code.
Andreas Schneider [Wed, 25 Feb 2015 10:57:23 +0000 (11:57 +0100)]
kdc-db-glue: Remove unused code.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agokdc-db-glue: Do not allocate memory for the principal
Andreas Schneider [Wed, 25 Feb 2015 10:56:34 +0000 (11:56 +0100)]
kdc-db-glue: Do not allocate memory for the principal

The function we are calling already allocate memory.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agokdc-db-glue: Fix memory cleanup to avoid crashes.
Andreas Schneider [Wed, 25 Feb 2015 10:55:43 +0000 (11:55 +0100)]
kdc-db-glue: Fix memory cleanup to avoid crashes.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agokdc-db-glue: Fix function format of samba_kdc_message2entry()
Andreas Schneider [Wed, 25 Feb 2015 10:54:52 +0000 (11:54 +0100)]
kdc-db-glue: Fix function format of samba_kdc_message2entry()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agokdc-db-glue: Fix a NULL pointer dereference.
Andreas Schneider [Wed, 25 Feb 2015 10:52:45 +0000 (11:52 +0100)]
kdc-db-glue: Fix a NULL pointer dereference.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/db_glue: bad idea to free parent mem_ctx when sub function got a failure.
Günther Deschner [Tue, 10 Feb 2015 13:38:22 +0000 (14:38 +0100)]
s4-kdc/db_glue: bad idea to free parent mem_ctx when sub function got a failure.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/pac_glue: only include required headers.
Günther Deschner [Thu, 8 May 2014 13:49:17 +0000 (15:49 +0200)]
s4-kdc/pac_glue: only include required headers.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/pac_glue: use ENCTYPE_ARCFOUR_HMAC just like in db_glue.
Günther Deschner [Thu, 8 May 2014 13:20:59 +0000 (15:20 +0200)]
s4-kdc/pac_glue: use ENCTYPE_ARCFOUR_HMAC just like in db_glue.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/db-glue: use krb5_copy_data_contents in samba_kdc_message2entry_keys().
Günther Deschner [Mon, 12 May 2014 15:45:26 +0000 (17:45 +0200)]
s4-kdc/db-glue: use krb5_copy_data_contents in samba_kdc_message2entry_keys().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/pac_glue: use krb5_copy_data_contents in samba_make_krb5_pac().
Günther Deschner [Mon, 12 May 2014 15:45:14 +0000 (17:45 +0200)]
s4-kdc/pac_glue: use krb5_copy_data_contents in samba_make_krb5_pac().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/db_glue: use KRB5_PW_SALT instead of hdb type.
Günther Deschner [Thu, 8 May 2014 12:32:47 +0000 (14:32 +0200)]
s4-kdc/db_glue: use KRB5_PW_SALT instead of hdb type.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/db_glue: use smb_krb5_principal_get_type() to access private members
Günther Deschner [Thu, 8 May 2014 10:21:43 +0000 (12:21 +0200)]
s4-kdc/db_glue: use smb_krb5_principal_get_type() to access private members

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/db_glue: use KRB5_KEY_TYPE to access private key members.
Günther Deschner [Thu, 8 May 2014 08:50:21 +0000 (10:50 +0200)]
s4-kdc/db_glue: use KRB5_KEY_TYPE to access private key members.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/db_glue: use time_t directly instead of KerberosTime.
Günther Deschner [Thu, 8 May 2014 08:49:00 +0000 (10:49 +0200)]
s4-kdc/db_glue: use time_t directly instead of KerberosTime.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/db_glue: use krb5_principal_get_comp_string() to access members of private...
Günther Deschner [Thu, 8 May 2014 08:44:09 +0000 (10:44 +0200)]
s4-kdc/db_glue: use krb5_principal_get_comp_string() to access members of private structs.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/db_glue: use krb5_princ_size() instead of inspecting private structs.
Günther Deschner [Thu, 8 May 2014 08:25:07 +0000 (10:25 +0200)]
s4-kdc/db_glue: use krb5_princ_size() instead of inspecting private structs.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/db_glue: use smb_krb5_principal_get_realm().
Günther Deschner [Thu, 8 May 2014 08:10:49 +0000 (10:10 +0200)]
s4-kdc/db_glue: use smb_krb5_principal_get_realm().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4:kdc/db-glue: pass a valid principal from samba_kdc_seq() to samba_kdc_message2entry()
Stefan Metzmacher [Fri, 20 Mar 2015 14:29:30 +0000 (15:29 +0100)]
s4:kdc/db-glue: pass a valid principal from samba_kdc_seq() to samba_kdc_message2entry()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
5 years agos4-kdc/db_glue: use smb_krb5_principal_set_realm().
Günther Deschner [Thu, 8 May 2014 08:09:17 +0000 (10:09 +0200)]
s4-kdc/db_glue: use smb_krb5_principal_set_realm().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4-kdc/db_glue: use krb5_copy_principal().
Günther Deschner [Wed, 7 May 2014 15:14:14 +0000 (17:14 +0200)]
s4-kdc/db_glue: use krb5_copy_principal().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>