vlendec/samba-autobuild/.git
9 years agoscript/show_testsuite_time: error out if number argument is not a decimal number
Michael Adam [Mon, 27 Oct 2014 22:29:25 +0000 (23:29 +0100)]
script/show_testsuite_time: error out if number argument is not a decimal number

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:loadparm: fix a comment typo
Michael Adam [Wed, 29 Oct 2014 17:14:17 +0000 (18:14 +0100)]
s3:loadparm: fix a comment typo

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
9 years agoselftest: only use Options.options.SELFTEST_PREFIX if it's not the default
Stefan Metzmacher [Wed, 22 Oct 2014 08:08:17 +0000 (10:08 +0200)]
selftest: only use Options.options.SELFTEST_PREFIX if it's not the default

The --with-selftest-prefix option is typically specified as argument
to './configure' ! Overwriting it for 'waf testonly' should only
happen with an explicit 'waf testonly --with-selftest-prefix=/some/path'.

This fixes a regression introduced by
commit edc1cedf932de2bc068da9a5db844ac4c48f4324
(selftest: Actually honor --with-selftest-prefix).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoselftest: Fake the hostname.
Andreas Schneider [Wed, 29 Oct 2014 16:40:22 +0000 (17:40 +0100)]
selftest: Fake the hostname.

This fixes the GetPrinterDataEx(DNSMachineName) test on some machines.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Oct 30 11:35:15 CET 2014 on sn-devel-104

9 years agoDon't drop any error codes just because we think there cannot be any errors we didn...
root [Thu, 30 Oct 2014 02:54:56 +0000 (19:54 -0700)]
Don't drop any error codes just because we think there cannot be any errors we didn't think of if the user asked for a level 10 log.

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): Thu Oct 30 09:14:51 CET 2014 on sn-devel-104

9 years agospoolss: remove unused fill_job_info3()
David Disseldorp [Thu, 30 Oct 2014 00:37:51 +0000 (01:37 +0100)]
spoolss: remove unused fill_job_info3()

This logic has been moved into the previous EnumJobs(level=3) caller.
The info3 structure only contains two fields that are used, so it
doesn't make sense to have a separate helper for it.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agospoolss: fix jobid in level 3 EnumJobs response
David Disseldorp [Thu, 30 Oct 2014 00:37:50 +0000 (01:37 +0100)]
spoolss: fix jobid in level 3 EnumJobs response

Until now, these responses have incorrectly carried the printing backend
job identifier (sysjob), rather than the one allocated and returned by
Samba on job submission.

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

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agospoolss: fix jobid in level 2 GetJob and EnumJobs responses
David Disseldorp [Thu, 30 Oct 2014 00:37:49 +0000 (01:37 +0100)]
spoolss: fix jobid in level 2 GetJob and EnumJobs responses

Until now, these responses have incorrectly carried the printing backend
job identifier (sysjob), rather than the one allocated and returned by
Samba on job submission.

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

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agospoolss: fix jobid in level 1 GetJob and EnumJobs responses
David Disseldorp [Thu, 30 Oct 2014 00:37:48 +0000 (01:37 +0100)]
spoolss: fix jobid in level 1 GetJob and EnumJobs responses

Until now, these responses have incorrectly carried the printing backend
job identifier (sysjob), rather than the one allocated and returned by
Samba on job submission.

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

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agospoolss: fix GetJob jobid lookups
David Disseldorp [Thu, 30 Oct 2014 00:37:47 +0000 (01:37 +0100)]
spoolss: fix GetJob jobid lookups

Clients issue GetJob requests using the jobid assigned by the spoolss
server. The corresponding printing backend (sysjob) identifier needs to
be resolved to locate the correct print queue entry.

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

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoprinting: add jobid_to_sysjob helper function
David Disseldorp [Thu, 30 Oct 2014 00:37:46 +0000 (01:37 +0100)]
printing: add jobid_to_sysjob helper function

Samba needs to deal with two types of print job identifiers, those
allocated by the printing backend (sysjob ids), and those allocated
by Samba's spoolss server (jobids).

