sfrench/samba-autobuild/.git
4 years agonwrap: Fix resolving hostnames with a trailing dot.
Andreas Schneider [Thu, 9 Oct 2014 07:14:57 +0000 (09:14 +0200)]
nwrap: Fix resolving hostnames with a trailing dot.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agonwrap: Fall back to RTLD_NEXT if we can't find libc.
Andreas Schneider [Thu, 9 Oct 2014 07:13:48 +0000 (09:13 +0200)]
nwrap: Fall back to RTLD_NEXT if we can't find libc.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agos3-net: display full value of "msDS-SupportedEncryptionTypes".
Günther Deschner [Mon, 29 Sep 2014 14:01:25 +0000 (16:01 +0200)]
s3-net: display full value of "msDS-SupportedEncryptionTypes".

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Oct  8 18:18:50 CEST 2014 on sn-devel-104

4 years agoregistry: Don't leave dangling transactions
Volker Lendecke [Wed, 8 Oct 2014 13:39:28 +0000 (15:39 +0200)]
registry: Don't leave dangling transactions

When a createkey fails due to access denied, we need to do a
transaction_cancel. Otherwise the lock on the db will stay around.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
4 years agos3-winbindd: Attempt to connect to NETLOGON over NCACN_IP_TCP if we can
Andrew Bartlett [Fri, 5 Sep 2014 04:59:00 +0000 (16:59 +1200)]
s3-winbindd: Attempt to connect to NETLOGON over NCACN_IP_TCP if we can

This is very helpful in the trusted domain situation, as we may not
have a two-way trust but we can use our domain trust account to set up
a connection to NETLOGON

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Oct  8 12:48:15 CEST 2014 on sn-devel-104

4 years agobuild: Hook CTDB into top level build using --with-cluster-support
Martin Schwenke [Mon, 25 Aug 2014 04:05:48 +0000 (14:05 +1000)]
build: Hook CTDB into top level build using --with-cluster-support

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Oct  8 09:42:08 CEST 2014 on sn-devel-104

4 years agoctdb-build: Make some steps conditional on standalone build
Martin Schwenke [Mon, 25 Aug 2014 03:46:00 +0000 (13:46 +1000)]
ctdb-build: Make some steps conditional on standalone build

CTDB's current wscript assumes that it is only used as part of a
standalone build.  However, it will soon be part of a unified build so
make some steps conditional.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agoctdb-build: Rename define BINDIR to CTDB_HELPER_BINDIR
Martin Schwenke [Fri, 26 Sep 2014 05:42:34 +0000 (15:42 +1000)]
ctdb-build: Rename define BINDIR to CTDB_HELPER_BINDIR

This avoids a clash with Samba's BINDIR and also makes it easier to
move the helpers to somewhere else (e.g. libexec) in the future.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos3-rpc_client: Migrate to cli_rpc_pipe_open_generic_auth and remove cli_rpc_pipe_open...
Andrew Bartlett [Tue, 23 Sep 2014 03:47:57 +0000 (20:47 -0700)]
s3-rpc_client: Migrate to cli_rpc_pipe_open_generic_auth and remove cli_rpc_pipe_open_spnego

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Oct  8 03:36:52 CEST 2014 on sn-devel-104

4 years agos3-rpc_client: Adapt cli_rpc_pipe_open_generic_auth to use enum credentials_kerberos_...
Andrew Bartlett [Tue, 23 Sep 2014 03:33:43 +0000 (20:33 -0700)]
s3-rpc_client: Adapt cli_rpc_pipe_open_generic_auth to use enum credentials_kerberos_state

This allows us to pass this value in directly from the cli_credentials structure in winbindd, once we merge this with cli_rpc_pipe_open_spnego().

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3-rpc_client: Adapt cli_rpc_pipe_open_spnego to use enum credentials_kerberos_state
Andrew Bartlett [Tue, 23 Sep 2014 03:28:01 +0000 (20:28 -0700)]
s3-rpc_client: Adapt cli_rpc_pipe_open_spnego to use enum credentials_kerberos_state

