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

103954 Commits

Author SHA1 Message Date
Martin Schwenke
987fd078d2 ctdb-scripts: Avoid shellcheck warnings SC2119, SC2120 (function arguments)
SC2119: Use FUNC "$@" if function's $1 should meanscript's $1.
SC2120: FUNC references arguments, but none are ever passed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
77341f61ba ctdb-scripts: Avoid shellcheck warning SC2002 (useless cat)
SC2002: Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
fc858a13e7 ctdb-scripts: Avoid shellcheck warning SC2017 (arithmetic precision)
SC2017: Increase precision by replacing a/b*c with a*c/b.

This code intentionally rounds to an even value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
0ca00267cd ctdb-scripts: Avoid shellcheck warning SC1004 (backslash in quotes)
SC1004: You don't break lines with \ in single quotes, it results in
literal backslash-linefeed.

These don't hurt, since awk can cope with the continuations.  However,
they don't add anything.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
b208ae73d1 ctdb-scripts: Avoid shellcheck warning SC2154 (unassigned variables)
SC2154: VAR is referenced but not assigned.

Change ctdb_setup_service_state_dir(), ctdb_get_pnn() and
ctdb_get_ip_address() to print the value so it can be assigned to a
variable.  The performance gain from avoiding the sub-shells when
calling these functions is close to zero.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
9255d645f3 ctdb-scripts: Avoid shellcheck warnings SC2046, SC2086 (double-quoting)
SC2046: Quote this to prevent word splitting.
SC2086: Double quote to prevent globbing and word splitting.

Add some quoting where it makes sense.  Use shellcheck directives for
false-positives.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
f6c25a455a ctdb-scripts: Avoid shellcheck warning SC2034 (unused variables)
SC2034: VAR appears unused. Verify it or export it.

Drop some variables that are unnecessarily used.  Use shellcheck
directive for false-positives.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
13b3c6af64 ctdb-scripts: Avoid shellcheck warning SC2004 ($ in arithmetic)
SC2004: $/${} is unnecessary on arithmetic variables.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
efc9af2634 ctdb-scripts: Avoid shellcheck warnings SC2030, SC2031 (subshell variables)
SC2030: Modification of VAR is local (to subshell caused by (..) group).
SC2031: VAR was modified in a subshell. That change might be lost.

Fix a related, incorrect comment.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
0ea90f6170 ctdb-scripts: Avoid shellcheck warning SC2016 ($ in single quotes)
SC2016: Expressions don't expand in single quotes, use double quotes for that.

Error messages are now arguably more readable.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:26 +02:00
Martin Schwenke
113529f05e ctdb-scripts: Drop function ctdb_check_counter()
It is no longer used and adds needless complexity.

As a side-effect, the functions file can now be parsed by shellcheck.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Martin Schwenke
770fe1ff37 ctdb-scripts: Drop use of ctdb_check_counter from vsftpd event script
This makes the logic more obvious.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Martin Schwenke
0825eff3e3 ctdb-scripts: Drop use of ctdb_check_counter from reclock event script
This makes the logic more obvious.

Fix the (probably) accidental fall-through to the regular monitor
failure.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Martin Schwenke
92d0d4489e ctdb-scripts: Drop use of ctdb_check_counter from httpd event script
This makes the logic more obvious.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Martin Schwenke
fc53256c3f ctdb-scripts: Drop use of service_tcp_ports
This makes the logic more obvious.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Martin Schwenke
09a7a7854e ctdb-scripts: Event script indentation and whitespace cleanups
* Re-indent case labels as per new script style

  Other indentation can be tweaked later as code changes, but the
  labels are an obvious bulk change.