This change adds a helper function to map spoolss jobids to sysjob ids,
to go alongside the corresponding sysjob to jobid mapping function.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agodns: Fix a compile warning by casting explicitly
Kai Blin [Wed, 29 Oct 2014 13:18:38 +0000 (14:18 +0100)]
dns: Fix a compile warning by casting explicitly

Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agodbwrap: Avoid "includes.h" in dbwrap_cache.c
Volker Lendecke [Wed, 29 Oct 2014 09:21:16 +0000 (10:21 +0100)]
dbwrap: Avoid "includes.h" in dbwrap_cache.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agodbwrap: Add some required #includes to dbwrap.h
Volker Lendecke [Wed, 29 Oct 2014 09:20:20 +0000 (10:20 +0100)]
dbwrap: Add some required #includes to dbwrap.h

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agolib: loadparm.h uses TALLOC_CTX
Volker Lendecke [Wed, 29 Oct 2014 09:19:43 +0000 (10:19 +0100)]
lib: loadparm.h uses TALLOC_CTX

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agodbwrap: Avoid an unnecessary #include
Volker Lendecke [Wed, 29 Oct 2014 09:12:02 +0000 (10:12 +0100)]
dbwrap: Avoid an unnecessary #include

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotorture/spoolss: cleanup print_job_enum test jobs
David Disseldorp [Wed, 29 Oct 2014 10:54:19 +0000 (11:54 +0100)]
torture/spoolss: cleanup print_job_enum test jobs

Purge print queue on startup to ensure that the test is not affected by
jobs queued for prior tests. Also, empty the queue at the end of the
test to play nice with others.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 29 14:31:52 CET 2014 on sn-devel-104

9 years agos3-nmbd: Fix netbios name truncation.
Jeremy Allison [Tue, 28 Oct 2014 18:55:30 +0000 (11:55 -0700)]
s3-nmbd: Fix netbios name truncation.

Try and cope with truncation more intelligently.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoautobuild: check whether ctdbd has been installed in the samba-ctdb target
Michael Adam [Sat, 25 Oct 2014 16:01:30 +0000 (18:01 +0200)]
autobuild: check whether ctdbd has been installed in the samba-ctdb target

An intermediate test until we have full runtime-tests.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Tue Oct 28 08:05:40 CET 2014 on sn-devel-104

9 years agobuild: adapt comments for the clustering choice
Michael Adam [Fri, 24 Oct 2014 15:55:17 +0000 (17:55 +0200)]
build: adapt comments for the clustering choice

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agobuild: further simplify --with-cluster-support case in configure
Michael Adam [Fri, 24 Oct 2014 15:53:08 +0000 (17:53 +0200)]
build: further simplify --with-cluster-support case in configure

includes were only built for the ctdb checks and they are now
gone because we are building against included ctdb.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoautobuild: adapt samba-ctdb target does not need a separate ctdb build any more
Michael Adam [Fri, 24 Oct 2014 15:42:51 +0000 (17:42 +0200)]
autobuild: adapt samba-ctdb target does not need a separate ctdb build any more

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb: Rename CTDB_VERSION to CTDB_PROTOCOL
Amitay Isaacs [Tue, 21 Oct 2014 00:53:29 +0000 (11:53 +1100)]
ctdb: Rename CTDB_VERSION to CTDB_PROTOCOL

CTDB_VERSION really is the ctdb protocol version.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agobuild: Simplify check for building with ctdb
Amitay Isaacs [Fri, 10 Oct 2014 03:29:51 +0000 (14:29 +1100)]
build: Simplify check for building with ctdb

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agobuild: Remove configure checks for ctdb headers
Amitay Isaacs [Fri, 10 Oct 2014 03:25:34 +0000 (14:25 +1100)]
build: Remove configure checks for ctdb headers

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoctdb: Rename ctdb socket variable from CTDB_PATH to CTDB_SOCKET
Amitay Isaacs [Fri, 10 Oct 2014 01:02:26 +0000 (12:02 +1100)]
ctdb: Rename ctdb socket variable from CTDB_PATH to CTDB_SOCKET

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agobuild: Remove configure option --with-ctdb-dir
Amitay Isaacs [Fri, 10 Oct 2014 00:42:05 +0000 (11:42 +1100)]
build: Remove configure option --with-ctdb-dir

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agobuild: Remove checks for ctdb features
Amitay Isaacs [Thu, 9 Oct 2014 23:54:15 +0000 (10:54 +1100)]
build: Remove checks for ctdb features

Since we are always building with integrated CTDB, there is no need for
these checks.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agobuild: Remove configure option --enable-old-ctdb
Amitay Isaacs [Thu, 9 Oct 2014 23:59:06 +0000 (10:59 +1100)]
build: Remove configure option --enable-old-ctdb

CTDB source is now part of Samba tree and to enable clustering smbd
should be built against included CTDB.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoctdb-logging: Add logging via UDP logging using RFC5424
Martin Schwenke [Fri, 8 Aug 2014 10:59:21 +0000 (20:59 +1000)]
ctdb-logging: Add logging via UDP logging using RFC5424