This allows us to pass this value in directly from the cli_credentials
structure in winbindd.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3-winbindd: Allow winbindd to connect over SMB2 to servers
Andrew Bartlett [Tue, 23 Sep 2014 21:08:10 +0000 (14:08 -0700)]
s3-winbindd: Allow winbindd to connect over SMB2 to servers

This allows SMB signing to work against many more DCs, and so improves network security.

The default for "client max protocol" remains NT1 in the rest of the code.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3-winbindd: Pass the whole winbindd_domain to invalidate_cm_connection()
Andrew Bartlett [Tue, 23 Sep 2014 17:35:21 +0000 (10:35 -0700)]
s3-winbindd: Pass the whole winbindd_domain to invalidate_cm_connection()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agotests: Pass the test context as lp_ctx for messaging tests
Matthieu Patou [Mon, 6 Oct 2014 23:44:16 +0000 (16:44 -0700)]
tests: Pass the test context as lp_ctx for messaging tests

Change-Id: I1acf5c42b21465a8c45549039f0054414b8f31d1
Signed-off-by: Matthieu Patou <mat@matws.net>
4 years agolibcli/smb: remove unused SMB2_TF_ALGORITHM define
Stefan Metzmacher [Mon, 6 Oct 2014 11:34:49 +0000 (13:34 +0200)]
libcli/smb: remove unused SMB2_TF_ALGORITHM define

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Oct  8 01:08:40 CEST 2014 on sn-devel-104

4 years agolibcli/smb: use SMB 3.10 flags for the transform header
Stefan Metzmacher [Mon, 6 Oct 2014 11:33:24 +0000 (13:33 +0200)]
libcli/smb: use SMB 3.10 flags for the transform header

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibcli/smb: pass tcon flags to the server for SMB 3.10
Stefan Metzmacher [Mon, 29 Sep 2014 08:30:21 +0000 (10:30 +0200)]
libcli/smb: pass tcon flags to the server for SMB 3.10

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agolibcli/smb: avoid validate info after tcon for SMB 3.10
Stefan Metzmacher [Fri, 26 Sep 2014 19:28:14 +0000 (21:28 +0200)]
libcli/smb: avoid validate info after tcon for SMB 3.10

Signed-off-by: Stefan Metzmacher <metze@samba.org>
4 years agolibcli/smb: implement SMB 3.10 session setup
Stefan Metzmacher [Wed, 24 Sep 2014 20:58:49 +0000 (22:58 +0200)]
libcli/smb: implement SMB 3.10 session setup

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibcli/smb: implement SMB 3.10 negprot
Stefan Metzmacher [Tue, 23 Sep 2014 02:09:16 +0000 (04:09 +0200)]
libcli/smb: implement SMB 3.10 negprot

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibcli/smb: add smb2cli_req_get_send_iov()
Stefan Metzmacher [Wed, 24 Sep 2014 06:59:58 +0000 (08:59 +0200)]
libcli/smb: add smb2cli_req_get_send_iov()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibcli/smb: add smb2_negotiate_context.c
Stefan Metzmacher [Tue, 23 Sep 2014 02:09:16 +0000 (04:09 +0200)]
libcli/smb: add smb2_negotiate_context.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibcli/smb: add SMB 3.10 related defines
Stefan Metzmacher [Mon, 29 Sep 2014 08:14:08 +0000 (10:14 +0200)]
libcli/smb: add SMB 3.10 related defines

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agodocs-xml: document SMB3_10 as available protocol for the client side
Stefan Metzmacher [Tue, 23 Sep 2014 02:07:00 +0000 (04:07 +0200)]
docs-xml: document SMB3_10 as available protocol for the client side

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:torture: add PROTOCOL_SMB3_10 handling
Stefan Metzmacher [Tue, 23 Sep 2014 02:03:49 +0000 (04:03 +0200)]
s3:torture: add PROTOCOL_SMB3_10 handling

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/param: add PROTOCOL_SMB3_10 handling
Stefan Metzmacher [Tue, 23 Sep 2014 02:02:40 +0000 (04:02 +0200)]
lib/param: add PROTOCOL_SMB3_10 handling

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibcli/smb: negotiate SMB3_DIALECT_REVISION_310 if PROTOCOL_SMB3_10 is requested
Stefan Metzmacher [Tue, 23 Sep 2014 02:01:01 +0000 (04:01 +0200)]
libcli/smb: negotiate SMB3_DIALECT_REVISION_310 if PROTOCOL_SMB3_10 is requested

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibcli/smb: add PROTOCOL_SMB3_10
Stefan Metzmacher [Tue, 23 Sep 2014 01:58:48 +0000 (03:58 +0200)]
libcli/smb: add PROTOCOL_SMB3_10

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibcli/smb: add SMB3_DIALECT_REVISION_310 define
Stefan Metzmacher [Tue, 23 Sep 2014 01:57:04 +0000 (03:57 +0200)]
libcli/smb: add SMB3_DIALECT_REVISION_310 define

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibcli/smb: fix smb2cli_validate_negotiate_info with min=PROTOCOL_NT1 max=PROTOCOL_SM...
Stefan Metzmacher [Mon, 6 Oct 2014 12:19:39 +0000 (14:19 +0200)]
libcli/smb: fix smb2cli_validate_negotiate_info with min=PROTOCOL_NT1 max=PROTOCOL_SMB2_02