* Minor whitespace fixes

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Martin Schwenke
d52409dd95 ctdb-scripts: Drop use of ctdb_standard_event_handler()
It doesn't do anything.  Add a comment to its definition to explain
why it is still there.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Martin Schwenke
5cf45ede3f ctdb-tests: New event script test for corrupt TDB checking
Ensures that backups of corrupt TDB files are correctly limited in
number.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Martin Schwenke
0d60ecf032 ctdb-tests: Add new httpd event script test
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Martin Schwenke
ca28a47cb4 ctdb-tests: Add new vsftpd event script test
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Martin Schwenke
c7a730cbc4 ctdb-tests: Add reclock event script tests
Tweak eventscript unit test infrastructure to support.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Martin Schwenke
91eb421690 ctdb-scripts: Fix a bug in counter checking
If there are insufficient arguments then they can't be shifted.

This function will be removed shortly.  However, it needs to work for
now as tests will be added that depend on it to work.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2016-07-21 02:24:25 +02:00
Stefan Metzmacher
5437fdcffb s4:torture/ndr: add more krb5pac tests with PAC blobs from pkinit
We validate everything except the whole LOGON_INFO structure,
we even decrypt the PAC_CREDENTIALS_INFO blob and verify
PAC_CREDENTIAL_DATA_NDR and PAC_CREDENTIAL_NTLM_SECPKG.

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

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jul 21 01:07:28 CEST 2016 on sn-devel-144
2016-07-21 01:07:28 +02:00
Stefan Metzmacher
4e4cc8e91d s4:torture/ndr: make use of torture_suite_add_ndr_pull_validate_test() in krb5pac when possible
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-07-20 21:27:19 +02:00
Stefan Metzmacher
bb64c550ae krb5_wrap: provide CKSUMTYPE_HMAC_SHA1_96_AES_*
MIT only defined this as CKSUMTYPE_HMAC_SHA1_96_AES128,
while Heimdal has CKSUMTYPE_HMAC_SHA1_96_AES_128.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-07-20 21:27:19 +02:00
Stefan Metzmacher
0e201ecdc5 krb5pac/netlogon: add a comment regarding PAC_LOGON_INFO unique pointers on push
This difference is the reason why we can't fully (ndr)validate some
PAC blobs.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-07-20 21:27:19 +02:00
Andrew Bartlett
a6f672d69f torture: Add another sample of a PAC that broke the old PAC_UPN_DNS_INFO handling
This is included because this sample helped us addres issues in the previous attempt at
handling PAC_UPN_DNS_INFO correctly, and I have Tris's permission to include this in our
tests.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:19 +02:00
Günther Deschner
930dc1a12a s4-torture: add another krb5pac buffer to the ndr test.
This one nicely demonstrates that the strings are really non-null terminated.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:19 +02:00
Günther Deschner
7741e02867 s4-torture: add ndr krb5pac testsuite.
Someone changed the PAC buffer union without adding proper tests, now we
sometimes fail to parse the PAC completely due to that...

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:19 +02:00
Stefan Metzmacher
38527702fd krb5pac.idl: implement PAC_UPN_DNS_INFO correct
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-07-20 21:27:18 +02:00
Stefan Metzmacher
8e458360b4 krb5pac: fix push/pull of subcontexts in PAC_BUFFER
We need to have two subcontexts to get the padding right,
the outer subcontext uses NDR_ROUND(_ndr_size, 8), while
the inner subcontext only uses _ndr_size.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-07-20 21:27:18 +02:00
Günther Deschner
4f5dde6730 krb5pac: no need for a noprint PAC_BUFFER.
Guenther

