]> git.ipfire.org Git - thirdparty/samba.git/log
thirdparty/samba.git
6 years agolib ldb ldb_key_value: csbuild unused parm module
Gary Lockyer [Fri, 7 Jun 2019 02:34:44 +0000 (14:34 +1200)] 
lib ldb ldb_key_value: csbuild unused parm module

Fixes csbuild error.

Error: COMPILER_WARNING:
lib/ldb/ldb_key_value/ldb_kv.c: scope_hint: In function
‘ldb_kv_guid_to_key’
lib/ldb/ldb_key_value/ldb_kv.c:157:43: warning: unused parameter
‘module’ [-Wunused-parameter]

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agolib ldb ldb_key_value: csbuild unused parm module
Gary Lockyer [Fri, 7 Jun 2019 02:29:44 +0000 (14:29 +1200)] 
lib ldb ldb_key_value: csbuild unused parm module

Fixes csbuild error.

Error: COMPILER_WARNING:
lib/ldb/ldb_key_value/ldb_kv.c: scope_hint: In function ‘ldb_kv_key_dn’
lib/ldb/ldb_key_value/ldb_kv.c:109:49: warning: unused parameter
‘module’ [-Wunused-para
meter]

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agolib audit_logging tests: csbuild unused parms
Gary Lockyer [Fri, 7 Jun 2019 02:21:41 +0000 (14:21 +1200)] 
lib audit_logging tests: csbuild unused parms

Fixes csbuild unused parameter error:
   warning: unused parameter ‘state’
   warning: unused parameter ‘argc’
   warning: unused parameter ‘argv’

By adding _UNUSED_ to paramter declaration.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoauth auth_log: csbuild unused parm transport_protection
Gary Lockyer [Fri, 7 Jun 2019 01:53:58 +0000 (13:53 +1200)] 
auth auth_log: csbuild unused parm transport_protection

Fixes csbuild errors.

Error: COMPILER_WARNING:
auth/auth_log.c: scope_hint: In function
‘log_successful_authz_event_human_readable’
auth/auth_log.c:728:14: warning: unused parameter ‘transport_protection’
[-Wunused-param
eter]

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoauth auth_log: csbuild unused parm unix_username
Gary Lockyer [Fri, 7 Jun 2019 01:41:35 +0000 (13:41 +1200)] 
auth auth_log: csbuild unused parm unix_username

Fixes csbuild errors

Error: COMPILER_WARNING:
auth/auth_log.c: scope_hint: In function ‘log_authentication_event_json’
auth/auth_log.c:146:14: warning: unused parameter ‘unix_username’
[-Wunused-parameter]

Error: COMPILER_WARNING:
auth/auth_log.c: scope_hint: In function
‘log_authentication_event_human_readable’
auth/auth_log.c:586:14: warning: unused parameter ‘unix_username’
[-Wunused-parameter]

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agotorture: Use two connections in SMB2 sharemode tests
Christof Schmitt [Mon, 3 Jun 2019 18:51:14 +0000 (11:51 -0700)] 
torture: Use two connections in SMB2 sharemode tests

This allows using the unclist option to specify multiple targets, e.g.
for testing against multiple nodes in a clustered Samba environment.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 12 20:02:26 UTC 2019 on sn-devel-184

6 years agolibcli/smb: harden smbXcli_session_shallow_copy against nonce reusage
Stefan Metzmacher [Tue, 11 Jun 2019 15:44:04 +0000 (17:44 +0200)] 
libcli/smb: harden smbXcli_session_shallow_copy against nonce reusage

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jun 12 13:56:19 UTC 2019 on sn-devel-184

6 years agolibcli/smb: s/smbXcli_session_copy/smbXcli_session_shallow_copy
Stefan Metzmacher [Tue, 11 Jun 2019 15:42:38 +0000 (17:42 +0200)] 
libcli/smb: s/smbXcli_session_copy/smbXcli_session_shallow_copy

We should make clear that this is a function for testing only,
with possible strange side effects.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agos4:torture: force signing in the smb2.session.bind1 test
Stefan Metzmacher [Fri, 7 Jun 2019 17:38:26 +0000 (19:38 +0200)] 
s4:torture: force signing in the smb2.session.bind1 test