Some implementations may not understand RC3164 format messages on the
UDP socket, so add support for RFC5424 message format.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Add logging via UDP to 127.0.0.1:514 to syslog backend
Martin Schwenke [Fri, 8 Aug 2014 10:59:21 +0000 (20:59 +1000)]
ctdb-logging: Add logging via UDP to 127.0.0.1:514 to syslog backend

This has most of the advantages of the old logd with none of the
complexity of the extra process.  There are several good syslog
implementations that can listen on the UDP port.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Add non-blocking Unix domain logging to syslog backend
Martin Schwenke [Sat, 18 Oct 2014 03:39:30 +0000 (14:39 +1100)]
ctdb-logging: Add non-blocking Unix domain logging to syslog backend

Format messages as per RFC3164.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: New option CTDB_LOGGING, remove CTDB_LOGFILE, CTDB_SYSLOG
Martin Schwenke [Mon, 11 Aug 2014 07:07:41 +0000 (17:07 +1000)]
ctdb-logging: New option CTDB_LOGGING, remove CTDB_LOGFILE, CTDB_SYSLOG

Remove --logfile and --syslog daemon options and replace with
--logging.

Modularise and clean up logging initialisation code.  The
initialisation API includes an app_name argument that is currently
unused - this will be used in extensions to the syslog backend.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Replace logd code with a basic syslog(3) implementation
Martin Schwenke [Fri, 8 Aug 2014 10:57:05 +0000 (20:57 +1000)]
ctdb-logging: Replace logd code with a basic syslog(3) implementation

It is much simpler for most cases to have a syslog backend that
doesn't need a separate CTDB-specific logging daemon.  This loses the
lossy, non-blocking mode provided by logd.  However, a corresponding
feature with a completely different implemention (not requiring an
extra daemon) will be re-added into the syslog backend.  In an ideal
world the new implementation would be added first but unfortunately
that is hard to do because the logd code is hooked in at more than one
place.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Simplify file logging timestamping with timeval_str_buf()
Martin Schwenke [Thu, 16 Oct 2014 08:46:43 +0000 (19:46 +1100)]
ctdb-logging: Simplify file logging timestamping with timeval_str_buf()

If nothing else, this is slightly more portable.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Separate out syslog and file logging backends
Martin Schwenke [Fri, 8 Aug 2014 10:54:54 +0000 (20:54 +1000)]
ctdb-logging: Separate out syslog and file logging backends

This makes the code cleaner and allows the syslog backend to be easily
modified without affecting other code.  Also do some extra clean-up,
including whitespace fixups.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Rework debug level parsing
Martin Schwenke [Fri, 8 Aug 2014 03:36:00 +0000 (13:36 +1000)]
ctdb-logging: Rework debug level parsing

Put declarations into ctdb_logging.h, factor out some common code,
clean up #includes.

Remove the check so see if the 1st character of the debug level is
'-'.  This is wrong, since it is trying to check for a negative
numeric debug level (which is no longer supported) and would need to
be handled in the else anyway.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Remove ctdb element from struct ctdb_log_state
Martin Schwenke [Thu, 16 Oct 2014 09:03:51 +0000 (20:03 +1100)]
ctdb-logging: Remove ctdb element from struct ctdb_log_state

This is set but otherwise not used.  This allows the 1st argument to
ctdb_set_logfile() to be generalised to a TALLOC_CTX.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Remove log member from struct ctdb_context
Martin Schwenke [Fri, 8 Aug 2014 01:50:37 +0000 (11:50 +1000)]
ctdb-logging: Remove log member from struct ctdb_context

This is only used by logging code and there is already a file-level
variable for this.  struct ctdb_context already contains too many
things.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Rename ctdb_log_handler() to ctdb_child_log_handler()
Martin Schwenke [Fri, 8 Aug 2014 01:42:51 +0000 (11:42 +1000)]
ctdb-logging: Rename ctdb_log_handler() to ctdb_child_log_handler()

Now it is obvious that it has something to do with child processes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Remove debug levels DEBUG_ALERT and DEBUG_CRIT
Martin Schwenke [Wed, 8 Oct 2014 03:22:53 +0000 (14:22 +1100)]
ctdb-logging: Remove debug levels DEBUG_ALERT and DEBUG_CRIT

Internally map them to DEBUG_ERR to limit code churn.

This reduces the unwieldy number of debug levels used by CTDB.  ALERT
and CRIT aren't of much use as separate errors, since everything from
ERR up should always be logged.  In future just ERR can be used.

This also improves compatibility with Samba's debug.c system priority
mapping.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Remove DEBUG_EMERG
Martin Schwenke [Wed, 8 Oct 2014 03:19:22 +0000 (14:19 +1100)]
ctdb-logging: Remove DEBUG_EMERG

