1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

112514 Commits

Author SHA1 Message Date
Volker Lendecke
9ec47b3cff dsdb: Fix typos
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-13 10:30:15 +02:00
Volker Lendecke
c4039232e3 dsdb: Fix CID 1436918 Unchecked return value
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-13 10:30:15 +02:00
Volker Lendecke
2678b4c25f dsdb: Fix CID 1436919 Unchecked return value
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-13 10:30:15 +02:00
Volker Lendecke
7f754843f5 dsdb: Fix CID 1436920 Unchecked return value
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-13 10:30:15 +02:00
Timur I. Bakeyev
83cd68c8ae Fix UDP DNS queries in addns
The addns code tries to use common approach for TCP and UDP queries,
calling connect() for both types of sockets. In case of UDP that
requires to use send() instead of sendto().

Signed-off-by: Timur I. Bakeyev <timur@iXsystems.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 13 03:51:04 CEST 2018 on sn-devel-144
2018-06-13 03:51:04 +02:00
Stefan Metzmacher
454edac226 python: call fault_setup() if samba.getopt is used
This means we have a samba command line tool written in python,
e.g. samba-tool

We should get the samba typicall backtraces instead of
just "Segmentation fault (core dumped)".

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jun 12 11:04:55 CEST 2018 on sn-devel-144
2018-06-12 11:04:55 +02:00
Stefan Metzmacher
3ddd852710 python: export fault_setup() to python bindings
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13469

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-06-12 08:13:21 +02:00
Douglas Bagnall
b9a323a27c python/drs_utils: fix repeated typo
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Jun 10 21:41:33 CEST 2018 on sn-devel-144
2018-06-10 21:41:33 +02:00
Douglas Bagnall
153252a55e python/join: fix a typo
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:20 +02:00
Douglas Bagnall
2d8cc50d39 sambatool visualize: add up-to-dateness visualization
Or more accurately, out-of-dateness visualization, which shows how far
each DCs is from every other using the difference in the up-to-dateness
vectors.

An example usage is

samba-tool visualize uptodateness -r -S -H ldap://somewhere \
      -UAdministrator --color=auto --partition=DOMAIN

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:20 +02:00
Douglas Bagnall
04a773f30f samba-tool visualize ntdsconn: properly sort/group vertices
The vertex is now a tuple, with the RODC state added.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:20 +02:00
Douglas Bagnall
c3ad137eb6 samba-tool visualize: fix wrong variable name in get_partition()
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:20 +02:00
Douglas Bagnall
d8bbe1da93 python/graph: don't crash colourer on bad link
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:20 +02:00
Douglas Bagnall
8792609404 python/graph: use '>' for excessive numbers, not '+'
'+' already has another meaning in these graphs.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:20 +02:00
Douglas Bagnall
02bca5590c python/graph: add full_matrix graph function
This makes an ASCII/ANSI art picture like distance_matrix(), but from
a full matrix, not a list of adjacencies as in the distance_matrix case.

This will be used to visualise up-to-dateness vectors.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:20 +02:00
Douglas Bagnall
6813e1b3c2 python/graph: rework shorten_vertex_names to not need edges
This will be necessary for the forthcoming full_matrix function.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:20 +02:00
Douglas Bagnall
4f7638f8ab python/samba/graph: use look up table for ascii-art charsets
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:20 +02:00
Douglas Bagnall
9353a580f8 samba-tool visualize: separate dot options from common options
because not all sub-commands make dot format

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:19 +02:00
Douglas Bagnall
7e001b2741 samba-tool visualise: helper for getting the partition
Repeated code becomes a function.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:19 +02:00
Douglas Bagnall
3f25e0b231 python/graph: tweak colour schemes for distance charts
This works a bit better in terminals with white text.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:19 +02:00
Douglas Bagnall
50e3bfa4f5 samba-tool drs showrepl: add a --verbose flag
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:19 +02:00
Douglas Bagnall
99aabf436d samba-tool drs showrepl: generalise the way output mode is chosen
We have a couple more output modes coming along, so it makes senses to
untangle .run() into a number of independent sub-methods.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:19 +02:00
Douglas Bagnall
92fff57f0c samba-tool drs showrepl tests: don't assert existence of DNS partitions
Because their existence is uncertain immediately after provision,
when these tests will run under some circumstances.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:19 +02:00
Douglas Bagnall
f27a700e69 python/kcc/graph_utils: short-cut edge failure test without edges
Otherwise we get an exception because itertools.combinations is asked
to find combinations with negative size.