This test is supposed to test which signing keys are used on
each of the channels, so it's important to require signing.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agolibcli/smb: only fallback to the global smb2 signing key if we should sign
Andreas Schneider [Fri, 7 Jun 2019 17:00:25 +0000 (19:00 +0200)] 
libcli/smb: only fallback to the global smb2 signing key if we should sign

We should only sign if we're asked for it. The signing keys are
always generated, so we were always using global signing key
and signed with it when signing was not asked for.

By luck this was the correct signing key for the 1st channel.

But multi channel connections where broken is the server nor the client
require/desire signing. It seems the tests only ever run against
Windows domain controllers, which always require signing.

Note that the following code in smb2cli_req_create() makes
sure that we always sign session binds:

  if (cmd == SMB2_OP_SESSSETUP &&
      !smb2_signing_key_valid(session->smb2_channel.signing_key) &&
      smb2_signing_key_valid(session->smb2->signing_key))
  {
          /*
           * a session bind needs to be signed
           */
          state->smb2.should_sign = true;
  }

This removed a logic changed introduced in commit
17e22e020fcb84fb9ddda350915369dc9ea28ef1. As

  if (!smb2_signing_key_valid(signing_key)) {

is not the same as:

  if (signing_key && signing_key->length == 0) {

it's the same as:

  if (signing_key == NULL || signing_key->length == 0) {

so we need:

  if (signing_key != NULL && !smb2_signing_key_valid(signing_key)) {

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
6 years agolibcli/smb: make sure the session->{smb2->,smb2_channel.}signing_key is never NULL!
Stefan Metzmacher [Fri, 7 Jun 2019 16:58:43 +0000 (18:58 +0200)] 
libcli/smb: make sure the session->{smb2->,smb2_channel.}signing_key is never NULL!

Before commit 17e22e020fcb84fb9ddda350915369dc9ea28ef1 they we not a
pointer and always be present.

We used the local pointer variable 'signing_key = NULL' and logic like
this:

    if (state->smb2.should_sign) {
        signing_key = state->session->smb2_channel.signing_key;
    }

    if (signing_key != NULL ...

In order to keep this we need to nake sure
state->session->smb2_channel.signing_key is never NULL!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoRevert "libcli:smb: Fix signing with multichannel"
Stefan Metzmacher [Tue, 11 Jun 2019 15:47:33 +0000 (17:47 +0200)] 
Revert "libcli:smb: Fix signing with multichannel"

This reverts commit 1817db965dc0caf55e4308fa4d9203ab4381dc90.

This was pushed to fast, the corrected commit follows.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agoRevert "libcli/smb: add missing struct smb2_signing_key allocation in smb2cli_session...
Stefan Metzmacher [Tue, 11 Jun 2019 15:47:24 +0000 (17:47 +0200)] 
Revert "libcli/smb: add missing struct smb2_signing_key allocation in smb2cli_session_set_channel_key()"

This reverts commit 08750166542f46644038d1ff9d839b270436addf.

This was pushed to fast, the corrected commit follows.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agolibcli/smb: add missing struct smb2_signing_key allocation in smb2cli_session_set_cha...
Stefan Metzmacher [Fri, 7 Jun 2019 16:58:43 +0000 (18:58 +0200)] 
libcli/smb: add missing struct smb2_signing_key allocation in smb2cli_session_set_channel_key()

This was missing in commit 17e22e020fcb84fb9ddda350915369dc9ea28ef1
and causes all multi-channel tests to segfault.

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 11 15:25:56 UTC 2019 on sn-devel-184

6 years agolibcli:smb: Fix signing with multichannel
Andreas Schneider [Tue, 11 Jun 2019 13:39:24 +0000 (15:39 +0200)] 
libcli:smb: Fix signing with multichannel

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
6 years agos3: net: Consider unprocessed in input buffer
Samuel Cabrero [Fri, 7 Jun 2019 19:12:12 +0000 (21:12 +0200)] 
s3: net: Consider unprocessed in input buffer

If there is unprocessed data in the input buffer (ilen > 0), place new
data read after the unprocessed one.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
6 years agolib/tdb/common: clang: Fix 'Value stored to 'last_ptr' is never read'
Noel Power [Mon, 27 May 2019 15:47:54 +0000 (15:47 +0000)] 
lib/tdb/common: clang: Fix 'Value stored to 'last_ptr' is never read'

Fixes

lib/tdb/common/freelistcheck.c:96:3: warning: Value stored to 'last_ptr' is never read <--[clang]
                last_ptr = rec_ptr;
                ^          ~~~~~~~

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Tue Jun 11 13:31:01 UTC 2019 on sn-devel-184

6 years agolibrpc/ndr: clang: Fix Assigned value is garbage or undefined warning
Noel Power [Fri, 24 May 2019 14:16:40 +0000 (14:16 +0000)] 
librpc/ndr: clang: Fix Assigned value is garbage or undefined warning

Fixes:

librpc/ndr/ndr_basic.c:170:5: warning: Assigned value is garbage or undefined <--[clang]

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
6 years agolib/util: clang: Fix dereference of a null pointer warning
Noel Power [Fri, 24 May 2019 14:08:58 +0000 (14:08 +0000)] 
lib/util: clang: Fix dereference of a null pointer warning

Fixes:

lib/util/rbtree.c:170:8: warning: Access to field 'rb_parent_color' results in a dereference of a null pointer (loaded from variable 'other') <--[clang]

We could avoid accessing the NULL pointer but previously the code would
have crashed here. Given this is a rbtree probably better to preserve the
fatal nature of encountering a NULL pointer here while satisfying the static
checker.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
6 years agolib/util: clang: Fix a dereference of a null pointer warning(s)
Noel Power [Fri, 24 May 2019 14:03:37 +0000 (14:03 +0000)] 
lib/util: clang: Fix a dereference of a null pointer warning(s)

Fixes:

lib/util/ms_fnmatch.c:75:8: warning: Access to field 'predot' results in a dereference of a null pointer (loaded from variable 'max_n') <--[clang]
                        if (max_n->predot && max_n->predot <= n) {
                            ^
lib/util/ms_fnmatch.c:91:8: warning: Access to field 'predot' results in a dereference of a null pointer (loaded from variable 'max_n') <--[clang]
                        if (max_n->predot && max_n->predot <= n) {

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
6 years agolib/util/charset: clang: Fix Value stored to 'reason' is never read warning
Noel Power [Fri, 24 May 2019 13:37:00 +0000 (13:37 +0000)] 
lib/util/charset: clang: Fix Value stored to 'reason' is never read warning

Fixes:

lib/util/charset/convert_string.c:301:5: warning: Value stored to 'reason' is never read <--[clang]

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
6 years agolib/util: clang: Fix 'Null pointer passed as an argument...' warning
Noel Power [Fri, 24 May 2019 13:32:09 +0000 (13:32 +0000)] 
lib/util: clang: Fix 'Null pointer passed as an argument...' warning

Fixes:

lib/util/debug.c:705:7: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang]

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
6 years agoDLIST_REMOVE: clang: Fix dereference of a null pointer warning
Noel Power [Fri, 24 May 2019 13:07:46 +0000 (13:07 +0000)] 
DLIST_REMOVE: clang: Fix dereference of a null pointer warning

Fixes:

lib/tevent/tevent_wrapper.c:295:3: warning: Access to field 'next' results in a dereference of a null pointer (loaded from field 'prev') <--[clang]

Additionally fix similar instance of the same macro

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
6 years agolib/tevent: clang:
Noel Power [Fri, 24 May 2019 13:01:30 +0000 (13:01 +0000)] 
lib/tevent: clang:

Fixes:

lib/tevent/tevent_wrapper.c:213:6: warning: Access to field 'destroyed' results in a dereference of a null pointer (loaded from variable 'glue') <--[clang]

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
6 years agos4/torture/rpc: cppcheck: Fix ctunullpointer error
Noel Power [Fri, 24 May 2019 11:03:09 +0000 (11:03 +0000)] 
s4/torture/rpc: cppcheck: Fix ctunullpointer error

Fixes

source4/torture/rpc/netlogon.c:307: error: ctunullpointer: Null pointer dereference: p <--[cppcheck]

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer gary@catalyst.net.nz
6 years agos3/vfs_glusterfs_fuse: Avoid using NAME_MAX directly
Günther Deschner [Mon, 3 Jun 2019 14:28:36 +0000 (16:28 +0200)] 
s3/vfs_glusterfs_fuse: Avoid using NAME_MAX directly

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Jun 11 00:29:19 UTC 2019 on sn-devel-184

6 years agos3/vfs_glusterfs: Avoid using NAME_MAX directly
Günther Deschner [Mon, 3 Jun 2019 14:25:46 +0000 (16:25 +0200)] 
s3/vfs_glusterfs: Avoid using NAME_MAX directly

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agoRevert "s3/vfs_glusterfs_fuse: Dynamically determine NAME_MAX"
Günther Deschner [Mon, 3 Jun 2019 12:27:44 +0000 (14:27 +0200)] 
Revert "s3/vfs_glusterfs_fuse: Dynamically determine NAME_MAX"

This reverts commit e28d172b00cadf492c22bd892e2dda3bf2fe2d70.

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agoRevert "s3/vfs_glusterfs: Dynamically determine NAME_MAX"
Günther Deschner [Mon, 3 Jun 2019 12:27:18 +0000 (14:27 +0200)] 
Revert "s3/vfs_glusterfs: Dynamically determine NAME_MAX"

This reverts commit 8e3a042eb9e502821b147f1bbb2d98d59f17a095.

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
6 years agoWHATSNEW.txt: reindex performance, Bind9 logging
Gary Lockyer [Thu, 6 Jun 2019 22:01:14 +0000 (10:01 +1200)] 
WHATSNEW.txt: reindex performance, Bind9 logging

Add entries for:
  Reindex performance improvements
  Bind9 logging
  LDAP referrals

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
Autobuild-User(master): Tim Beale <timbeale@samba.org>
Autobuild-Date(master): Mon Jun 10 06:13:27 UTC 2019 on sn-devel-184

6 years agoRevert TestCaseInSubDir parts of "downgradedatabase: blackbox test"
Andrew Bartlett [Fri, 31 May 2019 00:47:13 +0000 (12:47 +1200)] 
Revert TestCaseInSubDir parts of "downgradedatabase: blackbox test"

This reverts part of commit 74d15c9bf76f0a2fb5fa7b7b1d80971d10c4fe45.

TestCaseInSubDir should not have been modified in this way, instead
the downgradedatabase test should have removed the files it created
specifically (this is part of the test, it shows the right files were
created).

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jun  7 21:08:12 UTC 2019 on sn-devel-184

6 years agoselftest: Specifically remove files generated by provision
Andrew Bartlett [Fri, 31 May 2019 01:06:59 +0000 (13:06 +1200)] 
selftest: Specifically remove files generated by provision

This allows the changes in 74d15c9bf76f0a2fb5fa7b7b1d80971d10c4fe45 to
be reverted, and aligns this test with others that use TestCaseInTempDir.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
6 years agopy3: Remove unused PyInt_AsSsize_t macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 04:04:19 +0000 (06:04 +0200)] 
py3: Remove unused PyInt_AsSsize_t macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jun  6 13:26:05 UTC 2019 on sn-devel-184

6 years agopy3: Remove unused PyInt_AsUnsignedLongLongMask macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 04:02:49 +0000 (06:02 +0200)] 
py3: Remove unused PyInt_AsUnsignedLongLongMask macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyInt_AS_LONG macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 04:02:02 +0000 (06:02 +0200)] 
py3: Remove unused PyInt_AS_LONG macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyInt_FromSize_t macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 04:01:16 +0000 (06:01 +0200)] 
py3: Remove unused PyInt_FromSize_t macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyInt_FromSsize_t macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 04:00:41 +0000 (06:00 +0200)] 
py3: Remove unused PyInt_FromSsize_t macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyInt_FromString macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 03:59:56 +0000 (05:59 +0200)] 
py3: Remove unused PyInt_FromString macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyInt_CheckExact macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 03:59:17 +0000 (05:59 +0200)] 
py3: Remove unused PyInt_CheckExact macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PY_DESC_PY3_STRING macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 03:57:43 +0000 (05:57 +0200)] 
py3: Remove unused PY_DESC_PY3_STRING macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyStr_AsUTF8String macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 03:54:36 +0000 (05:54 +0200)] 
py3: Remove unused PyStr_AsUTF8String macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyStr_Decode macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 03:53:44 +0000 (05:53 +0200)] 
py3: Remove unused PyStr_Decode macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyStr_InternFromString macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 03:52:54 +0000 (05:52 +0200)] 
py3: Remove unused PyStr_InternFromString macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyStr_InternInPlace macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 03:52:07 +0000 (05:52 +0200)] 
py3: Remove unused PyStr_InternInPlace macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyStr_Format macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 03:50:49 +0000 (05:50 +0200)] 
py3: Remove unused PyStr_Format macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyStr_Concat macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 03:50:19 +0000 (05:50 +0200)] 
py3: Remove unused PyStr_Concat macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused PyStr_CheckExact macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 03:48:07 +0000 (05:48 +0200)] 
py3: Remove unused PyStr_CheckExact macro from py3compat.h