It isn't used and shouldn't be.  CTDB can't make the system unusable.

Update associated test to ensure that EMERG isn't attempted.  Actually
test all remaining debug levels and modernise the test a bit.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-test: Remove unused function check_ctdb_logfile()
Martin Schwenke [Tue, 12 Aug 2014 04:29:34 +0000 (14:29 +1000)]
ctdb-test: Remove unused function check_ctdb_logfile()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Add missing newline when logging to file
Martin Schwenke [Wed, 15 Oct 2014 09:04:45 +0000 (20:04 +1100)]
ctdb-logging: Add missing newline when logging to file

This got lost with the transition to the new Samba debug code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agospoolss: fix handling of bad EnumJobs levels
David Disseldorp [Mon, 27 Oct 2014 19:13:59 +0000 (20:13 +0100)]
spoolss: fix handling of bad EnumJobs levels

Currently Samba is inconsistent when returning WERR_UNKNOWN_LEVEL
errors for spoolss EnumJobs requests - if no print jobs are present,
then WERR_OK will be returned, regardless of whether the EnumJobs level
is supported or not.
This change fixes this behaviour, by catching invalid or unsupported
levels prior to the no-jobs response fast-path.

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

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): Tue Oct 28 03:05:35 CET 2014 on sn-devel-104

9 years agotorture/spoolss: test EnumJobs with an invalid level
David Disseldorp [Mon, 27 Oct 2014 19:13:58 +0000 (20:13 +0100)]
torture/spoolss: test EnumJobs with an invalid level

This test confirms that EnumJobs WERR_INVALID_LEVEL responses remain
consistent with and without the presence of outstanding print jobs.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotorture/spoolss: add werr_expected arg to EnumJobs helper
David Disseldorp [Mon, 27 Oct 2014 19:13:57 +0000 (20:13 +0100)]
torture/spoolss: add werr_expected arg to EnumJobs helper

This will allow for the future testing of specific EnumJobs failure
cases.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4-dns: Add support for BIND 9.10
Amitay Isaacs [Mon, 20 Oct 2014 05:32:42 +0000 (16:32 +1100)]
s4-dns: Add support for BIND 9.10

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Matthieu Patou <mat@matws.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Sat Oct 25 05:42:19 CEST 2014 on sn-devel-104

9 years agos4-dns: Update dlz_minimal.h based on BIND release 9.10
Amitay Isaacs [Mon, 20 Oct 2014 04:31:30 +0000 (15:31 +1100)]
s4-dns: Update dlz_minimal.h based on BIND release 9.10

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Matthieu Patou <mat@matws.net>
9 years agos4-dns: Check DLZ_DLOPEN_VERSION for different BIND versions
Amitay Isaacs [Sun, 19 Oct 2014 01:57:55 +0000 (12:57 +1100)]
s4-dns: Check DLZ_DLOPEN_VERSION for different BIND versions

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Matthieu Patou <mat@matws.net>
9 years agos4-dns: Update template variables, change BIND98 --> BIND9_8
Amitay Isaacs [Mon, 20 Oct 2014 05:40:05 +0000 (16:40 +1100)]
s4-dns: Update template variables, change BIND98 --> BIND9_8

This makes it easier to add suport for BIND 9.10.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Matthieu Patou <mat@matws.net>
9 years agos4-libnet: make it possible to join "off-site".
Günther Deschner [Thu, 3 Jan 2013 14:40:49 +0000 (15:40 +0100)]
s4-libnet: make it possible to join "off-site".

Guenther

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

9 years agos3-netapi: add DS_8 and WS flags to libnetapi and nltest.
Günther Deschner [Thu, 23 Oct 2014 12:05:40 +0000 (14:05 +0200)]
s3-netapi: add DS_8 and WS flags to libnetapi and nltest.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agonbt-cli: display all known NBT_SERVER flags.
Günther Deschner [Thu, 23 Oct 2014 12:04:35 +0000 (14:04 +0200)]
nbt-cli: display all known NBT_SERVER flags.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agonbt: the DS_8 flag also shows up in netlogon cldap/mailslot replies.
Günther Deschner [Thu, 23 Oct 2014 12:03:33 +0000 (14:03 +0200)]
nbt: the DS_8 flag also shows up in netlogon cldap/mailslot replies.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agonetlogon: add new DS_SERVER_DS_8 flag.
Günther Deschner [Thu, 23 Oct 2014 11:19:48 +0000 (13:19 +0200)]
netlogon: add new DS_SERVER_DS_8 flag.

This flag indicates the DC runs Windows 2012 or above.