Instead we assert the graph is connected as-is, which in this case is
the same as asserting there are no vertices.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:19 +02:00
Gary Lockyer
e5c0e6da65 lib/audit_logging fix flapping test
Add an adjustment to the before and after values to cater for the
occasional differences between the calculated times.

The exact value of the time stamp is not important what is important is
that is correctly formatted and that the value is reasonable i.e. it's
close enough to the current time.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-10 19:02:19 +02:00
Andrew Bartlett
81f7ecc2a7 dsdb: Use ldb_init() to make the ldb_context in dsdb audit tests
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun  9 17:42:38 CEST 2018 on sn-devel-144
2018-06-09 17:42:38 +02:00
Gary Lockyer
1b07f13372 dsdb: add defines for sessionInfo and networkSessionInfo
Replace uses of the string "sessionInfo" with the constant
DSDB_SESSION_INFO, and "networkSessionInfo" with the constant
DSDB_NETWORK_SESSION_INFO.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-09 15:02:11 +02:00
Gary Lockyer
d4deb800e2 dsdb: Audit group membership changes
Log details of Group membership changes and User Primary Group changes.
Changes are logged in human readable and if samba has been built with
JANSSON support in JSON format.

Replicated updates are not logged.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-09 15:02:11 +02:00
Gary Lockyer
1c0f743c2d dsdb: audit samdb and password changes
Add audit logging of DSDB operations and password changes, log messages
are logged in human readable format and if samba is commpile with
JANSSON support in JSON format.

Log:
  * Details all DSDB add, modify and delete operations. Logs
    attributes, values, session details, transaction id.
  * Transaction roll backs.
  * Prepare commit and commit failures.
  * Summary details of replicated updates.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-09 15:02:11 +02:00
Günther Deschner
7ddbf6035d s4-heimdal: Fix the format-truncation errors.
../source4/heimdal/lib/com_err/compile_et.c: In function ‘generate_h’:
../source4/heimdal/lib/com_err/compile_et.c:138:33: error: ‘%s’ directive output may be truncated writing up to 127 bytes into a region of size 126 [-Werror=format-truncation=]
     snprintf(fn, sizeof(fn), "__%s__", hfn);
                                 ^~     ~~~
../source4/heimdal/lib/com_err/compile_et.c:138:5: note: ‘snprintf’ output between 5 and 132 bytes into a destination of size 128
     snprintf(fn, sizeof(fn), "__%s__", hfn);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../source4/heimdal/lib/com_err/compile_et.c: In function ‘main’:
../source4/heimdal/lib/com_err/compile_et.c:234:35: error: ‘.h’ directive output may be truncated writing 2 bytes into a region of size between 1 and 128 [-Werror=format-truncation=]
     snprintf(hfn, sizeof(hfn), "%s.h", Basename);
                                   ^~
../source4/heimdal/lib/com_err/compile_et.c:234:5: note: ‘snprintf’ output between 3 and 130 bytes into a destination of size 128
     snprintf(hfn, sizeof(hfn), "%s.h", Basename);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../source4/heimdal/lib/com_err/compile_et.c:235:35: error: ‘.c’ directive output may be truncated writing 2 bytes into a region of size between 1 and 128 [-Werror=format-truncation=]
     snprintf(cfn, sizeof(cfn), "%s.c", Basename);
                                   ^~