Now that we are no longer developing new py2/py3 compatible code we can remove
any aspects of this header we do not use.  This will make the eventual removal
easier.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove unused IS_PY3 macro from py3compat.h
Andrew Bartlett [Thu, 6 Jun 2019 03:46:27 +0000 (05:46 +0200)] 
py3: Remove unused IS_PY3 macro from py3compat.h

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopy3: Remove Python2 side of py3compat.h
Andrew Bartlett [Wed, 5 Jun 2019 15:13:00 +0000 (17:13 +0200)] 
py3: Remove Python2 side of py3compat.h

This is unused as we do not support building python modules (etc) under py2.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agotests blackbox ndrdump: Clean up pep8 warnings
Gary Lockyer [Tue, 4 Jun 2019 22:34:17 +0000 (10:34 +1200)] 
tests blackbox ndrdump: Clean up pep8 warnings

Clean up the test code and remove the pep8 warnings

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jun  6 04:58:18 UTC 2019 on sn-devel-184

6 years agontprinting.idl: remove decode functions
Gary Lockyer [Tue, 4 Jun 2019 01:07:06 +0000 (13:07 +1200)] 
ntprinting.idl: remove decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agowinsrepl.idl: remove unused decode functions
Gary Lockyer [Mon, 3 Jun 2019 23:46:05 +0000 (11:46 +1200)] 
winsrepl.idl: remove unused decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosasl_helpers.idl: remove unused decode functions
Gary Lockyer [Mon, 3 Jun 2019 23:45:40 +0000 (11:45 +1200)] 
sasl_helpers.idl: remove unused decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agontp_signd.idl: remove unused decode functions
Gary Lockyer [Mon, 3 Jun 2019 23:44:46 +0000 (11:44 +1200)] 
ntp_signd.idl: remove unused decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agosecurity.idl: remove unused decode functions
Gary Lockyer [Mon, 3 Jun 2019 23:44:17 +0000 (11:44 +1200)] 
security.idl: remove unused decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agopreg.idl: remove unused decode functions
Gary Lockyer [Mon, 3 Jun 2019 23:43:48 +0000 (11:43 +1200)] 
preg.idl: remove unused decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agonegoex.idl: remove unused decode functions
Gary Lockyer [Mon, 3 Jun 2019 23:43:24 +0000 (11:43 +1200)] 
negoex.idl: remove unused decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agonbt.idl: remove unused decode functions
Gary Lockyer [Mon, 3 Jun 2019 23:43:07 +0000 (11:43 +1200)] 
nbt.idl: remove unused decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agokrb5pac.idl: remove unused decode functions
Gary Lockyer [Mon, 3 Jun 2019 23:42:44 +0000 (11:42 +1200)] 
krb5pac.idl: remove unused decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agocab.idl: remove unused decode functions
Gary Lockyer [Mon, 3 Jun 2019 23:41:51 +0000 (11:41 +1200)] 
cab.idl: remove unused decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agodnsp.idl: remove unused decode functions
Gary Lockyer [Mon, 3 Jun 2019 23:32:40 +0000 (11:32 +1200)] 
dnsp.idl: remove unused decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agontlmssp.idl: remove unused decode functions
Gary Lockyer [Mon, 3 Jun 2019 23:29:49 +0000 (11:29 +1200)] 
ntlmssp.idl: remove unused decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agodrsblobs.idl: remove decode functions
Gary Lockyer [Fri, 31 May 2019 03:49:20 +0000 (15:49 +1200)] 
drsblobs.idl: remove decode functions