See MS-NRPC 2.2.1.2.1 for details.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agomessaging3: Fix running down a messaging_context
Volker Lendecke [Wed, 22 Oct 2014 15:11:43 +0000 (15:11 +0000)]
messaging3: Fix running down a messaging_context

When you do a talloc_free(msg_ctx), existing waiters can't and don't have to
clean up behind themselves properly anymore. The msg_ctx the cleanup function
refers to is just gone.

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 24 04:01:32 CEST 2014 on sn-devel-104

9 years agopoll_funcs_tevent: Fix a valgrind error
Volker Lendecke [Wed, 22 Oct 2014 15:02:49 +0000 (15:02 +0000)]
poll_funcs_tevent: Fix a valgrind error

The valgrind error happened in poll_funcs_tevent_handle_destructor in

  if (handle->ctx->refcount == 0)

handle->ctx was already gone at the time this destructor
was called. It happened because during messaging_init the
messaging_dgm subsystem was free'ed.  The unix_msg context and the
poll_funcs_tevent_context are children of messaging_dgm_context. How
was poll_funcs_tevent_handle_destructor still called? While working
on the new notify subsystem I've added some messaging_read_send
tevent_reqs, which register themselves with the dgm_context via
messaging_dgm_register_tevent_context. They were not gone yet. When
later these were also run down due to another talloc_free somewhere else,
this destructor referenced dead memory.

This code now protects the poll_funcs_tevent_handle against the
poll_funcs_tevent_context going away first with the loop

       for (h = ctx->handles; h != NULL; h = h->next) {
               h->ctx = NULL;
       }

in poll_funcs_tevent_context_destructor together with

       if (handle->ctx == NULL) {
               return 0;
       }

in poll_funcs_tevent_handle_destructor.

A side-effect of this code is that messaging_read_send request won't be
satisfied anymore after a reinit_after_fork kicked in. But I think this is the
right thing anyway: Every process should register its own message handlers
explicitly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agopidl-wireshark: SWITCH_TYPE is not always defined, SwitchType() will try to find...
Matthieu Patou [Tue, 1 Oct 2013 19:10:18 +0000 (12:10 -0700)]
pidl-wireshark: SWITCH_TYPE is not always defined, SwitchType() will try to find a fallback

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

Signed-off-by: Matthieu Patou <mat@matws.net>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Oct 24 01:39:16 CEST 2014 on sn-devel-104

9 years agopidl-wireshark: generate ALIGN_TO_x_BYTES instructions if the element has the align_x...
Matthieu Patou [Fri, 18 Oct 2013 07:04:28 +0000 (00:04 -0700)]
pidl-wireshark: generate ALIGN_TO_x_BYTES instructions if the element has the align_x flag

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agopidl-wireshark: if the structure has the flag no_align then set also no_align in...
Matthieu Patou [Fri, 11 Oct 2013 20:18:37 +0000 (13:18 -0700)]
pidl-wireshark: if the structure has the flag no_align then set also no_align in the dceprc_info structure

Some dissection function will try to do alignment if the no_align flag
is not set.

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

Signed-off-by: Matthieu Patou <mat@matws.net>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agopidl-wireshark: handle 8 bits enum and change the signature of enum function to pass...
Matthieu Patou [Mon, 6 Oct 2014 01:25:27 +0000 (18:25 -0700)]
pidl-wireshark: handle 8 bits enum and change the signature of enum function to pass the exact type

Instead of passing a uint32 in all cases we pass the exact type

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

Change-Id: Ib79f1fa56d5aeb30c6e57eea8f0a48db60f6484d
Signed-off-by: Matthieu Patou <mat@matws.net>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agopidl-wireshark: add definition for IPV4/IPV6 types
Matthieu Patou [Sat, 26 Oct 2013 06:11:37 +0000 (23:11 -0700)]
pidl-wireshark: add definition for IPV4/IPV6 types

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agopidl-wireshark: adapt to the new comments in the headers of wireshark dissectors
Matthieu Patou [Sun, 5 Oct 2014 07:06:49 +0000 (00:06 -0700)]
pidl-wireshark: adapt to the new comments in the headers of wireshark dissectors

Change-Id: I4fc398c4d50230d1f0a083827493c1b193c045b9

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:vfs:aio_pthread: use smbXsrv_connection for schedule_deferred_open_message_smb
Michael Adam [Tue, 21 Oct 2014 08:46:56 +0000 (10:46 +0200)]
s3:vfs:aio_pthread: use smbXsrv_connection for schedule_deferred_open_message_smb

This fixes an incompatible pointer warning which uncovered
a real bug. This caller was missed when converting the function.