@@ -1,6 +1,7 @@
 _PUBLIC_ void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER *r)
 {
        ndr_print_struct(ndr, name, "PAC_BUFFER");
+       if (r == NULL) { ndr_print_null(ndr); return; }
        ndr->depth++;
        ndr_print_PAC_TYPE(ndr, "type", r->type);
        ndr_print_uint32(ndr, "_ndr_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?_ndr_size_PAC_INFO(r->info,r->type,0):r->_ndr_size);
@@ -11,7 +12,7 @@
                ndr_print_PAC_INFO(ndr, "info", r->info);
        }
        ndr->depth--;
-       ndr_print_uint32(ndr, "_pad", r->_pad);
+       ndr_print_uint32(ndr, "_pad", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->_pad);
        ndr->depth--;
 }

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:18 +02:00
Andrew Bartlett
7eab12fa63 s4:torture/ndr: Add supplementalCredentials blob from Win2012R2
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:18 +02:00
Andrew Bartlett
9e8228692d s4:torture/ndr: Add supplementalCredentials blobs from alpha13 and release_4_1_0rc3
This coveres the case without AES keys, and before the IDL was changed for SambaGPG support

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:18 +02:00
Stefan Metzmacher
c30dcaee4c s4:torture/ndr: add validation checks for strange supplementalCredentials blobs
From the mail to dochelp:

  I've also got cases (where I created an account with
  UF_NORMAL_ACCOUNT|UF_ACCOUNTDISABLE|UF_SMARTCARD_REQUIRED
  in the LDAP add) with the following strange blobs:

  One time:
  [0000] 00 00 00 00 00 00 00 00 00 00 00 00 00

  and once:
  [0000] 00 00 00 00 00 00 00 00 00 00 00 00 53

  The original issue I reported was the following, a user was created
  with a password and then userAccountControl was changed to
  UF_NORMAL_ACCOUNT|UF_SMARTCARD_REQUIRED. In that case I'm getting:

  [0000] 00 00 00 00 62 00 00 00   00 00 00 00 20 00 20 00
  [0010] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00
  [0020] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00
  [0030] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00
  [0040] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00
  [0050] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00
  [0060] 20 00 20 00 20 00 20 00   20 00 20 00 50 00 30

As you see the last byte (unknown3) is always different on Windows,
but always 0x00 from Samba, so I used 0x00 in order to allow the
test to pass.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-07-20 21:27:18 +02:00
Günther Deschner
5690bc9095 s4-torture: rename torture_suite_add_ndr_pullpush_test to torture_suite_add_ndr_pull_validate_test.
Hoping the new name is not as confusing as the old name.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:17 +02:00
Günther Deschner
cde8ed20e0 torture: show the first differing byte and a dump in torture_assert_data_blob_equal().
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Günther Deschner <gd@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:17 +02:00
Stefan Metzmacher
26d2ea389b drsblobs.idl: supplementalCredentialsSubBlob make it possible to parse strange blobs
Windows omits the uint16 num_packages field when the packages array is empty.
This happens if the UF_SMARTCARD_REQUIRED flag is set for an account.

A user was created with a password and then userAccountControl was changed to
UF_NORMAL_ACCOUNT|UF_SMARTCARD_REQUIRED. In that case I'm getting
(as the whole supplementalCredentialsBlob):

[0000] 00 00 00 00 62 00 00 00   00 00 00 00 20 00 20 00   ....b... .... . .
[0010] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00    . . . .  . . . .
[0020] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00    . . . .  . . . .
[0030] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00    . . . .  . . . .
[0040] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00    . . . .  . . . .
[0050] 20 00 20 00 20 00 20 00   20 00 20 00 20 00 20 00    . . . .  . . . .
[0060] 20 00 20 00 20 00 20 00   20 00 20 00 50 00 30       . . . .  . .P.0

I've also got cases (where I created an account with
UF_NORMAL_ACCOUNT|UF_ACCOUNTDISABLE|UF_SMARTCARD_REQUIRED
in the LDAP add) with the following strange blobs:

One time:
[0000] 00 00 00 00 00 00 00 00   00 00 00 00 00
and once:
[0000] 00 00 00 00 00 00 00 00   00 00 00 00 53

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-07-20 21:27:17 +02:00
Stefan Metzmacher
e9c9615a1f drsblobs.idl: mark supplementalCredentialsSubBlob as nopull,nopush
This commit moves the autogenerated ndr_{pull,push}_supplementalCredentialsSubBlob()
function to the handwritten librpc/ndr/ndr_drsblobs.c

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-07-20 21:27:17 +02:00
Stefan Metzmacher
f9a4d0d2a0 s4:dsdb/password_hash: explicitly set SUPPLEMENTAL_CREDENTIALS_SIGNATURE
Typically this is automatically set in ndr_push_supplementalCredentialsBlob(),
but we need to change that behavior in order to handle strange formated
values.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-07-20 21:27:17 +02:00
Stefan Metzmacher
5c1ce0e7e5 s3:libnet_dssync_keytab: ignore empty supplementalCredentialsBlob structures
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11441

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-07-20 21:27:17 +02:00
Stefan Metzmacher
1be64cb660 s4:kdc: ignore empty supplementalCredentialsBlob structures
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11441

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-07-20 21:27:17 +02:00
Martin Schwenke
d3c890225b ctdb-tools: Avoid uninitialised memory access
==27786== Syscall param write(buf) points to uninitialised byte(s)
==27786==    at 0x62820D0: __write_nocancel (syscall-template.S:84)
==27786==    by 0x428B57: ctdb_queue_send (ctdb_io.c:322)
==27786==    by 0x41F3B1: ctdb_client_queue_pkt (ctdb_client.c:153)
==27786==    by 0x41F3B1: ctdb_client_send_message (ctdb_client.c:603)
==27786==    by 0x419FA3: srvid_broadcast.constprop.26 (ctdb.c:1965)
==27786==    by 0x41B869: control_reload_nodes_file (ctdb.c:5696)
==27786==    by 0x404DBA: main (ctdb.c:6008)
==27786==  Address 0x7ead310 is 144 bytes inside a block of size 168 alloc'd
==27786==    at 0x4C2BBCF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27786==    by 0x564DBEC: __talloc_with_prefix (talloc.c:675)
==27786==    by 0x564DBEC: __talloc (talloc.c:716)
==27786==    by 0x564DBEC: _talloc_named_const (talloc.c:873)
==27786==    by 0x564DBEC: _talloc_zero (talloc.c:2318)
==27786==    by 0x41E1E2: _ctdbd_allocate_pkt (ctdb_client.c:59)
==27786==    by 0x41F37D: ctdb_client_send_message (ctdb_client.c:594)
==27786==    by 0x419FA3: srvid_broadcast.constprop.26 (ctdb.c:1965)
==27786==    by 0x41B869: control_reload_nodes_file (ctdb.c:5696)
==27786==    by 0x404DBA: main (ctdb.c:6008)
==27786==

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:17 +02:00
Martin Schwenke
fac60e5884 ctdb-client: Fix access after free error
State is stolen onto tmp_ctx above so can't be referenced after
tmp_ctx is freed.  So, state->status has to be looked at earlier.

Moving it immediately before the talloc_free(tmp_ctx) isn't sufficient
because invoking the callback appears to cause a recursive call to
ctdb_control_recv(), which also frees state.

Referencing it at the top seems safe.