Remove the decode_* functions as they are no longer needed, and this
will reduce the amount of untested automatically generated code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agondrdump: print public structures
Gary Lockyer [Tue, 4 Jun 2019 20:44:09 +0000 (08:44 +1200)] 
ndrdump: print public structures

Add a struct option to ndrdump that will allow it to print public
structures.
  i.e. binn/ndrdump dns dns_name_packet struct data.file

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agopidl: Allow ndrdump to print public structures
Gary Lockyer [Tue, 4 Jun 2019 20:43:33 +0000 (08:43 +1200)] 
pidl: Allow ndrdump to print public structures

Generate code to allow ndrdump to operate on public structures.

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

6 years agotests blackbox ndrdump: Add test for struct printing
Gary Lockyer [Tue, 4 Jun 2019 02:01:49 +0000 (14:01 +1200)] 
tests blackbox ndrdump: Add test for struct printing

Add test for the dumping of a public structure with ndrdump.  This
removes the need to define decode_* functions in the idl.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:auth: explicitly add BUILTIN\Guests to the guest token
Ralph Boehme [Mon, 13 May 2019 18:16:47 +0000 (20:16 +0200)] 
s3:auth: explicitly add BUILTIN\Guests to the guest token

This changes ensures that smbd always adds BUILTIN\Guests to the guest token
which is required for guest authentication.