This fix is only temporary, since we use fsp->sconn->client->connections
which is supposed to be the start of the list of transport connections
by a given client treated by this smbd process. Currently there is only
one such connection, but with multi-channel there might be more. So
we will need to improve this in the future.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Oct 23 23:10:35 CEST 2014 on sn-devel-104

9 years agos3: libsmbclient - smb2. MacOSX 10 SMB2 server doesn't set STATUS_NO_MORE_FILES when...
Jeremy Allison [Tue, 21 Oct 2014 21:41:32 +0000 (14:41 -0700)]
s3: libsmbclient - smb2. MacOSX 10 SMB2 server doesn't set STATUS_NO_MORE_FILES when handed a non-wildcard path.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Steve French <smfrench@gmail.com>
Tested-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Steve French <sfrench@samba.org>
Autobuild-Date(master): Thu Oct 23 20:44:31 CEST 2014 on sn-devel-104

9 years agosamba-tool group add: Add option --nis-domain and --gid
Marc Muehlfeld [Fri, 17 Oct 2014 22:34:35 +0000 (00:34 +0200)]
samba-tool group add: Add option --nis-domain and --gid

This allows creating RFC2307 enabled groups via samba-tool

Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Oct 23 18:19:35 CEST 2014 on sn-devel-104

9 years agosamba-tool: Add exception when trying to add/remove none existent users from a group.
Marc Muehlfeld [Sun, 12 Oct 2014 14:32:08 +0000 (16:32 +0200)]
samba-tool: Add exception when trying to add/remove none existent users from a group.

This allows a better scripting around samba-tool for adding/removing users
to/from groups. Before the output and the return code had indicated that
everything was successul.

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

Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoselftest: Fix test samba4.blackbox.group.py
Marc Muehlfeld [Sat, 18 Oct 2014 00:17:22 +0000 (02:17 +0200)]
selftest: Fix test samba4.blackbox.group.py

The test created two users and in later steps it tried adding two
non-existend users to groups. This fix adds now the two created
accounts to the groups instead.

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

Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agosubunit: report [X/Y at Zs] instead of [X/Y in Zs]
Michael Adam [Fri, 17 Oct 2014 09:17:53 +0000 (11:17 +0200)]
subunit: report [X/Y at Zs] instead of [X/Y in Zs]

when running test X out of Y after Z secons have passed

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>
9 years agoAdd missing parameters to drs_Replicate in rodc.py
Michael Brown [Thu, 21 Nov 2013 15:48:33 +0000 (10:48 -0500)]
Add missing parameters to drs_Replicate in rodc.py

* rodc.py: destination_dsa_guid parameter was neglected
  in drs_Replicate call
* rodc.py: cancel the local_samdb transaction on error

Change-Id: I962315a26ec48dc8774bb41db760387a3469c919
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Thu Oct 23 03:05:00 CEST 2014 on sn-devel-104

9 years agovfs: fix a typo
Volker Lendecke [Mon, 20 Oct 2014 19:38:09 +0000 (19:38 +0000)]
vfs: fix a typo

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): Tue Oct 21 04:58:44 CEST 2014 on sn-devel-104

9 years agoInitialize dwFlags field of DNS_RPC_NODE structure
Samuel Cabrero [Mon, 20 Oct 2014 12:31:01 +0000 (14:31 +0200)]
Initialize dwFlags field of DNS_RPC_NODE structure

This fixes issue #9791, where the MMC shows random data
listing the zone contents.

Signed-off-by: Samuel Cabrero <samuelcabrero@kernevil.me>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agobuild: lib/util/string_wrappers.h: fix optimisation check for clang
Ralph Boehme [Sat, 11 Oct 2014 18:50:46 +0000 (20:50 +0200)]
build: lib/util/string_wrappers.h: fix optimisation check for clang

Building with clang resulted in an error with undefined symbols
___unsafe_string_function_usage_here_size_t__ etc. Turns out the
existing check whether the compiler optimizes out functions doesn't
match the use case, ie the check said yes, but the functions were not
optimized out.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct 20 14:41:09 CEST 2014 on sn-devel-104

9 years agonss_winbind: add getgroupmembership for FreeBSD
Björn Jacke [Sun, 19 Oct 2014 13:48:45 +0000 (15:48 +0200)]
nss_winbind: add getgroupmembership for FreeBSD

The getgroupmembership call on FreeBSD is needed for "winbind expand groups=0"
(the new default in 4.2) to work.

Thanks to Timur I. Bakeyev for the enhancement patch.

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

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
9 years agopam_winbind: fix comment typos
Michael Adam [Thu, 16 Oct 2014 22:41:24 +0000 (00:41 +0200)]
pam_winbind: fix comment typos

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Oct 18 12:41:07 CEST 2014 on sn-devel-104