../source4/heimdal/lib/com_err/compile_et.c:235:5: note: ‘snprintf’ output between 3 and 130 bytes into a destination of size 128
     snprintf(cfn, sizeof(cfn), "%s.c", Basename);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

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

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jun  8 13:23:51 CEST 2018 on sn-devel-144
2018-06-08 13:23:51 +02:00
Jeremy Allison
ae4e54563e WHATSNEW.txt: Updated with VFS ABI changes for 4.9.0.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>

Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Thu Jun  7 13:48:25 CEST 2018 on sn-devel-144
2018-06-07 13:48:25 +02:00
Joe Guo
0fb122af50 tests/demote: replace demote test bash script to python
Convert bash script to python and add demote and dns remove test on top.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Thu Jun  7 04:21:17 CEST 2018 on sn-devel-144
2018-06-07 04:21:17 +02:00
Joe Guo
00494a6510 netcmd/domain: remove dns records after DC demote
Call `remove_dc.remove_dns_references()` at the end of demote cmd.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-06-07 01:46:25 +02:00
Joe Guo
ab28a64f5e netcmd/domain: fix a typo in message
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2018-06-07 01:46:25 +02:00
Swen Schillig
d445704050 ctdb-daemon: CID 1435732: Argument cannot be negative
Negative parameter passed to function which cannot take negative values.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Jun  6 01:13:18 CEST 2018 on sn-devel-144
2018-06-06 01:13:18 +02:00
Amitay Isaacs
366f6703e7 ctdb-common: Add support to run events through failure
Usually run_event will stop executing event scripts on first failure.
Optionally it can continue to run events even on failure(s).

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-06-05 22:34:19 +02:00
Amitay Isaacs
e4a5d610b8 ctdb-common: Reset running state on failure
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-06-05 22:34:19 +02:00
Amitay Isaacs
723529e41e ctdb-common: Improve error handling in run_event
If event script directory does not exist, then return ENOTDIR.  If a
directory gets removed at runtime, report error from scandir in
get_script_list().

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-06-05 22:34:19 +02:00
Amitay Isaacs
a3591ed5de ctdb-common: Return script_list for zero scripts
When an event script directory is empty, do not return script_list as
NULL.  Instead return empty script_list with zero scripts.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-06-05 22:34:19 +02:00
Amitay Isaacs
4d27c11ce2 ctdb-common: Rename run_event_script_list to run_event_list
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-06-05 22:34:18 +02:00
Amitay Isaacs
a883f8b092 ctdb-common: Do not initialize run_proc inside run_event
Allowing run_event_init() to take run_proc_context as an argument allows
to create multiple run_event instances with a single run_proc_context.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-06-05 22:34:18 +02:00
Amitay Isaacs
4b04c27377 ctdb-common: Simplify process registration using linked list
The way run_proc abstraction is used in run_event, there can be maximum
of 2 processes active at any given time.  So the memory requirements
can be reduced by using a linked list.

New eventd will have multiple run_event instances but will be limited to
3 or 4.  Even then the total number of processes will be less than 10.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2018-06-05 22:34:18 +02:00
Martin Schwenke
f2e8ab3f02 ctdb-tests: Continue running if a testcase is not executable
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): Tue Jun  5 20:37:15 CEST 2018 on sn-devel-144
2018-06-05 20:37:15 +02:00
Martin Schwenke
f1d07908e2 Revert "ctdb-tests: Continue running if a testcase is not executable"
This reverts commit 36e7043fb1.

An recent change broke this and I forgot to test before posting. :-(

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-06-05 17:47:27 +02:00
Martin Schwenke
4bdf97a935 ctdb-scripts: Change directory for notifications to events/notification
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-06-05 17:47:26 +02:00
Martin Schwenke
b23f3f9960 ctdb-scripts: Event scripts must end with ".script" suffix
Preparation for recommending configuration for each script next to the
actual script.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-06-05 17:47:26 +02:00
Martin Schwenke
12fd8d7a5c ctdb-scripts: Move event scripts to events/legacy/ directory
This is the initial location that will be used by the new
multi-component aware event daemon.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-06-05 17:47:26 +02:00
Andrew Bartlett
0f5d93a0ba dsdb: Honour LDB_FLG_NOSYNC for metadata.tdb
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13462

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jun  4 20:58:01 CEST 2018 on sn-devel-144
2018-06-04 20:58:01 +02:00
Andrew Bartlett
3c3b1bc64c pyldb-samba: Use the same smb.conf variable name as the C wrapper users for LDB_FLG_NOSYNC
This was never noticed as most wrappers on make test run with TDB_NO_FSYNC

However ldb_mdb has not been told to use this (naturally) and so we rely
on the smb.conf setting to not force an fsync().

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-06-04 18:18:11 +02:00
Martin Schwenke
20644011ab ctdb-docs: Update reference to lmaster/recmaster capability options
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Jun  4 12:37:39 CEST 2018 on sn-devel-144
2018-06-04 12:37:39 +02:00