If the connection starts with a SMB Negprot, the server only implies the
selected dialect, but not the clients security mode.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprinter_list: fix talloc tos leak of tdb record
David Disseldorp [Tue, 7 Oct 2014 12:49:59 +0000 (14:49 +0200)]
printer_list: fix talloc tos leak of tdb record

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
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): Tue Oct  7 19:25:09 CEST 2014 on sn-devel-104

4 years agoidl: Fix a typo
Volker Lendecke [Mon, 6 Oct 2014 15:17:54 +0000 (15:17 +0000)]
idl: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Oct  7 17:03:42 CEST 2014 on sn-devel-104

4 years agosmbd: Simplify remove_child_pid
Volker Lendecke [Mon, 6 Oct 2014 14:12:52 +0000 (14:12 +0000)]
smbd: Simplify remove_child_pid

In this if-branch ret is always != 0.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
4 years agostatus: 80 chars per line
Volker Lendecke [Tue, 30 Sep 2014 12:51:37 +0000 (12:51 +0000)]
status: 80 chars per line

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
4 years agosmbd: Fix nonempty line endings
Volker Lendecke [Thu, 11 Sep 2014 14:46:39 +0000 (16:46 +0200)]
smbd: Fix nonempty line endings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
4 years agolanman: don't leak cache_path onto talloc tos
David Disseldorp [Mon, 6 Oct 2014 16:21:18 +0000 (18:21 +0200)]
lanman: don't leak cache_path onto talloc tos

Also check for allocation failures.

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Oct  6 21:41:22 CEST 2014 on sn-devel-104

4 years agosamlogon_cache: don't leak cache_path onto talloc tos
David Disseldorp [Mon, 6 Oct 2014 16:21:17 +0000 (18:21 +0200)]
samlogon_cache: don't leak cache_path onto talloc tos

Also check for allocation failures.

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agonmbd: don't leak cache_path onto talloc tos
David Disseldorp [Mon, 6 Oct 2014 16:21:16 +0000 (18:21 +0200)]
nmbd: don't leak cache_path onto talloc tos

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprinting: don't leak cache_path onto talloc tos
David Disseldorp [Mon, 6 Oct 2014 16:21:15 +0000 (18:21 +0200)]
printing: don't leak cache_path onto talloc tos

Also check for allocation failures.

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agogpo: don't leak cache_path onto talloc tos
David Disseldorp [Mon, 6 Oct 2014 16:21:14 +0000 (18:21 +0200)]
gpo: don't leak cache_path onto talloc tos

Also check for allocation failures.

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agogencache: don't leak cache_path onto talloc tos
David Disseldorp [Mon, 6 Oct 2014 16:21:13 +0000 (18:21 +0200)]
gencache: don't leak cache_path onto talloc tos

Also check for allocation failures.

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoAdd a status code for VHD support gleaned from some Win8.1 stuff.
Richard Sharpe [Sat, 4 Oct 2014 19:06:10 +0000 (12:06 -0700)]
Add a status code for VHD support gleaned from some Win8.1 stuff.