9 years agoselftest: add documentation for options --exclude and --include that weren't document...
Matthieu Patou [Mon, 13 Oct 2014 03:59:02 +0000 (20:59 -0700)]
selftest: add documentation for options --exclude and --include that weren't documented before

Change-Id: Ibf0fa1c548d376dc8d68ab8136e2532f67dd1d8a
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Oct 17 20:20:12 CEST 2014 on sn-devel-104

9 years agoselftest: report the 10 slowest tests (by default) make the number configurable
Matthieu Patou [Mon, 13 Oct 2014 00:57:20 +0000 (17:57 -0700)]
selftest: report the 10 slowest tests (by default) make the number configurable

Change-Id: Ib1cf50199d110827a25cf198b40738f3c72cbe17
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoscripts: Allow to specify a limit on the number of tests reported
Matthieu Patou [Mon, 13 Oct 2014 00:56:10 +0000 (17:56 -0700)]
scripts: Allow to specify a limit on the number of tests reported

This allows to report the 10 most slowest for instance.

Change-Id: I987520dbc28f598221c47df314d823f916312aab
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agontlm_auth: Allow the --option parameter to work against ntlm_auth
Andrew Bartlett [Mon, 13 Oct 2014 00:13:15 +0000 (13:13 +1300)]
ntlm_auth: Allow the --option parameter to work against ntlm_auth

Change-Id: Iee386624359c2bf8437719f286e306cdfbb628c6
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): Fri Oct 17 15:20:59 CEST 2014 on sn-devel-104

9 years agontlm_auth: Allow us to use kerberos when we are an AD DC
Andrew Bartlett [Sun, 12 Oct 2014 20:42:25 +0000 (09:42 +1300)]
ntlm_auth: Allow us to use kerberos when we are an AD DC

Change-Id: I88caff9ded915d914cb7fda8829ccbcd3ad64af1
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agodocs: Explain that winbindd enforces smb signing by default.
Andrew Bartlett [Wed, 1 Oct 2014 07:49:23 +0000 (20:49 +1300)]
docs: Explain that winbindd enforces smb signing by default.

Change-Id: I9341fa3bd7480836ac5e0c18e28458175b42d44a
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:libsmb: remove unused cli_set_username() function
Stefan Metzmacher [Fri, 26 Sep 2014 01:39:13 +0000 (03:39 +0200)]
s3:libsmb: remove unused cli_set_username() function

Change-Id: Ib432b4ff66f966de9e733e01de6de2f486c0c728
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:libsmb: avoid calling cli_set_username() cliconnect.c
Stefan Metzmacher [Fri, 26 Sep 2014 01:35:30 +0000 (03:35 +0200)]
s3:libsmb: avoid calling cli_set_username() cliconnect.c

Change-Id: I45e44405ea51ecb1aa38c72f4fc6243a1d3d531a
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:libsmb: avoid calling cli_set_username() in clidfs
Stefan Metzmacher [Fri, 26 Sep 2014 01:33:45 +0000 (03:33 +0200)]
s3:libsmb: avoid calling cli_set_username() in clidfs

Change-Id: I8b32be8a10d2bff33bb468cc68c98e555b220bde
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:libsmb: avoid cli_set_username() in SMBC_server_internal()
Stefan Metzmacher [Fri, 26 Sep 2014 01:17:08 +0000 (03:17 +0200)]
s3:libsmb: avoid cli_set_username() in SMBC_server_internal()

Change-Id: I32e19078a4d4948e405f39dc2a479ff925ad3684
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:lib/netapi: avoid calling cli_set_username()
Stefan Metzmacher [Fri, 26 Sep 2014 01:14:53 +0000 (03:14 +0200)]
s3:lib/netapi: avoid calling cli_set_username()

Change-Id: I3ab768d2df06749187555a16d7b930f7cc8f8b9f
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:torture: avoid unused cli_set_username()
Stefan Metzmacher [Fri, 26 Sep 2014 01:13:28 +0000 (03:13 +0200)]
s3:torture: avoid unused cli_set_username()

Change-Id: Ia774b256093aff5f2b3338e7827e2d798fb06a96
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
9 years agos3:libsmb: Remove unused domain copy stored in cli_state
Stefan Metzmacher [Fri, 26 Sep 2014 01:10:19 +0000 (03:10 +0200)]
s3:libsmb: Remove unused domain copy stored in cli_state

Change-Id: I7333140906bb3a487205b5760396dcc00a9f49b0
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:libsmb: Remove unused password copy stored in cli_state
Andrew Bartlett [Tue, 23 Sep 2014 21:19:35 +0000 (14:19 -0700)]
s3:libsmb: Remove unused password copy stored in cli_state