Currently the guest token depends on the on-disk configured group mappings. If
there's an existing group mapping for BUILTIN\Guests, but LOCALSAM\Guest is not
a member, the final guest token won't contain BUILTIN\Guests.

For SMB2 the flag SMB2_SESSION_FLAG_IS_GUEST will not be set in the final SMB2
SESSION_SETUP response, because smbd sets it based on the token containing the
BUILTIN\Guests SID S-1-5-32-546.

At the same time, the packet is not signed which causes Windows clients and
smbclient to reject the unsigned SMB2 SESSION_SETUP response.

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

Pair-programmed-with: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jun  5 16:55:26 UTC 2019 on sn-devel-184

6 years agotests: add a test for guest authentication
Ralph Boehme [Thu, 16 May 2019 10:47:34 +0000 (12:47 +0200)] 
tests: add a test for guest authentication

This verifies that smbd always adds BUILTIN\Guests to the guest token which is
required for guest authentication.

Currently the guest token depends on the on-disk configured group mappings. If
there's an existing group mapping for BUILTIN\Guests, but LOCALSAM\Guest is not
a member, the final guest token won't contain BUILTIN\Guests.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agoselftest: allow guest login in the ad_member_idmap_rid env
Ralph Boehme [Thu, 16 May 2019 10:43:40 +0000 (12:43 +0200)] 
selftest: allow guest login in the ad_member_idmap_rid env

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:smbd: call reinit_guest_session_info() in the conf updated handler
Ralph Boehme [Thu, 16 May 2019 10:42:54 +0000 (12:42 +0200)] 
s3:smbd: call reinit_guest_session_info() in the conf updated handler

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agos3:auth: add reinit_guest_session_info()
Ralph Boehme [Thu, 16 May 2019 10:42:29 +0000 (12:42 +0200)] 
s3:auth: add reinit_guest_session_info()

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agotests auth log winbind: Fix flapping test
Gary Lockyer [Wed, 5 Jun 2019 02:52:03 +0000 (14:52 +1200)] 
tests auth log winbind: Fix flapping test