Signed-off-by: Richard Sharpe (rsharpe@samba.org)
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoAdd a definition of the NETWORK_RESILIENCY_REQUEST so I can write a torture test...
Richard Sharpe [Sun, 5 Oct 2014 02:05:03 +0000 (19:05 -0700)]
Add a definition of the NETWORK_RESILIENCY_REQUEST so I can write a torture test for it.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agowinbindd: Do not overwrite domain list with conflicting info from a trusted domain
Andrew Bartlett [Sun, 5 Oct 2014 05:32:09 +0000 (18:32 +1300)]
winbindd: Do not overwrite domain list with conflicting info from a trusted domain

This places less trust in our primary DC or trusted domain DC and refuses to update info that is conflicting

This does not currently reject the connection to the DC, but only ensures it can only update missing information or to correct the case of the domain.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Oct  6 17:21:03 CEST 2014 on sn-devel-104

4 years agotorture: Reorder torture_winbind_struct_domain_info tests
Andrew Bartlett [Sun, 5 Oct 2014 03:00:47 +0000 (16:00 +1300)]
torture: Reorder torture_winbind_struct_domain_info tests

This tries to ensure we get enough information to debug this
intermittent failure.

I think this may be a real failure, but it is hard to tell without more info.

This patch prints out the full details of what the domain returned before
doing the assertions.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agoctdb-build: Fix handling of public headers
Martin Schwenke [Fri, 29 Aug 2014 11:17:30 +0000 (21:17 +1000)]
ctdb-build: Fix handling of public headers

Add the header munging, add/package ctdb_version.h, create
directory include/public.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct  6 14:56:07 CEST 2014 on sn-devel-104

4 years agoctdb-build: Change from ctdb-util to samba-util
Martin Schwenke [Fri, 15 Aug 2014 06:41:57 +0000 (16:41 +1000)]
ctdb-build: Change from ctdb-util to samba-util

Remove local lib/util and lib/tdb-wrap. Update wscript, packaging and
includes.h.

The only potentially surprising thing here is a fake samba-util
subsystem that just depends on samba-util-core.  As explained in a
comment:

  When a combined build is implemented, CTDB will wanted to build
  against samba-util rather than samba-util-core.  Similarly, other
  Samba subsystems expect samba-util.  So, for a standalone build,
  just define a fake samba-util subsystem that pulls in
  samba-util-core.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agoctdb-build: Add generation of Samba-style version.h
Martin Schwenke [Mon, 25 Aug 2014 03:28:30 +0000 (13:28 +1000)]
ctdb-build: Add generation of Samba-style version.h

This is needed by fault.c.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agoctdb-build: Move generation of ctdb_version.h earlier
Martin Schwenke [Mon, 25 Aug 2014 03:21:12 +0000 (13:21 +1000)]
ctdb-build: Move generation of ctdb_version.h earlier

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agoctdb-logging: Update to use Samba style debug.h/debug.c
Martin Schwenke [Tue, 19 Aug 2014 02:15:31 +0000 (12:15 +1000)]
ctdb-logging: Update to use Samba style debug.h/debug.c

Samba's debug subsystem has changed a lot, so CTDB's logging needs
to be rewritten to be compatible.

The new debug.h/debug.c can't just be pulled in because it has some
extra dependencies into Samba's lib/util.  For now, to support the
smallest possible patch, implement a minimal subset of Samba's
debug.[ch] that just supports the DEBUG_CALLBACK logtype.

Define a callback for each logging method.

Check later to see if debug_extra (or similar) can somehow be
implemented using debug classes.

The timestamp on CTDB CLI tool and test program DEBUG() output goes
away, so update the unit test code to cope.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agoctdb-logging: Change LogLevel to DEBUGLEVEL
Martin Schwenke [Wed, 24 Sep 2014 07:12:56 +0000 (17:12 +1000)]
ctdb-logging: Change LogLevel to DEBUGLEVEL

For compatibility with current Samba debug.[ch].

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agoctdb-tests: Make the fake log timestamp string easy to modify
Martin Schwenke [Wed, 24 Sep 2014 07:07:12 +0000 (17:07 +1000)]
ctdb-tests: Make the fake log timestamp string easy to modify