==23982== Invalid read of size 4
==23982==    at 0x4204AE: ctdb_control_recv (ctdb_client.c:1181)
==23982==    by 0x420645: invoke_control_callback (ctdb_client.c:971)
==23982==    by 0x5E675EC: tevent_common_loop_timer_delay (tevent_timed.c:341)
==23982==    by 0x5E68639: epoll_event_loop_once (tevent_epoll.c:911)
==23982==    by 0x5E66BD6: std_event_loop_once (tevent_standard.c:114)
==23982==    by 0x5E622EC: _tevent_loop_once (tevent.c:533)
==23982==    by 0x4255F7: ctdb_client_async_wait (ctdb_client.c:3385)
==23982==    by 0x42578A: ctdb_client_async_control (ctdb_client.c:3442)
==23982==    by 0x41B405: ctdb_get_nodes_files (ctdb.c:5488)
==23982==    by 0x41B405: check_all_node_files_are_identical (ctdb.c:5530)
==23982==    by 0x41B405: control_reload_nodes_file (ctdb.c:5673)
==23982==    by 0x404DBA: main (ctdb.c:6008)
==23982==  Address 0x7e98d9c is 108 bytes inside a block of size 168 free'd
==23982==    at 0x4C2CDFB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==23982==    by 0x5652692: _tc_free_internal (talloc.c:1125)
==23982==    by 0x5652692: _tc_free_children_internal (talloc.c:1570)
==23982==    by 0x564B952: _tc_free_internal (talloc.c:1081)
==23982==    by 0x564B952: _talloc_free_internal (talloc.c:1151)
==23982==    by 0x564B952: _talloc_free (talloc.c:1693)
==23982==    by 0x4204C9: ctdb_control_recv (ctdb_client.c:1182)
==23982==    by 0x4207AA: async_callback (ctdb_client.c:3350)
==23982==    by 0x4204AD: ctdb_control_recv (ctdb_client.c:1179)
==23982==    by 0x420645: invoke_control_callback (ctdb_client.c:971)
==23982==    by 0x5E675EC: tevent_common_loop_timer_delay (tevent_timed.c:341)
==23982==    by 0x5E68639: epoll_event_loop_once (tevent_epoll.c:911)
==23982==    by 0x5E66BD6: std_event_loop_once (tevent_standard.c:114)
==23982==    by 0x5E622EC: _tevent_loop_once (tevent.c:533)
==23982==    by 0x4255F7: ctdb_client_async_wait (ctdb_client.c:3385)
==23982==  Block was alloc'd at
==23982==    at 0x4C2BBCF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==23982==    by 0x564DBEC: __talloc_with_prefix (talloc.c:675)
==23982==    by 0x564DBEC: __talloc (talloc.c:716)
==23982==    by 0x564DBEC: _talloc_named_const (talloc.c:873)
==23982==    by 0x564DBEC: _talloc_zero (talloc.c:2318)
==23982==    by 0x42017F: ctdb_control_send (ctdb_client.c:1086)
==23982==    by 0x425746: ctdb_client_async_control (ctdb_client.c:3431)
==23982==    by 0x41B405: ctdb_get_nodes_files (ctdb.c:5488)
==23982==    by 0x41B405: check_all_node_files_are_identical (ctdb.c:5530)
==23982==    by 0x41B405: control_reload_nodes_file (ctdb.c:5673)
==23982==    by 0x404DBA: main (ctdb.c:6008)
==23982==

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:17 +02:00
Martin Schwenke
5f57bcc01d ctdb-client: Fix incorrect variable reference
The point of this code is almost certainly to return non-zero when
state->errormsg is set.  So, return state->status if non-zero, -1
otherwise.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:17 +02:00
Andrew Bartlett
7fdb5d2c5c WHATSNEW: Add features added for Samba 4.5
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2016-07-20 21:27:17 +02:00
Garming Sam
a464a897f3 samba-tool: Speed up all samba-tool commands
This in particular helps the docs.py test halve in time (at least on my machine)

NOTE: The removal of enable_null_tracking is required because we are no
longer importing join.py in every single samba-tool invocation. Without
removing this line, memory would be hanging from both the actual NULL
context and the talloc_null_context (causing a segfault at system_exit).

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

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed Jul 20 12:47:24 CEST 2016 on sn-devel-144
2016-07-20 12:47:24 +02:00
Volker Lendecke
698f651786 notifyd: Move BlockSignals calls to server.c
notifyd_send() is called as part of smbd initialization both in normal daemon
mode after a fork, but also in interactive mode. In interactive mode, notifyd
should not modify the global signal state with BlockSignals(). This patch moves
the signal blocking to the place where we know that notifyd is a child daemon.

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): Wed Jul 20 09:04:00 CEST 2016 on sn-devel-144
2016-07-20 09:03:59 +02:00
Volker Lendecke
fa96452f9c smbd: Re-register notify requests
When notifyd is restarted, the parent will broadcast that fact to all workers.
They will then re-register their notify requests.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-20 05:21:07 +02:00
Volker Lendecke
fef0c3d271 smbd: Restart notifyd
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-07-20 05:21:07 +02:00