Fix flapping auth_log_winbind tests, were seeing failures like

UNEXPECTED(failure):
samba.tests.auth_log_winbind.samba.tests.auth_log_winbind.AuthLogTestsWinbind.
test_wbinfo(ad_member:local)
REASON: Exception: Exception: Traceback (most recent call last):
  File "bin/python/samba/tests/auth_log_winbind.py", line 328, in
  test_wbinfo
      self.assertEquals(logon_id, msg["Authentication"]["logonId"])
      AssertionError: '812b7158bff1660e' != '2cfc1fed76ff8865'
      - 812b7158bff1660e
      + 2cfc1fed76ff8865

Test had a race condition with other SamLogon events on the domain
server. The tests can now handle multiple SamLogon messages and filter
out the SamLogon messages for other logons.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
6 years agothird_party: Update waf to version 2.0.17
Andreas Schneider [Mon, 3 Jun 2019 08:40:55 +0000 (10:40 +0200)] 
third_party: Update waf to version 2.0.17

This fixes building Samba, libtalloc, libtevent, libtdb and libldb with
Python 3.8.

     wget https://waf.io/waf-2.0.17.tar.bz2
     tar -xf waf-2.0.17.tar.bz2
     git rm third_party/waf/waflib/ -r
     mkdir third_party/waf -p
     rsync -a waf-2.0.17/waflib/ third_party/waf/waflib/
     git add third_party/waf/waflib/