Use a variable to allow easy change of this string in case future
logging changes modify the timestamp format or do not support
timestamping.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agoctdb-logging: Remove log ringbuffer
Martin Schwenke [Fri, 8 Aug 2014 02:51:03 +0000 (12:51 +1000)]
ctdb-logging: Remove log ringbuffer

As far as we know, nobody uses this and it just complicates the
logging subsystem.

Remove all ringbuffer code and documentation.  Update the local
daemons startup code correspondingly.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
4 years agos3: lib, s3: modules: Fix compilation on Solaris.
Jeremy Allison [Fri, 3 Oct 2014 16:24:04 +0000 (09:24 -0700)]
s3: lib, s3: modules: Fix compilation on Solaris.

Based on work from YOUZHONG YANG <youzhong@gmail.com>.
Code needs fixing when HAVE_STRUCT_MSGHDR_MSG_CONTROL is
not defined. Also Solaris doesn't have msg_flags field
(which we set to zero anyway, so if we initialize
the entire struct to zero, we never need to refer to it).

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Oct  6 12:33:36 CEST 2014 on sn-devel-104

4 years agolib: uid_wrapper: Fix setgroups and syscall detection on a system without native...
Jeremy Allison [Sat, 4 Oct 2014 00:18:34 +0000 (17:18 -0700)]
lib: uid_wrapper: Fix setgroups and syscall detection on a system without native uid_wrapper library.

Originally from youzhong@gmail.com.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 years agowindbindd: Make cm_connect_lsa_tcp static
Christof Schmitt [Fri, 3 Oct 2014 17:36:02 +0000 (10:36 -0700)]
windbindd: Make cm_connect_lsa_tcp static

It is only used in winbindd_cm.c

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Oct  4 02:34:49 CEST 2014 on sn-devel-104

4 years agosmbd: Always use uint8_t for inbuf pointer
Christof Schmitt [Tue, 2 Sep 2014 19:24:29 +0000 (12:24 -0700)]
smbd: Always use uint8_t for inbuf pointer

This avoids some casts from char pointers.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agosmbd: Pass only cmd to construct_reply_common instead of complete req
Christof Schmitt [Tue, 2 Sep 2014 19:18:30 +0000 (12:18 -0700)]
smbd: Pass only cmd to construct_reply_common instead of complete req

construct_reply_common only needs the commands code and the inbuf field,
not the complete request.

Signed-off-by: Christof Schmitt <cs@samba.org>
4 years agosmbd: Use MIN macro in fake_sendfile
Christof Schmitt [Mon, 11 Aug 2014 20:19:46 +0000 (13:19 -0700)]
smbd: Use MIN macro in fake_sendfile

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3-winbindd: Make wcache_sid_to_name static
Christof Schmitt [Sat, 30 Aug 2014 01:05:43 +0000 (18:05 -0700)]
s3-winbindd: Make wcache_sid_to_name static

It is only used in winbindd_cache.c

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3-winbindd: Remove extern declaration for cache_methods from winbindd_dual.c
Christof Schmitt [Sat, 30 Aug 2014 01:04:27 +0000 (18:04 -0700)]
s3-winbindd: Remove extern declaration for cache_methods from winbindd_dual.c

cache_methods is not used in winbindd_dual.c

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Use charset_compat.h if SAMBA_UTIL_CORE_ONLY
Martin Schwenke [Mon, 22 Sep 2014 10:26:24 +0000 (20:26 +1000)]
lib/util: Use charset_compat.h if SAMBA_UTIL_CORE_ONLY

When doing a CTDB standalone build we don't want to use dynconfig,
since this introduces a lot of unwanted complexity.  To avoid this,
either:

* charset needs to be nobbled to avoid loading the case tables, since
  this depends on dynconfig; or

* charset needs to be avoid completely, so some functions need to be
  replaced with their ASCII counterparts.

The 2nd options seems more honest and less error-prone.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Factor out subsystem samba-util-core from samba-util
Martin Schwenke [Fri, 15 Aug 2014 06:00:32 +0000 (16:00 +1000)]
lib/util: Factor out subsystem samba-util-core from samba-util

samba-util depends on Samba-specific code.  Exclude this code from
samba-util-core.  When told to, via SAMBA_UTIL_CORE_ONLY, only build
samba-util-core and dependencies.  When SAMBA_UTIL_CORE_ONLY is not
defined then the behaviour should be unchanged.

