kai/samba-autobuild/.git
8 years agoctdb-include: Group function prototypes from server/ctdb_recover.c
Amitay Isaacs [Fri, 23 Oct 2015 04:54:59 +0000 (15:54 +1100)]
ctdb-include: Group function prototypes from server/ctdb_recover.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_persistent.c
Amitay Isaacs [Fri, 23 Oct 2015 04:25:24 +0000 (15:25 +1100)]
ctdb-include: Group function prototypes from server/ctdb_persistent.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_monitor.c
Amitay Isaacs [Fri, 23 Oct 2015 04:23:18 +0000 (15:23 +1100)]
ctdb-include: Group function prototypes from server/ctdb_monitor.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_ltdb_server.c
Amitay Isaacs [Fri, 23 Oct 2015 04:21:13 +0000 (15:21 +1100)]
ctdb-include: Group function prototypes from server/ctdb_ltdb_server.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_logging_syslog.c
Amitay Isaacs [Fri, 23 Oct 2015 04:15:28 +0000 (15:15 +1100)]
ctdb-include: Group function prototypes from server/ctdb_logging_syslog.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_logging_file.c
Amitay Isaacs [Fri, 23 Oct 2015 04:14:53 +0000 (15:14 +1100)]
ctdb-include: Group function prototypes from server/ctdb_logging_file.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_logging.c
Amitay Isaacs [Fri, 23 Oct 2015 04:13:54 +0000 (15:13 +1100)]
ctdb-include: Group function prototypes from server/ctdb_logging.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_lock.c
Amitay Isaacs [Fri, 23 Oct 2015 04:10:48 +0000 (15:10 +1100)]
ctdb-include: Group function prototypes from server/ctdb_lock.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_keepalive.c
Amitay Isaacs [Fri, 23 Oct 2015 04:08:51 +0000 (15:08 +1100)]
ctdb-include: Group function prototypes from server/ctdb_keepalive.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_freeze.c
Amitay Isaacs [Fri, 23 Oct 2015 04:08:05 +0000 (15:08 +1100)]
ctdb-include: Group function prototypes from server/ctdb_freeze.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_daemon.c
Amitay Isaacs [Fri, 23 Oct 2015 04:04:17 +0000 (15:04 +1100)]
ctdb-include: Group function prototypes from server/ctdb_daemon.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_control.c
Amitay Isaacs [Fri, 23 Oct 2015 03:58:14 +0000 (14:58 +1100)]
ctdb-include: Group function prototypes from server/ctdb_control.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_call.c
Amitay Isaacs [Fri, 23 Oct 2015 03:56:00 +0000 (14:56 +1100)]
ctdb-include: Group function prototypes from server/ctdb_call.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from server/ctdb_banning.c
Amitay Isaacs [Fri, 23 Oct 2015 03:48:44 +0000 (14:48 +1100)]
ctdb-include: Group function prototypes from server/ctdb_banning.c

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Group function prototypes from tcp and ib
Amitay Isaacs [Fri, 23 Oct 2015 03:47:09 +0000 (14:47 +1100)]
ctdb-include: Group function prototypes from tcp and ib

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Separate prototypes for common client/server functions
Amitay Isaacs [Fri, 23 Oct 2015 03:17:34 +0000 (14:17 +1100)]
ctdb-daemon: Separate prototypes for common client/server functions

This groups function prototypes for common client/server functions in
common/common.h and removes them from ctdb_private.h.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-common: Add missing prototype for ctdb_cmdline_client()
Amitay Isaacs [Tue, 27 Oct 2015 04:26:26 +0000 (15:26 +1100)]
ctdb-common: Add missing prototype for ctdb_cmdline_client()

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-build: Calculate correct version when building from tarball
Amitay Isaacs [Fri, 23 Oct 2015 02:05:20 +0000 (13:05 +1100)]
ctdb-build: Calculate correct version when building from tarball

When building standalone ctdb from git repo, samba_version_file correctly
includes git sha in VERSION string.  When building standalone ctdb from
tarball, samba_version_file puts UNKNOWN in the VERSION string.