(Then update version number in buildtools/bin/waf and
buildtools/wafsamba/wafsamba.py)

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
6 years agoctdb-utils: Fix CID 1125558 (Unchecked return value from library)
Martin Schwenke [Wed, 29 May 2019 09:11:51 +0000 (19:11 +1000)] 
ctdb-utils: Fix CID 1125558 (Unchecked return value from library)

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 Jun  5 12:09:56 UTC 2019 on sn-devel-184

6 years agoctdb-daemon: Attempt to silence CID 1357985 (Unchecked return value)
Martin Schwenke [Wed, 29 May 2019 09:05:49 +0000 (19:05 +1000)] 
ctdb-daemon: Attempt to silence CID 1357985 (Unchecked return value)

Yes, the other callers check the return value of ctdb_lockdb_mark().
However, this is called in a void function and ctdb_lockdb_mark() has
already printed any error message.  All we can do is explicitly ignore
the return value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-cluster: CID 1435726: NULL pointer dereference
Martin Schwenke [Wed, 29 May 2019 07:38:03 +0000 (17:38 +1000)] 
ctdb-cluster: CID 1435726: NULL pointer dereference

Also found by csbuild.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-ipalloc: Fix warning about unused value assigned to srcimbl
Martin Schwenke [Thu, 30 May 2019 05:41:42 +0000 (15:41 +1000)] 
ctdb-ipalloc: Fix warning about unused value assigned to srcimbl

To make this much clearer, move the declaration into the scope where
it is used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-ipalloc: Avoid -1 as a PNN, use CTDB_UNKNOWN_PNN instead
Martin Schwenke [Thu, 30 May 2019 05:40:42 +0000 (15:40 +1000)] 
ctdb-ipalloc: Avoid -1 as a PNN, use CTDB_UNKNOWN_PNN instead

This fixes warnings about signed versus unsigned comparisons.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-ipalloc: Fix signed/unsigned comparisons by declaring as unsigned
Martin Schwenke [Thu, 30 May 2019 05:37:38 +0000 (15:37 +1000)] 
ctdb-ipalloc: Fix signed/unsigned comparisons by declaring as unsigned

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-tests: Avoid potentially uninitialised data
Martin Schwenke [Thu, 30 May 2019 05:33:05 +0000 (15:33 +1000)] 
ctdb-tests: Avoid potentially uninitialised data

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-utils: Avoid warning about unused value
Martin Schwenke [Thu, 30 May 2019 05:32:03 +0000 (15:32 +1000)] 
ctdb-utils: Avoid warning about unused value

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-recovery: Fix signed/unsigned comparisons by declaring as unsigned
Martin Schwenke [Sat, 25 May 2019 12:04:10 +0000 (22:04 +1000)] 
ctdb-recovery: Fix signed/unsigned comparisons by declaring as unsigned

Simple cases where variables and function parameters need to be
declared as an unsigned type instead of an int.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-recovery: Avoid -1 as a PNN, use CTDB_UNKNOWN_PNN instead
Martin Schwenke [Thu, 23 May 2019 07:50:32 +0000 (17:50 +1000)] 
ctdb-recovery: Avoid -1 as a PNN, use CTDB_UNKNOWN_PNN instead

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-recovery: Fix signed/unsigned comparison by casting
Martin Schwenke [Thu, 23 May 2019 07:47:24 +0000 (17:47 +1000)] 
ctdb-recovery: Fix signed/unsigned comparison by casting

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-recovery: Fix signed/unsigned comparisons by declaring as unsigned
Martin Schwenke [Wed, 22 May 2019 22:43:58 +0000 (08:43 +1000)] 
ctdb-recovery: Fix signed/unsigned comparisons by declaring as unsigned

Simple cases where variables need to be declared as an unsigned type
instead of an int.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-tests: Fix signed/unsigned comparison by using constant
Martin Schwenke [Wed, 22 May 2019 11:58:46 +0000 (21:58 +1000)] 
ctdb-tests: Fix signed/unsigned comparison by using constant