Standalone builds of CTDB will be done against samba-util-core to
avoid pulling in Samba-specific code.

An alternative would be to remove the Samba-dependent code from
samba-util.  However, some of it is used by OpenChange.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Clean up includes for util.c
Martin Schwenke [Mon, 22 Sep 2014 08:28:53 +0000 (18:28 +1000)]
lib/util: Clean up includes for util.c

Allows standalone compiles without external includes.h.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Clean up includes for fault.c
Martin Schwenke [Mon, 22 Sep 2014 09:43:27 +0000 (19:43 +1000)]
lib/util: Clean up includes for fault.c

Add fault.h.  Allows standalone compiles without external includes.h.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Clean up includes for substitute.c
Martin Schwenke [Mon, 22 Sep 2014 10:38:52 +0000 (20:38 +1000)]
lib/util: Clean up includes for substitute.c

Add substitute.h.  Allows standalone compiles without external
includes.h.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Replace an SMB_ASSERT()
Martin Schwenke [Tue, 23 Sep 2014 18:41:25 +0000 (04:41 +1000)]
lib/util: Replace an SMB_ASSERT()

Avoid a cyclic dependency.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Clean up includes for signal.c
Martin Schwenke [Mon, 22 Sep 2014 09:57:52 +0000 (19:57 +1000)]
lib/util: Clean up includes for signal.c

Add signal.h.  Allows standalone compiles without external includes.h.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Clean up includes for time.[ch]
Martin Schwenke [Mon, 22 Sep 2014 09:38:18 +0000 (19:38 +1000)]
lib/util: Clean up includes for time.[ch]

Allows standalone compile without external includes.h.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Clean up includes for data_blob.[ch]
Martin Schwenke [Mon, 22 Sep 2014 09:31:23 +0000 (19:31 +1000)]
lib/util: Clean up includes for data_blob.[ch]

Allows standalone compile without external includes.h.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Clean up includes for xfile.[ch]
Martin Schwenke [Mon, 22 Sep 2014 09:21:42 +0000 (19:21 +1000)]
lib/util: Clean up includes for xfile.[ch]

The include files added to xfile.h are already included
unconditionally elsewhere (replace.h, samba_util.h, ...) so Samba
can't be built without them.

To minimise dependencies, only include specific util headers instead
of samba_util.h.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolib/util: Clean up includes for blocking.c
Martin Schwenke [Mon, 22 Sep 2014 08:14:53 +0000 (18:14 +1000)]
lib/util: Clean up includes for blocking.c

Add blocking.h.  Allows standalone compile without external
includes.h.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprofiling: Make WITH_PROFILE span more in smbprofile.h
Volker Lendecke [Thu, 2 Oct 2014 13:45:01 +0000 (13:45 +0000)]
profiling: Make WITH_PROFILE span more in smbprofile.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct  3 22:17:46 CEST 2014 on sn-devel-104

4 years agoprofiling: Remove a big DEBUG statement
Volker Lendecke [Thu, 2 Oct 2014 13:40:35 +0000 (13:40 +0000)]
profiling: Remove a big DEBUG statement

I would like to have the freedom to play with the profiling implementation.
This is kindof in the way.

This code is from pre-SVN days:

> commit 7914e9351abb5271ebb4990c3b1fe495d15a4eda
> Author:     Jeremy Allison <jra@samba.org>
> AuthorDate: Thu Oct 5 18:50:18 2000 +0000
> Commit:     Jeremy Allison <jra@samba.org>
> CommitDate: Thu Oct 5 18:50:18 2000 +0000
>
>     Herb's fixes for profiling & compiler warnings.
>     Jeremy.

Herb, please speak up quickly if you still need this :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprofiling: Remove some #ifdefs
Volker Lendecke [Thu, 2 Oct 2014 13:36:22 +0000 (13:36 +0000)]
profiling: Remove some #ifdefs

The DO_PROFILE_INC thingies already #define to nothing without
WITH_PROFILE, and any sane compiler will just not compile the if-condition
if there is no body to be executed.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprofiling: Only compile profile/profile.c if profiling is enabled
Volker Lendecke [Tue, 30 Sep 2014 15:08:20 +0000 (15:08 +0000)]
profiling: Only compile profile/profile.c if profiling is enabled