Use the packaged include/ctdb_version.h file to set the correct git sha.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Remove unused header file include/internal/includes.h
Amitay Isaacs [Tue, 13 Oct 2015 06:57:49 +0000 (17:57 +1100)]
ctdb-daemon: Remove unused header file include/internal/includes.h

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Remove dependency on includes.h
Amitay Isaacs [Mon, 26 Oct 2015 05:50:46 +0000 (16:50 +1100)]
ctdb-daemon: Remove dependency on includes.h

Instead of includes.h, include the required header files explicitly.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Stop using tevent compatibility definitions
Amitay Isaacs [Mon, 26 Oct 2015 05:50:09 +0000 (16:50 +1100)]
ctdb-daemon: Stop using tevent compatibility definitions

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-include: Move include/internal/cmdline.h to common/
Amitay Isaacs [Tue, 13 Oct 2015 04:19:59 +0000 (15:19 +1100)]
ctdb-include: Move include/internal/cmdline.h to common/

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Separate prototypes for system specific functions
Amitay Isaacs [Fri, 23 Oct 2015 03:11:53 +0000 (14:11 +1100)]
ctdb-daemon: Separate prototypes for system specific functions

This groups function prototypes for system specific functions in
common/system.h and removes them from ctdb_private.h.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoKCC: allow --test-all-reps-from to work with --import-ldif
Douglas Bagnall [Tue, 23 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: allow --test-all-reps-from to work with --import-ldif

The ldif files lack information that a normal database has, which means
the ldif import function has to use some trickery to set the local DSA.
Once the local DSA is thus set, the fake database is a bit useless from
the point of view of other DSAs. We get around this by re-importing it
each time.

This is doing something slightly different than the normal samdb
--test-all-reps-from, in that the changes are not preserved between each
DSA's run. With the samdb database (unless using --readonly), the later
DSA's will see changes the early ones made. The ordering is arbitrary.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Oct 29 08:11:54 CET 2015 on sn-devel-104

8 years agoKCC: samba_kcc --tmpdb X won't run if X already exists
Douglas Bagnall [Tue, 23 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: samba_kcc --tmpdb X won't run if X already exists

Part of an ongoing safety campaign, making it harder to overwrite
your valuable things while keeping it easy enough to test crazy schemes.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: with --import-ldif, don't default to standard DB url
Douglas Bagnall [Tue, 23 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: with --import-ldif, don't default to standard DB url

Before samba_kcc would always assume `-H /usr/local/whatever`, and this
interacted badly with the likes of `--test-all-reps-from` and
`--forget-intersite-links`.  When I say badly, I mean it crashed because
the file is absent on my dev machine.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: kcc.import_ldif doesn't need creds
Douglas Bagnall [Tue, 23 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: kcc.import_ldif doesn't need creds

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: remove NTDSConnection API methods that are never used
Douglas Bagnall [Tue, 23 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: remove NTDSConnection API methods that are never used

These are not used, and using them would not be considered Pythonic. The
flags they alter are always changed directly.

The similar set_modified() method IS used.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: whitespace for pep8
Douglas Bagnall [Tue, 23 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: whitespace for pep8

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: fix pep8 line length in load_ip_transport()
Douglas Bagnall [Tue, 23 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: fix pep8 line length in load_ip_transport()

You are right to sigh about this one.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: Correct capitalisation of KCCError
Douglas Bagnall [Mon, 22 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: Correct capitalisation of KCCError

previously we had "raise KccError", which of course would raise a
NameError.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: raise KCCError, not Exception, in multiple places
Douglas Bagnall [Mon, 22 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: raise KCCError, not Exception, in multiple places

"except Exception" lines will still catch them, but more fine-grained
control is possible.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: NTDSConnection.load_connection() requires objectGUID
Douglas Bagnall [Mon, 22 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: NTDSConnection.load_connection() requires objectGUID

If there is no GUID, that is an error, so we raise an exception instead
of stepping around it.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: remove debug print statements from intrasite and intersite
Douglas Bagnall [Mon, 22 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: remove debug print statements from intrasite and intersite

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: load samdb before calling kcc.run()
Douglas Bagnall [Mon, 22 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: load samdb before calling kcc.run()

kcc.run() is a mega-function that does nearly everything, including
loading the database. The --list-valid-dsas and --test-all-reps-from
tasks also want to load the database, but not do all that other run()
stuff, so it makes sense to pull it out. When the samdb has not been
loaded, run() will still load it -- this avoids having to change all
the tests.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: load the object GUID with --import-ldif
Douglas Bagnall [Mon, 22 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: load the object GUID with --import-ldif

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: avoid logging alarming things about exected events
Douglas Bagnall [Mon, 22 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: avoid logging alarming things about exected events

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: shift --test-all-reps-from call to after kcc loading
Douglas Bagnall [Wed, 17 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: shift --test-all-reps-from call to after kcc loading

This is in an effort to allow --test-all-reps-from to work with
--import-ldif (though so far it doesn't for other reasons). Rather than
replicate all the ldif loading logic within test_all_reps_from, we just
wait delay the test_all_reps_from() call.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: Simplify RNG seeding logic, dropping the default value
Douglas Bagnall [Wed, 17 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: Simplify RNG seeding logic, dropping the default value

There is no particular justification for the previous default, other
than being deterministic makes testing more reliable. The algorithms
using randomness do not assume determinism.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: more debug info when --import-ldif goes badly
Douglas Bagnall [Wed, 17 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: more debug info when --import-ldif goes badly

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: default to not loading new samdb when we already have one
Douglas Bagnall [Wed, 17 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: default to not loading new samdb when we already have one

This should make things simpler in the --import-ldif case.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: fix typo in error path
Douglas Bagnall [Wed, 17 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: fix typo in error path

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: better explain our confusion in colour_vertices comment
Douglas Bagnall [Wed, 10 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: better explain our confusion in colour_vertices comment

Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: clarify debugging messages in bridgehead finding code
Douglas Bagnall [Wed, 10 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: clarify debugging messages in bridgehead finding code

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: keep track of IP transport for dsa.new_connection()
Douglas Bagnall [Wed, 10 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: keep track of IP transport for dsa.new_connection()

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: set system flags for new intrasite connections
Douglas Bagnall [Wed, 10 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: set system flags for new intrasite connections

These flags are mandatory for intrasite connections.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: correctly use dsa.new_connection() system_flags argument
Douglas Bagnall [Wed, 10 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: correctly use dsa.new_connection() system_flags argument

The dsa.system_flags attribute is important and gets saved in the
database, but was never getting altered because we were setting dsa.flags
instead.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: Use detect_failed in create_connections
Garming Sam [Fri, 26 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: Use detect_failed in create_connections

Without this, dead DCs were treated as live, and could be used in the
tree. If they're in the tree they can split the network.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: remove useless comments and simplify get_dsa_for_implied_replica()
Douglas Bagnall [Thu, 25 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: remove useless comments and simplify get_dsa_for_implied_replica()

These comments are a close reflection (or possibly copy/paste) of the
spec, but our code here no longer resembles the spec. We end up just
glazing over when we see comments and losing track of the flow of code.

If you want the spec just look at the spec.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: stop --forget-intersite-links forgetting local links
Douglas Bagnall [Thu, 25 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: stop --forget-intersite-links forgetting local links

It will still forget intrasite links on other sites, but that in theory
should not matter.

It will still break your network, and is only useful for debugging.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: simplify get_dsa_for_implied_replica(), using IP invariant
Douglas Bagnall [Thu, 25 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: simplify get_dsa_for_implied_replica(), using IP invariant

We only do IP transports. Therfore the long list of alternatives...

                   (not n_rep.is_domain() or
                    n_rep.is_partial() or
                    cn_conn.transport_dnstr is None or
                    cn_conn.transport_dnstr.find("CN=IP") == 0)

that ends with the equivalant of "is this IP?" always evaluates to True.

If we leave it there it will confuse people for ever.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: Share commit wrapper between forget_ntdsconn and intrasite
Douglas Bagnall [Thu, 25 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: Share commit wrapper between forget_ntdsconn and intrasite

The wrapper is only to create DEBUG output in read-only mode --
normally it amounts to `dsa.commit_connections(self.samdb)`.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: pull apart remove_unneeded_ntdsconn(), fixing intersite
Douglas Bagnall [Thu, 25 Jun 2015 04:38:29 +0000 (16:38 +1200)]
KCC: pull apart remove_unneeded_ntdsconn(), fixing intersite

The confusing big mess was hiding bugs. Firstly, intersite links on
non-intersite-topology-generators were not getting looked at. Secondly,
the logic around superseding intersite links was missing.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoKCC: shift common is_generated() check out of branches
Douglas Bagnall [Wed, 17 Jun 2015 03:11:20 +0000 (15:11 +1200)]
KCC: shift common is_generated() check out of branches

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agos4:torture: fix a comment typo.
Michael Adam [Wed, 28 Oct 2015 19:41:33 +0000 (20:41 +0100)]
s4:torture: fix a comment typo.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Oct 29 00:42:49 CET 2015 on sn-devel-104

8 years agobuild:wafsamba: Removed hard-coded class names from build scripts
Thomas Nagy [Wed, 28 Oct 2015 20:04:28 +0000 (21:04 +0100)]
build:wafsamba: Removed hard-coded class names from build scripts

Using hard-coded class names prevents subclassing and make it hard
to reason about the workflow. The wscript files read during the build
must be read during the installation phase as well.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoldb: Fix a "ignoring return value" warning
Volker Lendecke [Tue, 23 Jun 2015 16:29:53 +0000 (18:29 +0200)]
ldb: Fix a "ignoring return value" warning

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Oct 28 19:04:15 CET 2015 on sn-devel-104

8 years agomessages: messages.h needs data_blob.h
Volker Lendecke [Sun, 12 Jul 2015 12:33:55 +0000 (14:33 +0200)]
messages: messages.h needs data_blob.h

Normally it somehow comes via includes.h, but if you want to directly
include messages.h you need this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoexamples: Fix unchecked result warnings
Volker Lendecke [Tue, 30 Jun 2015 18:41:55 +0000 (20:41 +0200)]
examples: Fix unchecked result warnings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolib: Remove a includes.h reference
Volker Lendecke [Sun, 12 Jul 2015 16:45:18 +0000 (18:45 +0200)]
lib: Remove a includes.h reference

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolib: Include samba_util.h in server_id_db.h
Volker Lendecke [Sun, 12 Jul 2015 16:43:35 +0000 (18:43 +0200)]
lib: Include samba_util.h in server_id_db.h

Usually this came in via server_id.h's includes.h. This will go.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agolib: dbwrap_local_open references loadparm_context
Volker Lendecke [Wed, 28 Oct 2015 11:29:50 +0000 (12:29 +0100)]
lib: dbwrap_local_open references loadparm_context

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agosmbd: Fix a comment
Volker Lendecke [Wed, 28 Oct 2015 11:04:56 +0000 (12:04 +0100)]
smbd: Fix a comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
8 years agoctdb-include: Remove unused header file include/ctdb_typesafe_cb.h
Amitay Isaacs [Tue, 13 Oct 2015 04:36:38 +0000 (15:36 +1100)]
ctdb-include: Remove unused header file include/ctdb_typesafe_cb.h

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Oct 28 15:59:02 CET 2015 on sn-devel-104

8 years agoctdb-include: Remove unused header file include/ctdb.h
Amitay Isaacs [Tue, 13 Oct 2015 04:22:57 +0000 (15:22 +1100)]
ctdb-include: Remove unused header file include/ctdb.h

This was part of libctdb which has been removed.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agobuild:wafsamba: removed most import * statements
Thomas Nagy [Tue, 27 Oct 2015 19:46:46 +0000 (20:46 +0100)]
build:wafsamba: removed most import * statements

The 'import *' statements make it more difficult to reason about
the modules and tends to conceal bugs. These changes enable running
pyflakes against most of the build scripts.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 28 12:52:17 CET 2015 on sn-devel-104

8 years agolib: util: Make non-critical message a warning.
Jeremy Allison [Wed, 28 Oct 2015 00:08:50 +0000 (17:08 -0700)]
lib: util: Make non-critical message a warning.

Non-root utilities (e.g. bin/net) call this via messaging_init().

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 years agoctdb-scripts: Fix an incorrect comment
Martin Schwenke [Wed, 21 Oct 2015 03:18:22 +0000 (14:18 +1100)]
ctdb-scripts: Fix an incorrect comment

Since commit 84f5528d9b526b1e9cb02c245e816c0c5e54c3bc, CTDB will not
remove an existing socket if it can connect to the existing one.
Instead it will fail to start.

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): Wed Oct 28 09:44:37 CET 2015 on sn-devel-104

8 years agoctdb-scripts: Remove PID file only if it existed
Martin Schwenke [Wed, 21 Oct 2015 03:12:40 +0000 (14:12 +1100)]
ctdb-scripts: Remove PID file only if it existed

If 2 attempts are made to start CTDB in quick succession then it is
possible for the 2nd attempt to remove a newly created PID file from
the 1st.

If the PID file existed then the PID/SID from ctdbd_is_running() will
be passed to kill_ctdbd().  If the PID file did not exist then there
is no point removing it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
8 years agoctdb: open the RO tracking db with perms 0600 instead of 0000
Michael Adam [Tue, 27 Oct 2015 09:20:31 +0000 (10:20 +0100)]
ctdb: open the RO tracking db with perms 0600 instead of 0000

While 0000 is possible from the UNIX/POSIX point of view,
these permissions create problems in an environment with
selinux enabled, which is more strict.

This aligns the perms of the read only tracking db with other
internal dbs.

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

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): Wed Oct 28 06:13:09 CET 2015 on sn-devel-104

8 years agobuild: --picky-developer implies --enable-developer
Martin Schwenke [Tue, 27 Oct 2015 01:06:25 +0000 (12:06 +1100)]
build: --picky-developer implies --enable-developer

Have --picky-developer enable --enable-developer too, instead of
requiring both options to be specified.  This makes it obey the
principle of least surprise.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Oct 27 07:19:33 CET 2015 on sn-devel-104

8 years agoctdb-build: Define CTDB_SOCKET at configure time
Amitay Isaacs [Mon, 26 Oct 2015 04:58:36 +0000 (15:58 +1100)]
ctdb-build: Define CTDB_SOCKET at configure time

Currently only Samba is built with CTDB and since CTDB headers are not
public any more, no other application can build with CTDB.  So define
CTDB_SOCKET only during build.

In future CTDB will have public API and proper way of figuring out
CTDB_SOCKET.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-tool: Remove repack command
Amitay Isaacs [Fri, 23 Oct 2015 03:24:48 +0000 (14:24 +1100)]
ctdb-tool: Remove repack command

The databases are repacked automatically during vacuuming when the
freelist size grows beyond configured threshold (RepackLimit).

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-ib: Fix build for infiniband transport
Amitay Isaacs [Tue, 13 Oct 2015 05:19:21 +0000 (16:19 +1100)]
ctdb-ib: Fix build for infiniband transport

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agoctdb-daemon: Keep protocol.h in sync with ctdb_protocol.h
Amitay Isaacs [Fri, 23 Oct 2015 08:10:28 +0000 (19:10 +1100)]
ctdb-daemon: Keep protocol.h in sync with ctdb_protocol.h

ctdb_protocol.h was modified to update default capabilities without
corresponding changes in protocol.h.

(Patch dfc84fdd45a9bd763289b4965bc2d0a3e7071ff0)

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
8 years agobuild:wafsamba: dead code removal in gettext detection
Thomas Nagy [Sun, 25 Oct 2015 12:30:59 +0000 (13:30 +0100)]
build:wafsamba: dead code removal in gettext detection

Since the --gettext-location command-line option has no effect, the misleading
code is removed. The samba functions ADD_CFLAGS must also be used in the future

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Oct 27 03:34:28 CET 2015 on sn-devel-104

8 years agoselftest: Avoid system krb5.conf in "none" test env
Uri Simchoni [Mon, 26 Oct 2015 05:38:08 +0000 (07:38 +0200)]
selftest: Avoid system krb5.conf in "none" test env

Some torture tests do not perform Kerberos activity and do not
run against a server (hence the "none" test env), but do create
a krb5 context, and that causes the Kerberos libs to read
krb5.conf and choke if they don't understand it.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoselftest: Avoid system krb5.conf in some test envs that don't use kerberos
Uri Simchoni [Sun, 25 Oct 2015 13:02:17 +0000 (15:02 +0200)]
selftest: Avoid system krb5.conf in some test envs that don't use kerberos

Some test envs don't use kerberos (e.g. nt4_dc). However, the client
tools are built with Kerberos support and may get upset if hitting
a krb5.conf file they don't understand.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoselftest: Avoid system krb5.conf in testenv provisioning
Uri Simchoni [Fri, 23 Oct 2015 21:41:23 +0000 (00:41 +0300)]
selftest: Avoid system krb5.conf in testenv provisioning

Some provisioning commands don't necessarily need a krb5.conf,
but they still must cause samba's Kerberos libraries to avoid
looking at the system krb5.conf, as this file may not be understood
by samba's Kerberos libs and fail the env provisioning.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoDocumentation : Add GitHub notes to README.
Scott Lovenberg [Tue, 20 Oct 2015 19:20:10 +0000 (12:20 -0700)]
Documentation : Add GitHub notes to README.

Signed-off-by: Scott Lovenberg <scott.lovenberg@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
8 years agoWHATSNEW: Describe nss_wins changes
Andreas Schneider [Mon, 26 Oct 2015 18:53:58 +0000 (19:53 +0100)]
WHATSNEW: Describe nss_wins changes

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Oct 27 00:27:22 CET 2015 on sn-devel-104

8 years agonss_wins: Use libwbclient to query wins server
Andreas Schneider [Fri, 23 Oct 2015 10:31:43 +0000 (12:31 +0200)]
nss_wins: Use libwbclient to query wins server

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agonss_wins: Use lp_global_no_reinit()
Andreas Schneider [Fri, 23 Oct 2015 13:28:23 +0000 (15:28 +0200)]
nss_wins: Use lp_global_no_reinit()

This avoids that we run into use after free issues when we access memory
allocated on the globals and the global being reinitialized.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 years agoselftest: Confirm a demote of a real network works
Andrew Bartlett [Fri, 23 Oct 2015 02:38:23 +0000 (15:38 +1300)]
selftest: Confirm a demote of a real network works

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Oct 26 08:17:47 CET 2015 on sn-devel-104

8 years agoselftest: Add sample provision of master-c596ac6 with multiple DCs
Andrew Bartlett [Fri, 23 Oct 2015 02:05:25 +0000 (15:05 +1300)]
selftest: Add sample provision of master-c596ac6 with multiple DCs

This will let us test demoting a DC from a multi-DC network

Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
8 years agoAdd samba4.smb2.create.mkdir-dup(ad_dc_ntvfs) as flapping
Andrew Bartlett [Wed, 21 Oct 2015 23:01:48 +0000 (12:01 +1300)]
Add samba4.smb2.create.mkdir-dup(ad_dc_ntvfs) as flapping

This test sometimes succeeds, depending on the build environment.

(Corrects earlier patch to also remove from knownfail)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11486
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agosamba-tool domain demote: Add support for removing by NTDS GUID
Andrew Bartlett [Tue, 20 Oct 2015 00:48:07 +0000 (13:48 +1300)]
samba-tool domain demote: Add support for removing by NTDS GUID

This would help remove a DC that is a conflict record, for example

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agosamba-tool domain demote: Add --verbose and --quiet options
Andrew Bartlett [Fri, 16 Oct 2015 00:47:29 +0000 (13:47 +1300)]
samba-tool domain demote: Add --verbose and --quiet options

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agosamba-tool domain demote: Remove dns-SERVER object as well
Andrew Bartlett [Fri, 16 Oct 2015 00:00:20 +0000 (13:00 +1300)]
samba-tool domain demote: Remove dns-SERVER object as well

This object is not in standard AD, but Marc Muehlfeld
correctly notes that Samba creates it for BIND9_DLZ

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agosamba-tool domain demote: Remove all references to the demoted host, even in DNS
Andrew Bartlett [Wed, 14 Oct 2015 03:57:31 +0000 (16:57 +1300)]
samba-tool domain demote: Remove all references to the demoted host, even in DNS

We search the in-directory DNS records for entries that point to the
name or IP that the dead DC was using, and remove them

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agopydns: Add replace_by_dn()
Andrew Bartlett [Wed, 14 Oct 2015 03:56:41 +0000 (16:56 +1300)]
pydns: Add replace_by_dn()

This allows us to find a DNS record by searching LDB and unpacking the dnsRecord
but replace the record using the common code that will create a tombstone

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agosamba-tool domain demote: Use dn.add_base/dn.add_child
Andrew Bartlett [Fri, 23 Oct 2015 00:12:03 +0000 (13:12 +1300)]
samba-tool domain demote: Use dn.add_base/dn.add_child

This is done primarilly to set the pattern that we should manipulate ldb.Dn values
with the helper routines, not just by concatonation via format strings.

We also restrict our exception hadling to only the expected errors, not
all errors.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agosamba-tool domain demote: Remove correct DNs and from the correct locations
Andrew Bartlett [Fri, 23 Oct 2015 00:05:24 +0000 (13:05 +1300)]
samba-tool domain demote: Remove correct DNs and from the correct locations

The previous code missed the CN=DFSR-GlobalSettings children and did
not cope with subdomains.  The root DN may not be the domain DN if
we are a subdomain.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agodns_server: Give WERR_DNS_ERROR_NAME_DOES_NOT_EXIST on empty records
Andrew Bartlett [Tue, 13 Oct 2015 22:59:26 +0000 (11:59 +1300)]
dns_server: Give WERR_DNS_ERROR_NAME_DOES_NOT_EXIST on empty records

When not looking for tombstones, a record without a dnsRecord value may as
well not be present, so just return WERR_DNS_ERROR_NAME_DOES_NOT_EXIST

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agoselftest: Add tests confirming the demote actually removes objects
Andrew Bartlett [Tue, 13 Oct 2015 03:41:44 +0000 (16:41 +1300)]
selftest: Add tests confirming the demote actually removes objects

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agosamba-tool domain demote: Refuse to remove ourself
Andrew Bartlett [Tue, 13 Oct 2015 02:26:20 +0000 (15:26 +1300)]
samba-tool domain demote: Refuse to remove ourself

This ensures that a different server is the one being demoted from the local database

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agoselftest: Run samba-tool domain demote while we have a clone of the DB handy
Andrew Bartlett [Tue, 13 Oct 2015 02:23:55 +0000 (15:23 +1300)]
selftest: Run samba-tool domain demote while we have a clone of the DB handy

This avoids needing to run the demote on the main replicated DB
of the selftest system

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agosamba-tool domain demote: Rework to allow cleanup of partial demotion, catch more...
Andrew Bartlett [Thu, 24 Sep 2015 02:07:51 +0000 (14:07 +1200)]
samba-tool domain demote: Rework to allow cleanup of partial demotion, catch more errors

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agoselftest: Make it clear that the first argument to KCC.run() is unused
Andrew Bartlett [Tue, 22 Sep 2015 03:51:33 +0000 (15:51 +1200)]
selftest: Make it clear that the first argument to KCC.run() is unused

This is unused because we have already provided a database via import_ldif

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
8 years agoselftest: Run demote test against the RODC environment also
Andrew Bartlett [Tue, 22 Sep 2015 03:40:00 +0000 (15:40 +1200)]
selftest: Run demote test against the RODC environment also