Variable reqid is unsigned, so don't compare with -1.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-client: Fix potentially uninitialised data
Martin Schwenke [Wed, 22 May 2019 11:58:14 +0000 (21:58 +1000)] 
ctdb-client: Fix potentially uninitialised data

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-client: Fix signed/unsigned comparisons by declaring as unsigned
Martin Schwenke [Wed, 22 May 2019 11:55:56 +0000 (21:55 +1000)] 
ctdb-client: Fix signed/unsigned comparisons by declaring as unsigned

Simple cases where a variables and function parameters need to be
declared as an unsigned type instead of an int.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-common: Avoid unused value warning
Martin Schwenke [Thu, 23 May 2019 07:53:19 +0000 (17:53 +1000)] 
ctdb-common: Avoid unused value warning

The incremented value of argc is indeed never used.  Leave it as a
comment to warn anyone cutting and pasting the code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-common: Avoid warning for potentially uninitialised pointers
Martin Schwenke [Thu, 23 May 2019 07:51:46 +0000 (17:51 +1000)] 
ctdb-common: Avoid warning for potentially uninitialised pointers

s_list generates a warning, but initialise them both.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-common: Use #ifdef to avoid TEST_RB_TREE not defined
Martin Schwenke [Thu, 23 May 2019 07:49:26 +0000 (17:49 +1000)] 
ctdb-common: Use #ifdef to avoid TEST_RB_TREE not defined

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-common: Fix signed/unsigned comparisons by casting
Martin Schwenke [Sun, 2 Jun 2019 04:05:28 +0000 (14:05 +1000)] 
ctdb-common: Fix signed/unsigned comparisons by casting

In one case, given triviality of change, add missing braces and fix
whitespace.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-common: Fix signed/unsigned comparisons by declaring as unsigned
Martin Schwenke [Wed, 22 May 2019 11:55:18 +0000 (21:55 +1000)] 
ctdb-common: Fix signed/unsigned comparisons by declaring as unsigned

Simple cases where a variable (usually a loop variable) needs to be
declared as an unsigned type (unsigned int or size_t) instead of an
int.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-tools: Fix potentially uninitialised data
Martin Schwenke [Wed, 22 May 2019 11:57:43 +0000 (21:57 +1000)] 
ctdb-tools: Fix potentially uninitialised data

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-tools: Fix signed/unsigned conversion by declaring as size_t
Martin Schwenke [Tue, 28 May 2019 00:57:49 +0000 (10:57 +1000)] 
ctdb-tools: Fix signed/unsigned conversion by declaring as size_t

All the top-level callers pass size_t.

Drop the ternary operator.  The value of hsize is always positive
because it is unsigned.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-tools: Fix signed/unsigned comparison by declaring as int
Martin Schwenke [Tue, 28 May 2019 00:55:19 +0000 (10:55 +1000)] 
ctdb-tools: Fix signed/unsigned comparison by declaring as int

There's no point using unsigned here.  tdb_traverse() returns an int
for the number of records traversed and the number of empty records
can't exceed this value.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-tools: Fix signed/unsigned comparison by declaring as unsigned
Martin Schwenke [Wed, 22 May 2019 11:54:04 +0000 (21:54 +1000)] 
ctdb-tools: Fix signed/unsigned comparison by declaring as unsigned

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-tools: Fix signed/unsigned comparisons by casting
Martin Schwenke [Wed, 22 May 2019 11:57:07 +0000 (21:57 +1000)] 
ctdb-tools: Fix signed/unsigned comparisons by casting

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-tools: Fix signed/unsigned comparisons by declaring extra variable
Martin Schwenke [Fri, 24 May 2019 03:50:07 +0000 (13:50 +1000)] 
ctdb-tools: Fix signed/unsigned comparisons by declaring extra variable

This needs an extra variable because variable i has been used in both
signed and unsigned contexts.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
6 years agoctdb-tools: Fix signed/unsigned comparisons by declaring as unsigned
Martin Schwenke [Wed, 22 May 2019 11:52:17 +0000 (21:52 +1000)] 
ctdb-tools: Fix signed/unsigned comparisons by declaring as unsigned

These are the simple cases where a variable (usually a loop variable)
needs to be declared as an unsigned type (usually unsigned int or
size_t) instead of an int.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>