This conditional compile avoids some #ifdef WITH_PROFILE, which makes the code
more readable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprofiling: Only compile utils/status_profile.c if profiling is enabled
Volker Lendecke [Tue, 30 Sep 2014 15:08:20 +0000 (15:08 +0000)]
profiling: Only compile utils/status_profile.c if profiling is enabled

This conditional compile avoids some #ifdef WITH_PROFILE, which makes the code
more readable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprofiling: Fix a typo
Volker Lendecke [Thu, 2 Oct 2014 13:05:07 +0000 (13:05 +0000)]
profiling: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprofiling: Move some #defines to profile.c
Volker Lendecke [Thu, 2 Oct 2014 12:52:05 +0000 (12:52 +0000)]
profiling: Move some #defines to profile.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprofiling: Fix a typo
Volker Lendecke [Tue, 30 Sep 2014 13:06:02 +0000 (13:06 +0000)]
profiling: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoprofiling: Make "struct profile_header" static
Volker Lendecke [Mon, 29 Sep 2014 15:06:37 +0000 (15:06 +0000)]
profiling: Make "struct profile_header" static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agowinbind3: Fix pwent variable substitution
Justin Maggard [Fri, 3 Oct 2014 00:21:06 +0000 (17:21 -0700)]
winbind3: Fix pwent variable substitution

Commit 0ce46318 (winbind3: Simplify fillup_pw_field) broke variable
substitution by copying from the wrong (unsubstituted) buffer.  Fix it.

Signed-off-by: Justin Maggard <jmaggard10@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <rsharpe@samba.org>
4 years agoReduce the no-op build times by 30%
Thomas Nagy [Fri, 26 Sep 2014 21:46:01 +0000 (23:46 +0200)]
Reduce the no-op build times by 30%

Change-Id: Ie68436c1e7c75c1786e9ed6b6a54d2b55abbbcea
Reviewed-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Oct  3 13:25:18 CEST 2014 on sn-devel-104

4 years agowaf: add k5crypto to the list of system libraries if they are reported by the krb5con...
Matthieu Patou [Wed, 14 May 2014 23:38:08 +0000 (16:38 -0700)]
waf: add k5crypto to the list of system libraries if they are reported by the krb5config but not found as requied by the different tests

Otherwise on some systems we have error message like
"Implied dependency k5crypto in winbind_krb5_locator is of type EMPTY"
Even though krb5config indicated that this library is needed and the
library is present

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agolibrpc: simplify ndr_pull_dnsp_string
Matthieu Patou [Mon, 14 Oct 2013 04:39:51 +0000 (21:39 -0700)]
librpc: simplify ndr_pull_dnsp_string

total_len is 1 and never varies.

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Michael Adam <obnox@samba.org>
4 years agoFix typo in samba-tool manpage
Андрей Черепанов [Thu, 2 Oct 2014 15:23:09 +0000 (19:23 +0400)]
Fix typo in samba-tool manpage

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Oct  3 11:00:58 CEST 2014 on sn-devel-104

4 years agos4:torture:basic: eliminate potential for false failures in delayed_write_update1c
Michael Adam [Thu, 2 Oct 2014 15:15:04 +0000 (17:15 +0200)]
s4:torture:basic: eliminate potential for false failures in delayed_write_update1c

We want to test that the write did update the write time immediately.
We check this by getting the file info in a loop for a few seconds.
There are several result cases:

- the server updated the write time immediately - success
- the server updated the write time, but not immediately - failure
- the server did not update the write time - failure

The loop is only there to be able to discern between the two
failure cases. The check for success is whether the first
getinfo has reportet the updated write time.

The potential for false failures was the additional timing check.
So if the first fileinfo call just took too long (e.g. due to a
busy system), this was reported as failure.

This patch should eliminate interemittent autobuild failures.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: use assert in the second loop in delayed_write_update1b
Michael Adam [Thu, 2 Oct 2014 15:13:21 +0000 (17:13 +0200)]
s4:torture:basic: use assert in the second loop in delayed_write_update1b