Change-Id: Ia6b33a25628ae08be8a8c6baeb71ce390315cb45
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3-winbindd: use cli_rpc_pipe_open_with_creds()
Andrew Bartlett [Tue, 23 Sep 2014 16:12:20 +0000 (09:12 -0700)]
s3-winbindd: use cli_rpc_pipe_open_with_creds()

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3-librpc: Add cli_rpc_pipe_open_with_creds()
Andrew Bartlett [Tue, 23 Sep 2014 16:12:20 +0000 (09:12 -0700)]
s3-librpc: Add cli_rpc_pipe_open_with_creds()

This provides a credentials-based interface.  In the long term, we
will want to change this not to reference the credentials, but for now
this suits the caller in winbindd_cm.c

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3-winbindd: Use own machine account to connect to trusted domains as well
Andrew Bartlett [Wed, 11 Dec 2013 02:10:39 +0000 (15:10 +1300)]
s3-winbindd: Use own machine account to connect to trusted domains as well

This relies on a two-way trust, which we may not have, but is the only
secure way to do this.  To do this correctly we need to split NETLOGON
from normal authentication, as we need to use the machine account for
the SMB level, but the inter-domain trust account for the NETLOGON
level.

Change-Id: Ib93eb6a4d704ef26df8234be7cb71c47ad519c8a

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos3-winbindd: use a cli_credentials structure to hold the trust credentials
Stefan Metzmacher [Thu, 8 Aug 2013 11:58:34 +0000 (13:58 +0200)]
s3-winbindd: use a cli_credentials structure to hold the trust credentials

Later we can pass this down directly and have a much more sane
handling of credentials and the spnego handshake.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Change-Id: If12ef0b105d8c7af60190d4eed3c8c07849da2ca

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
9 years agolibsmb: Print the principal name that we failed to kinit for.
Andrew Bartlett [Fri, 3 Oct 2014 18:06:35 +0000 (07:06 +1300)]
libsmb: Print the principal name that we failed to kinit for.

This should aid debugging when this is called from an automated process.

Andrew Bartlett

Change-Id: I2c7291ab3f67f9f7462d7c52c8c9a4b042f7ec5a
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agopassdb: Use common code in cli_credentials_set_machine_account_db_ctx()
Andrew Bartlett [Thu, 2 Oct 2014 17:35:28 +0000 (06:35 +1300)]
passdb: Use common code in cli_credentials_set_machine_account_db_ctx()

This avoids some duplication in setting the machine account passsword
for the domain member and DC case.

This does not yet remove the duplication, that requires a bigger
restructure of the various routines used here to obtain the machine
and domain trust secrets.

Also no longer used is the timeout/2 code to not set the previous
password.  It is now always passed to the caller.

Andrew Bartlett

Change-Id: Idd5bafedf4cbac30b174955d743ec4128a6902ee
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoauth/credentials: Ensure that we set the realm when reading secrets.tdb
Andrew Bartlett [Mon, 6 Oct 2014 00:51:25 +0000 (13:51 +1300)]
auth/credentials: Ensure that we set the realm when reading secrets.tdb

Otherwise, we try and kinit as host$@DOMAIN and that will not work.

Andrew Bartlett

Change-Id: Id2fde673423e74dfa1e6ac48f47f49c61ee59779
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agocredentials: Allow the secret.tdb handle to be passed in to cli_credentials_set_machi...
Andrew Bartlett [Thu, 2 Oct 2014 17:32:39 +0000 (06:32 +1300)]
credentials: Allow the secret.tdb handle to be passed in to cli_credentials_set_machine_account()

This adds a new wrapper, cli_credentials_set_machine_account_db_ctx()

Andrew Bartlett

Change-Id: Ia2cceefede4ba9cf7f8de41986daf9372c19d997
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agocredentials: Improve error message on failure to set machine account password
Andrew Bartlett [Thu, 2 Oct 2014 16:14:56 +0000 (05:14 +1300)]
credentials: Improve error message on failure to set machine account password

Change-Id: I4136067d6d0e5cfe92770a2e7efa39f4ebcb2aca
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agocredentials: Set secure_channel_type from secrets.tdb in cli_credentials_set_machine_...
Andrew Bartlett [Thu, 2 Oct 2014 16:14:21 +0000 (05:14 +1300)]
credentials: Set secure_channel_type from secrets.tdb in cli_credentials_set_machine_account

This should ensure more parts of the source4 code can work with a
password set in secrets.tdb.

Andrew Bartlett

Change-Id: I4a890a719246b073898333d2e04841904c6e1a5d
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>