We can hence replace the assert after the loop by a success torture_comment.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: add check for size after initial write in delayed_write_update1c
Michael Adam [Thu, 2 Oct 2014 15:10:32 +0000 (17:10 +0200)]
s4:torture:basic: add check for size after initial write in delayed_write_update1c

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: add update into past as error condition in delayed_write_update1c
Michael Adam [Thu, 2 Oct 2014 15:09:18 +0000 (17:09 +0200)]
s4:torture:basic: add update into past as error condition in delayed_write_update1c

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: make use of torture_assert macros in delayed_write_update1c
Michael Adam [Thu, 2 Oct 2014 15:08:12 +0000 (17:08 +0200)]
s4:torture:basic: make use of torture_assert macros in delayed_write_update1c

This does not change the logic except for adding early
returns in failure cases.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: whitespace cleanup in delayed_write_update1c
Michael Adam [Thu, 2 Oct 2014 15:02:38 +0000 (17:02 +0200)]
s4:torture:basic: whitespace cleanup in delayed_write_update1c

no diff with git diff -w

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: eliminate potential for false failures in delayed_write_update1b
Michael Adam [Thu, 2 Oct 2014 14:48:40 +0000 (16:48 +0200)]
s4:torture:basic: eliminate potential for false failures in delayed_write_update1b

We want to test that the write did update the write time immediately.
We check this by getting the file info in a loop for a few seconds.
There are several result cases:

- the server updated the write time immediately - success
- the server updated the write time, but not immediately - failure
- the server did not update the write time - failure

The loop is only there to be able to discern between the two
failure cases. The check for success is whether the first
getinfo has reportet the updated write time.

The potential for false failures was the additional timing check.
So if the first fileinfo call just took too long (e.g. due to a
busy system), this was reported as failure.

This patch should eliminate interemittent autobuild failures.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: use assert in the second loop in delayed_write_update1b
Michael Adam [Thu, 2 Oct 2014 14:46:18 +0000 (16:46 +0200)]
s4:torture:basic: use assert in the second loop in delayed_write_update1b

We can hence replace the assert after the loop by a success torture_comment.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: add check for size after initial write in delayed_write_update1b
Michael Adam [Thu, 2 Oct 2014 14:53:26 +0000 (16:53 +0200)]
s4:torture:basic: add check for size after initial write in delayed_write_update1b

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: add update into past as error condition in delayed_write_update1b
Michael Adam [Thu, 2 Oct 2014 14:44:34 +0000 (16:44 +0200)]
s4:torture:basic: add update into past as error condition in delayed_write_update1b

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: make use of torture_assert macros in delayed_write_update1b
Michael Adam [Thu, 2 Oct 2014 14:40:26 +0000 (16:40 +0200)]
s4:torture:basic: make use of torture_assert macros in delayed_write_update1b

This does not change the logic except for adding early
returns in failure cases.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: whitespace cleanup in delayed_write_update1b
Michael Adam [Thu, 2 Oct 2014 14:34:19 +0000 (16:34 +0200)]
s4:torture:basic: whitespace cleanup in delayed_write_update1b

no diff with git diff -w

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: eliminate potential for false failures in delayed_write_update1a
Michael Adam [Thu, 2 Oct 2014 11:56:43 +0000 (13:56 +0200)]
s4:torture:basic: eliminate potential for false failures in delayed_write_update1a

We want to test that the write did update the write time immediately.
We check this by getting the file info in a loop for a few seconds.
There are several result cases:

- the server updated the write time immediately - success
- the server updated the write time, but not immediately - failure
- the server did not update the write time - failure

The loop is only there to be able to discern between the two
failure cases. The check for success is whether the first
getinfo has reportet the updated write time.

The potential for false failures was the additional timing check.
So if the first fileinfo call just took too long (e.g. due to a
busy system), this was reported as failure.

This patch should eliminate interemittent autobuild failures.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 years agos4:torture:basic: use assert in the second loop in delayed_write_update1a
Michael Adam [Thu, 2 Oct 2014 11:46:29 +0000 (13:46 +0200)]
s4:torture:basic: use assert in the second loop in delayed_write_update1a

We can hence replace the assert after the loop by a success torture_comment.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>