martins/samba.git
4 months agolib/util: Count a trailing line that doesn't end in a newline master
Martin Schwenke [Fri, 14 Dec 2018 03:43:57 +0000 (14:43 +1100)]
lib/util: Count a trailing line that doesn't end in a newline

If the final line of a file does not contain a newline then it isn't
included in the line count.

Change i to point to the next slot in the array instead of the current
one.  This means that that the current line won't be thrown away if no
newline is seen.

Without changing i to unsigned int, the -O3 --picky -developer build
fails with:

[ 745/4136] Compiling lib/util/util_file.c

==> /builds/samba-team/devel/samba/samba-o3.stderr <==
../../lib/util/util_file.c: In function ‘file_lines_parse’:
../../lib/util/util_file.c:251:8: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
  while (i > 0 && ret[i-1][0] == 0) {
        ^
cc1: all warnings being treated as errors

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Dec 19 08:08:28 CET 2018 on sn-devel-144

4 months agos4 messaging: Add support for smbcontrol sleep
Gary Lockyer [Mon, 10 Dec 2018 22:43:52 +0000 (11:43 +1300)]
s4 messaging: Add support for smbcontrol sleep

Add a sleep command that pauses the target process for the specified
number of seconds

This command is only enabled on developer and self test builds.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3 server: Add support for smbcontrol sleep
Gary Lockyer [Mon, 10 Dec 2018 22:39:23 +0000 (11:39 +1300)]
s3 server: Add support for smbcontrol sleep

Add a sleep command that pauses the target process for the specified number
of seconds

This command is only enabled on self test and developer builds.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3 smbcontrol: Add sleep command
Gary Lockyer [Mon, 3 Dec 2018 20:31:22 +0000 (09:31 +1300)]
s3 smbcontrol: Add sleep command

Add a sleep command that pauses the target process for the specified
number of seconds

This command is only enabled on developer and self test builds.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos4 messaging tests: Tests for smbcontrol sleep command
Gary Lockyer [Wed, 5 Dec 2018 01:50:22 +0000 (14:50 +1300)]
s4 messaging tests: Tests for smbcontrol sleep command

Add a sleep command that pauses the target process for the specified
number seconds

This command is only enabled on developer and self test builds.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos4 messaging: support smbcontrol inject fault command
Gary Lockyer [Mon, 10 Dec 2018 22:04:25 +0000 (11:04 +1300)]
s4 messaging: support smbcontrol inject fault command

Add support of the smbcontrol inject fault command to the samba daemon.
This is useful for manual testing of process restart etc.

command is only enabled for developer and self test builds

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos4 messaging tests: Add inject fault command
Gary Lockyer [Mon, 10 Dec 2018 22:01:09 +0000 (11:01 +1300)]
s4 messaging tests: Add inject fault command

Test for processing of the smbcontrol inject fault message in the samba
daemon.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos4: Remove double init of kerberos error table
Swen Schillig [Tue, 18 Dec 2018 07:30:24 +0000 (08:30 +0100)]
s4: Remove double init of kerberos error table

The initialization of the kerberos error table
is already performed in smb_krb5_init_context_basic(),
therefore, it can be removed from of its callees.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Dec 19 04:51:27 CET 2018 on sn-devel-144

4 months agos3-smbd: avoid assuming fsp is always intact after close_file call.
Günther Deschner [Tue, 18 Dec 2018 10:10:04 +0000 (11:10 +0100)]
s3-smbd: avoid assuming fsp is always intact after close_file call.

Instead use the already copied smb_fname directly.

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Dec 18 20:11:07 CET 2018 on sn-devel-144

4 months agoctdb-daemon: Modernise debug during record deletion for vacuuming
Martin Schwenke [Wed, 24 Oct 2018 01:29:54 +0000 (12:29 +1100)]
ctdb-daemon: Modernise debug during record deletion for vacuuming

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 Dec 18 10:13:50 CET 2018 on sn-devel-144

4 months agoctdb-daemon Add extra debug during record deletion for vacuuming
Martin Schwenke [Mon, 15 Oct 2018 10:21:25 +0000 (21:21 +1100)]
ctdb-daemon Add extra debug during record deletion for vacuuming

It isn't currently possible to distinguish these 2 cases.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 months agoctdb-tests: Minimise chances of test interfering with itself
Martin Schwenke [Tue, 18 Dec 2018 03:31:24 +0000 (14:31 +1100)]
ctdb-tests: Minimise chances of test interfering with itself

Checking that the database contains 0 records cause a traverse.  This
may take a lock and cause vacuuming to fail (or be deferred for a
particular record/chain).  Minimise the chance of this happening by
only checking for 0 records every 10 seconds.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 months agoctdb-daemon: Do not force full vacuum on first vacuuming run
Martin Schwenke [Mon, 22 Oct 2018 10:40:22 +0000 (21:40 +1100)]
ctdb-daemon: Do not force full vacuum on first vacuuming run

When the number of fast path vacuuming runs is 0 then a full vacuuming
run is done.  This means the first one is a full run, which is almost
certainly not what is intended.

Combine the 2 conditionals to only flag a full vacuuming run when the
count exceeds the configured limit.  This means that the
full_vacuum_run flag is set in both parent and child, but this is
harmless... and is better than getting it wrong.

Also tweak the comparison to be less-than-or-equal, since the zeroth
run needs to be counted.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 months agoctdb-packaging: Update library versions to upstream versions
Amitay Isaacs [Tue, 18 Dec 2018 02:37:40 +0000 (13:37 +1100)]
ctdb-packaging: Update library versions to upstream versions

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
4 months agoctdb-packaging: Match configure command as per spec file
Amitay Isaacs [Tue, 18 Dec 2018 00:01:35 +0000 (11:01 +1100)]
ctdb-packaging: Match configure command as per spec file

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
4 months agoctdb-packaging: Call waf with python wrapper
Amitay Isaacs [Tue, 18 Dec 2018 00:03:51 +0000 (11:03 +1100)]
ctdb-packaging: Call waf with python wrapper

This allows to build packages even when python3 is not available by
setting PYTHON variable.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
4 months agoctdb-build: Use open() instead of file() for python3
Amitay Isaacs [Mon, 17 Dec 2018 23:54:50 +0000 (10:54 +1100)]
ctdb-build: Use open() instead of file() for python3

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
4 months agoctdb-tool: Avoid data uninitialized warnings
Amitay Isaacs [Tue, 18 Dec 2018 00:33:30 +0000 (11:33 +1100)]
ctdb-tool: Avoid data uninitialized warnings

../../tools/ctdb.c: In function 'str_to_data':
../../tools/ctdb.c:624: warning: 'data.dsize' may be used uninitialized in this function
../../tools/ctdb.c:624: warning: 'data.dptr' may be used uninitialized in this function

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
4 months agoctdb-tests: Do not force TEST_VAR_DIR to be absolute
Martin Schwenke [Fri, 7 Sep 2018 04:48:17 +0000 (14:48 +1000)]
ctdb-tests: Do not force TEST_VAR_DIR to be absolute

This can result in Unix domain socket names that are too long.

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 Dec 18 05:31:00 CET 2018 on sn-devel-144

4 months agoctdb-event: Force symbolic link targets to be absolute
Martin Schwenke [Fri, 7 Sep 2018 04:47:24 +0000 (14:47 +1000)]
ctdb-event: Force symbolic link targets to be absolute

If CTDB_BASE is relative then symbolic link targets will be incorrect.

Don't force CTDB_BASE to be absolute because this can result in Unix
domain socket names that are too long.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 months agoctdb-event: Declare and construct data_script only if needed
Martin Schwenke [Fri, 7 Sep 2018 04:35:15 +0000 (14:35 +1000)]
ctdb-event: Declare and construct data_script only if needed

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 months agoctdb-tests: Force symbolic link targets to be absolute
Martin Schwenke [Fri, 7 Sep 2018 04:45:00 +0000 (14:45 +1000)]
ctdb-tests: Force symbolic link targets to be absolute

If CTDB_BASE is relative then the symbolic link target will be
incorrect.

Don't force CTDB_BASE to be absolute because this can result in Unix
domain socket names that are too long.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 months agoctdb-event: Force EVENTSCRIPTS_TESTS_VAR_DIR to be absolute
Martin Schwenke [Fri, 7 Sep 2018 06:02:25 +0000 (16:02 +1000)]
ctdb-event: Force EVENTSCRIPTS_TESTS_VAR_DIR to be absolute

Event scripts (well, statd_callout) can change directory, causing
stubs to be unable to locate EVENTSCRIPTS_TESTS_VAR_DIR if it is
relative.

Don't force TEST_VAR_DIR to be absolute because this can result in
Unix domain socket names that are too long.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 months agoctdb-event: Force script directory to be absolute
Martin Schwenke [Fri, 7 Sep 2018 03:39:49 +0000 (13:39 +1000)]
ctdb-event: Force script directory to be absolute

If TEST_VAR_DIR is relative then symbolic link targets will be
incorrect.

Don't force TEST_VAR_DIR to be absolute because this can result in
Unix domain socket names that are too long.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 months agoctdb-recoverd: Call an election when the recovery lock is lost
Martin Schwenke [Thu, 8 Nov 2018 04:49:30 +0000 (15:49 +1100)]
ctdb-recoverd: Call an election when the recovery lock is lost

The lock may have been lost due to a failure in the underlying locking
mechanism.  This could be due to quorum loss or similar.  It is best
to call an election to confirm that this node should still be master.
At worst, the node will reelect itself, fail to take the lock and then
ban itself.  This is a suitable outcome for a node that has been
partitioned from others in the cluster.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 months agoctdb-doc: Add non-breaking space to lock_buckets documentation
Martin Schwenke [Thu, 13 Dec 2018 01:16:16 +0000 (12:16 +1100)]
ctdb-doc: Add non-breaking space to lock_buckets documentation

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 months agoctdb-daemon: Divide by 2 when calculating hop count bucket
Martin Schwenke [Thu, 15 Nov 2018 02:58:53 +0000 (13:58 +1100)]
ctdb-daemon: Divide by 2 when calculating hop count bucket

This provides finer resolution while still maintaining a reasonable
maximum.  In this case the top bucket contains any hop counts
>= 16384, compared to the current situation where the top bucket contains
hop counts >= 268435456.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 months agosmbd: Don't try to release a kernel oplock for a leased file
Volker Lendecke [Fri, 14 Dec 2018 12:05:50 +0000 (13:05 +0100)]
smbd: Don't try to release a kernel oplock for a leased file

If we have

[global]
  smb2 leases = yes
  kernel oplocks = no
[share]
  kernel oplocks = yes

for clients requesting leases we don't even try to acquire kernel
oplocks, because the kernel API is not compatible. Kernel oplocks are
per fd, leases are roughly "per inode".

We don't however special-case the LEASE_OPLOCK case in
release_file_oplock, leading to nasty error messages like "bad file
descriptor" on the fcntl(fd,F_SETLEASE,F_UNLCK) call. They are
harmless, but they raise eyebrows.

To simplify the if-condition, I factored out the kernel call and
applied early returns.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec 18 02:00:44 CET 2018 on sn-devel-144

4 months agodsdb: sort DSDB_EXTENDED defines by OID
Andrew Bartlett [Fri, 14 Dec 2018 01:49:03 +0000 (14:49 +1300)]
dsdb: sort DSDB_EXTENDED defines by OID

This helps avoid duplicate values and clearly indicates what value to select next.

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 Dec 17 04:30:39 CET 2018 on sn-devel-144

4 months agodrepl: schema repl race condition fix
Aaron Haslett [Wed, 21 Nov 2018 00:55:53 +0000 (13:55 +1300)]
drepl: schema repl race condition fix

Adds final schema consistency check before committing changes.
Aborts if corruption found.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12889
Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agoConditionally disable macOS incompatible tests
Will [Wed, 8 Nov 2017 03:52:34 +0000 (21:52 -0600)]
Conditionally disable macOS incompatible tests

Symbols _getgrent_r and _getpwent_r in
source4/torture/local/nss_tests.c are undefined in macOS. It seems
that checking HAVE_GETGRENT_R and HAVE_GETPWENT_R and conditionally
disabling those tests as suggested by hirochachacha in the referenced
bug allows samba on both `master` and `samba-4.7.1` to build properly
on macOS/darwin.

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

Signed-off-by: Will Haley <willhy@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agoSend status to systemd on daemon start
Marcos Mello [Fri, 30 Nov 2018 11:25:07 +0000 (09:25 -0200)]
Send status to systemd on daemon start

systemd service files run in no-forking mode (--foreground) since
8b6f58194da7e849cdb9d20712dff49b17a93a77.

Rearrange sd_notify() call in become_daemon() to only send status to systemd
in this mode (Type=notify is not designed to monitor forking). Drop READY=0
(it does nothing) and MAINPID= (unnecessary because the process spawned by
systemd is already the main PID).

Also remove STATUS= prefix from debug messages.

Signed-off-by: Marcos Mello <marcosfrm@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agomanpage: Advise vfs_fruit:veto_appledouble=yes can break rsync
Adam Nielsen [Sun, 15 Oct 2017 01:56:32 +0000 (11:56 +1000)]
manpage: Advise vfs_fruit:veto_appledouble=yes can break rsync

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos4:scripting:bin: rm rpcclient
Guo Qiao [Thu, 13 Dec 2018 22:23:46 +0000 (11:23 +1300)]
s4:scripting:bin: rm rpcclient

This file only works in py2, and no one use it. Just delete it.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agodsdb: Remove readOnlySchema concept from Samba
Andrew Bartlett [Sun, 16 Dec 2018 21:17:08 +0000 (10:17 +1300)]
dsdb: Remove readOnlySchema concept from Samba

This is a hold-over from the LDAP backend project, which has not yet been revived.

There will be bigger issues than what to do if the schema changes if this ever comes back
and our schema code is way to complex at the moment.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agolib:tsocket: Check for DOXYGEN as a #define
Andreas Schneider [Thu, 13 Dec 2018 17:54:26 +0000 (18:54 +0100)]
lib:tsocket: Check for DOXYGEN as a #define

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Mon Dec 17 00:10:10 CET 2018 on sn-devel-144

4 months agos3:lib: Fix checking for config.h #define in system.c
Andreas Schneider [Thu, 13 Dec 2018 17:52:45 +0000 (18:52 +0100)]
s3:lib: Fix checking for config.h #define in system.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agos3: Fix checking for config.h #define in includes.h
Andreas Schneider [Thu, 13 Dec 2018 17:52:11 +0000 (18:52 +0100)]
s3: Fix checking for config.h #define in includes.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agonsswitch: Fix checking for config.h #define in winbind_nss.h
Andreas Schneider [Thu, 13 Dec 2018 17:51:18 +0000 (18:51 +0100)]
nsswitch: Fix checking for config.h #define in winbind_nss.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agonsswitch: Fix checking for config.h #define in nsstest.h
Andreas Schneider [Thu, 13 Dec 2018 17:49:32 +0000 (18:49 +0100)]
nsswitch: Fix checking for config.h #define in nsstest.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agokrb5_samba: Fix checking for config.h #define in krb5_samba.h
Andreas Schneider [Thu, 13 Dec 2018 17:48:44 +0000 (18:48 +0100)]
krb5_samba: Fix checking for config.h #define in krb5_samba.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agolib:util: Fix checking for config.h #define in fault.c
Andreas Schneider [Thu, 13 Dec 2018 17:48:03 +0000 (18:48 +0100)]
lib:util: Fix checking for config.h #define in fault.c

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agoreplace: Fix checking for config.h #define in replace.h
Andreas Schneider [Thu, 13 Dec 2018 17:47:16 +0000 (18:47 +0100)]
replace: Fix checking for config.h #define in replace.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agoreplace: Fix checking for config.h #define in gssapi.h
Andreas Schneider [Thu, 13 Dec 2018 17:46:38 +0000 (18:46 +0100)]
replace: Fix checking for config.h #define in gssapi.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agoreplace: Fix checking for config.h #define in readline.h
Andreas Schneider [Thu, 13 Dec 2018 17:45:14 +0000 (18:45 +0100)]
replace: Fix checking for config.h #define in readline.h

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agotravis-ci: Remove hooks for Travis CI (typically used with GitHub)
Andrew Bartlett [Thu, 13 Dec 2018 08:02:24 +0000 (21:02 +1300)]
travis-ci: Remove hooks for Travis CI (typically used with GitHub)

These will get out of date pretty quickly, so better to remove them now
that GitLab CI is the documented and supported solution.

This was our first public CI system, used because it is cost-free
to Open Source projects and integrated with GitHub.

It has served it's purpose now.

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): Fri Dec 14 22:04:20 CET 2018 on sn-devel-144

4 months agodsdb audit_log: Add windows event codes to password changes
Gary Lockyer [Thu, 13 Dec 2018 22:09:20 +0000 (11:09 +1300)]
dsdb audit_log: Add windows event codes to password changes

Add a new "eventId" element to the PasswordChange JSON log messages.
This contains a Windows Event Code Id either:
4723 Password changed
4724 Password reset

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agoauth log: Increment Authentication version
Gary Lockyer [Thu, 13 Dec 2018 01:48:46 +0000 (14:48 +1300)]
auth log: Increment Authentication version

Update the minor version of the Authorisation to reflect the addition of
the "eventId" and "logonType" elements.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agoauth log: Add windows logon type codes
Gary Lockyer [Thu, 13 Dec 2018 01:46:31 +0000 (14:46 +1300)]
auth log: Add windows logon type codes

Add a new "logonType" element to the Authorisation JSON log messages.
This contains a Windows Logon Type, the supported logon types are:
2 Interactive
3 Network
8 NetworkCleartext

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agoauth log: Add windows event codes
Gary Lockyer [Wed, 12 Dec 2018 21:20:28 +0000 (10:20 +1300)]
auth log: Add windows event codes

Add a new "eventId" element to the Authorisation JSON log messages.
This contains a Windows Event Code Id either:
4624 Successful logon
4625 Unsuccessful logon

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agoidl: Add Windows event code ids
Gary Lockyer [Wed, 12 Dec 2018 21:17:44 +0000 (10:17 +1300)]
idl: Add Windows event code ids

Add idl definitions for Windows Event Code Ids, and Logon Types. This
intial commit adds:

Event Ids
4264 Successful logon
4625 Unsuccessful logon

Logon Types
 2 Interactive
 3 Network
 4 Batch
 5 Service
 7 Unlock
 8 NetworkCleartext
 9 NewCredentials
10 RemoteInteractive
11 CachedInteractive

The intention is to add Windows Event Codes to the JSON log messages, to
provide a common event identifier in mixed Windows and Samba networks.
And to assist security personnel with a windows background.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agoPY3: change shebang to python3 in misc dirs
Joe Guo [Wed, 12 Dec 2018 00:43:21 +0000 (13:43 +1300)]
PY3: change shebang to python3 in misc dirs

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Fri Dec 14 18:00:40 CET 2018 on sn-devel-144

4 months agoPY3: change shebang to python3 in lib dir
Joe Guo [Wed, 12 Dec 2018 00:41:58 +0000 (13:41 +1300)]
PY3: change shebang to python3 in lib dir

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
4 months agoPY3: change shebang to python3 in wintest dir
Joe Guo [Wed, 12 Dec 2018 00:37:10 +0000 (13:37 +1300)]
PY3: change shebang to python3 in wintest dir

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
4 months agoPY3: change shebang to python3 in script dir
Joe Guo [Wed, 12 Dec 2018 00:18:40 +0000 (13:18 +1300)]
PY3: change shebang to python3 in script dir

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
4 months agoPY3: change shebang to python3 in source4/dsdb dir
Joe Guo [Wed, 12 Dec 2018 00:40:43 +0000 (13:40 +1300)]
PY3: change shebang to python3 in source4/dsdb dir

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
4 months agoPY3: change shebang to python3 in source4/scripting dir
Joe Guo [Wed, 12 Dec 2018 00:39:24 +0000 (13:39 +1300)]
PY3: change shebang to python3 in source4/scripting dir

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
4 months agoPY3: change shebang to python3 in source4/torture dir
Joe Guo [Wed, 12 Dec 2018 00:38:33 +0000 (13:38 +1300)]
PY3: change shebang to python3 in source4/torture dir

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
4 months agoPY3: change shebang to python3 in source4/scripting/bin dir
Joe Guo [Mon, 10 Dec 2018 23:23:17 +0000 (12:23 +1300)]
PY3: change shebang to python3 in source4/scripting/bin dir

Samba default python is 3 now.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
4 months agos3:test: make sids2xids test compatible with py2 and py3
Joe Guo [Thu, 13 Dec 2018 03:33:40 +0000 (16:33 +1300)]
s3:test: make sids2xids test compatible with py2 and py3

define a wrapper function for subprocess.check_output,
to return bytes for py2 and unicode for py3, and replace Popen with it.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
4 months agobuild: Move python detection back into waf (instead of in configure and Makefile)
Andrew Bartlett [Tue, 11 Dec 2018 18:10:30 +0000 (07:10 +1300)]
build: Move python detection back into waf (instead of in configure and Makefile)

This avoids creating a mini-configure in the configure script.

Users wishing to use python2 to build need to specify PYTHON=
to both ./configure and make

After we merged the python3 change, it became clear that relying on systems prefixing
the correct python just causes trouble and make debugging harder, so only use $PYTHON
for the override, not the default case

This essentially reverts a660b7fb8e519bd3be558fd0425bff8f287fca1f but
leaves the files more consistent.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
4 months agoaudit_logging: auth_json_audit required auth_json
Andrew Bartlett [Fri, 14 Dec 2018 03:05:33 +0000 (16:05 +1300)]
audit_logging: auth_json_audit required auth_json

To log JSON the human-readable logs must also have been enabled

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

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): Fri Dec 14 14:32:25 CET 2018 on sn-devel-144

4 months agolib/audit_logging: Use talloc_stackframe() in audit_log_json()
Andrew Bartlett [Fri, 14 Dec 2018 02:40:20 +0000 (15:40 +1300)]
lib/audit_logging: Use talloc_stackframe() in audit_log_json()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agoaudit_logging: Remove debug log header and JSON Authentication: prefix
Andrew Bartlett [Thu, 13 Dec 2018 00:53:08 +0000 (13:53 +1300)]
audit_logging: Remove debug log header and JSON Authentication: prefix

Feedback from real-world users is that they really want raw JSON
strings in the log.

We can not easily remove the leading "  " but the other strings above
and before the JSON are really annoying to strip back off

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
4 months agoChange order of flags in Makefile so that crackcheck builds under Ubuntu
Brian Candler [Thu, 14 Dec 2017 20:39:09 +0000 (20:39 +0000)]
Change order of flags in Makefile so that crackcheck builds under Ubuntu

Signed-off-by: Brian Candler <b.candler@pobox.com>
Reviewed-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 Dec 14 04:13:38 CET 2018 on sn-devel-144

4 months agotests/smbcontrol: fix typo in class name
Philipp Gesang [Mon, 20 Aug 2018 08:38:04 +0000 (10:38 +0200)]
tests/smbcontrol: fix typo in class name

Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agoAdd #include <unistd.h> to provide prototype for getopt()
Brian Candler [Thu, 14 Dec 2017 20:40:22 +0000 (20:40 +0000)]
Add #include <unistd.h> to provide prototype for getopt()

Signed-off-by: Brian Candler <b.candler@pobox.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agoCorrection of comment in winbindd_pam.c
amitkuma [Thu, 21 Dec 2017 17:14:38 +0000 (22:44 +0530)]
Correction of comment in winbindd_pam.c

Internal comment corrected.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 months agobuildtools/wafsamba: Ensure default python picked up is python3
Andrew Bartlett [Thu, 13 Dec 2018 17:03:13 +0000 (17:03 +0000)]
buildtools/wafsamba: Ensure default python picked up is python3

1) set the default python searched for samba waf to be python3
2) remove default setting of PYTHON variable if not defined (not needed)

Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agobuildtools/wafsamba: re-write shebang for delivered python scripts
Noel Power [Wed, 12 Dec 2018 20:30:32 +0000 (20:30 +0000)]
buildtools/wafsamba: re-write shebang for delivered python scripts

Can't see how the orig code would have worked though
a)
  task.env["PYTHON"] is a list
b) task.env["PYTHON_SPECIFIED"] can (and is in our case false) looks
   like it would only be true for python2 but in anycase no harm we
   always rewrite the shebang

So now it works as follows,

1. PYTHON (which is where the shebang is got) is set to python3 by default
2. To override the default you need to set PYTHON (e.g. to build with python2)
3. If you give a full path in PYTHON then shebang is of the format
   "#!{FULL_PYTHON_INTERPRETER_PATH)
4. If you specify PYTHON=python or PYTHON=python2 etc. shebang format is
   "#!!/usr/bin/env python", "#!!/usr/bin/env python2" etc.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agoWHATSNEW: document build system default python version change.
Noel Power [Tue, 11 Dec 2018 12:13:34 +0000 (12:13 +0000)]
WHATSNEW: document build system default python version change.

build now uses python3 by default instead of python2

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos4/scripting: python3 fix string.find instance
Noel Power [Tue, 11 Dec 2018 12:17:59 +0000 (12:17 +0000)]
s4/scripting: python3 fix string.find instance

    string.find doesn't exist in python3. Instead use the 'find' method
    of the string instance itself

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agodynconfig/wscript: python3 fix string.find instance
Noel Power [Tue, 11 Dec 2018 12:12:08 +0000 (12:12 +0000)]
dynconfig/wscript: python3 fix string.find instance

string.find doesn't exist in python3. Instead use the 'find' method
of the string instance itself

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agobuildtools/wafsamba: Decode output of cmd_output (which is bytes)
Noel Power [Mon, 10 Dec 2018 20:18:11 +0000 (20:18 +0000)]
buildtools/wafsamba: Decode output of cmd_output (which is bytes)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos4/dsdb/tests/python: Restore embed NULL tests for Python3
Noel Power [Tue, 11 Dec 2018 10:46:35 +0000 (10:46 +0000)]
s4/dsdb/tests/python: Restore embed NULL tests for Python3

commit: 34ca15fb042e42773854c093ad9f1e67696c90ac changed the
test so embedded NULLs were avoided when python3 was used.
This was due to the fact the string comparison function
'locale.strcoll' cannot handle embedded NULLs. This commit

a) Restores the test data using embedded NULLs which was
   not used depending on the python runtime version
b) Removes the problematic calculation of expected sorting order
   and instead uses sort order data stored in files.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agoselftest: Convert samba4.ldap.sort.python to planoldpythontest
Noel Power [Fri, 7 Dec 2018 18:52:17 +0000 (18:52 +0000)]
selftest: Convert samba4.ldap.sort.python to planoldpythontest

Currently the test only runs fully under python2. As an interim
measure while we figure out how to get this to work property under
python3 I have converted the test to planoldpythontest so it also
can run under python2

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agoselftest/knownfail.d/smb: avoid explicit python version
Stefan Metzmacher [Wed, 12 Dec 2018 23:10:52 +0000 (00:10 +0100)]
selftest/knownfail.d/smb: avoid explicit python version

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Autobuild-User(master): Tim Beale <timbeale@samba.org>
Autobuild-Date(master): Fri Dec 14 00:49:31 CET 2018 on sn-devel-144

4 months agos3:pylibsmb: allow ImpersonationLevel argument to create()
Stefan Metzmacher [Fri, 7 Dec 2018 15:40:10 +0000 (16:40 +0100)]
s3:pylibsmb: allow ImpersonationLevel argument to create()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Dec 13 12:35:06 CET 2018 on sn-devel-144

4 months agos3:libsmb: pass impersonation_level to cli_ntcreate_send()
Stefan Metzmacher [Fri, 7 Dec 2018 15:38:57 +0000 (16:38 +0100)]
s3:libsmb: pass impersonation_level to cli_ntcreate_send()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:libsmb: pass ImpersonationLevel to cli_ntcreate1_send()
Stefan Metzmacher [Fri, 7 Dec 2018 15:35:16 +0000 (16:35 +0100)]
s3:libsmb: pass ImpersonationLevel to cli_ntcreate1_send()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:libsmb: pass impersonation_level to cli_smb2_create_fnum()
Stefan Metzmacher [Fri, 7 Dec 2018 15:42:06 +0000 (16:42 +0100)]
s3:libsmb: pass impersonation_level to cli_smb2_create_fnum()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:libsmb: pass impersonation_level to cli_smb2_create_fnum_send()
Stefan Metzmacher [Fri, 7 Dec 2018 15:32:05 +0000 (16:32 +0100)]
s3:libsmb: pass impersonation_level to cli_smb2_create_fnum_send()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:pylibsmb: make use of protocol independent cli_read_send/recv in py_cli_read()
Stefan Metzmacher [Fri, 7 Dec 2018 13:28:04 +0000 (14:28 +0100)]
s3:pylibsmb: make use of protocol independent cli_read_send/recv in py_cli_read()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:pylibsmb: make use of protocol independent cli_write_send/recv in py_cli_write()
Stefan Metzmacher [Fri, 7 Dec 2018 13:28:04 +0000 (14:28 +0100)]
s3:pylibsmb: make use of protocol independent cli_write_send/recv in py_cli_write()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:libsmb: add comments for cli_write_send/cli_push_send
Tim Beale [Tue, 11 Dec 2018 03:05:43 +0000 (16:05 +1300)]
s3:libsmb: add comments for cli_write_send/cli_push_send

Added a code comment highlighting this 2 APIs do similar jobs, and tried
to explain why you might want to use one over the other.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:libsmb: add cli_write_send/recv which work with SMB1/2/3
Stefan Metzmacher [Fri, 7 Dec 2018 13:26:43 +0000 (14:26 +0100)]
s3:libsmb: add cli_write_send/recv which work with SMB1/2/3

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:pylibsmb: make use of PYARG_BYTES_LEN in py_cli_write()
Stefan Metzmacher [Fri, 7 Dec 2018 13:04:30 +0000 (14:04 +0100)]
s3:pylibsmb: make use of PYARG_BYTES_LEN in py_cli_write()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:pylibsmb: make use of PyBytes_FromStringAndSize() in py_cli_read()
Stefan Metzmacher [Fri, 7 Dec 2018 12:47:40 +0000 (13:47 +0100)]
s3:pylibsmb: make use of PyBytes_FromStringAndSize() in py_cli_read()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:pylibsmb: .get_oplock_break API is dependent on multi_threaded=True
Tim Beale [Mon, 3 Dec 2018 23:32:58 +0000 (12:32 +1300)]
s3:pylibsmb: .get_oplock_break API is dependent on multi_threaded=True

The .get_oplock_break is dependent on the pthread code, which is only
used when creating a SMB connection with multi_threaded=True.

Add an explicit error to the .get_oplock_break() if someone tries to use
it in non-multithreaded mode.

Initializing self->oplock_waiter in non-multithreaded mode is similarly
redundant if the API can never be used.

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

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:pylibsmb: remember that a connection uses SMB1
Stefan Metzmacher [Tue, 4 Dec 2018 09:42:55 +0000 (10:42 +0100)]
s3:pylibsmb: remember that a connection uses SMB1

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:pylibsmb: add force_smb1=True in order to control forcing of SMB1
Stefan Metzmacher [Tue, 4 Dec 2018 09:40:18 +0000 (10:40 +0100)]
s3:pylibsmb: add force_smb1=True in order to control forcing of SMB1

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:pylibsmb: add sign=True to require signing
Stefan Metzmacher [Mon, 3 Dec 2018 14:42:50 +0000 (15:42 +0100)]
s3:pylibsmb: add sign=True to require signing

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:pylibsmb: only use poll_mt backend if multi_threaded=True is specified
Stefan Metzmacher [Mon, 3 Dec 2018 14:02:06 +0000 (15:02 +0100)]
s3:pylibsmb: only use poll_mt backend if multi_threaded=True is specified

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agos3:pylibsmb: pass self to py_tevent_req_wait_exc()
Stefan Metzmacher [Mon, 3 Dec 2018 13:37:05 +0000 (14:37 +0100)]
s3:pylibsmb: pass self to py_tevent_req_wait_exc()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agowafsamba: fix pidl dependencies to rebuild on pidl changes
Stefan Metzmacher [Fri, 23 Nov 2018 13:06:52 +0000 (14:06 +0100)]
wafsamba: fix pidl dependencies to rebuild on pidl changes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
4 months agopidl: Fix unsigned integer comparison warning
Andreas Schneider [Wed, 12 Dec 2018 19:58:23 +0000 (20:58 +0100)]
pidl: Fix unsigned integer comparison warning

bin/default/librpc/gen_ndr/py_wkssvc.c:27344:33: warning:
comparison of integer expressions of different signedness: ‘long int’
and ‘long long unsigned int’ [-Wsign-compare] <--[gcc]
    if (test_var < 0 || test_var > uint_max) {
                                 ^

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Dec 13 05:00:20 CET 2018 on sn-devel-144

4 months agopidl: Fix function for py_<name>_ndr_print_(in|out)
Andreas Schneider [Wed, 12 Dec 2018 19:53:00 +0000 (20:53 +0100)]
pidl: Fix function for py_<name>_ndr_print_(in|out)

The function takes two PyObject arguments, See:

https://docs.python.org/3/c-api/structures.html#c.PyCFunction

and

https://docs.python.org/2/c-api/structures.html#c.PyCFunction

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agopidl: Use C99 initializers for last element in ndr_interface_call(_pipes)
Andreas Schneider [Wed, 12 Dec 2018 18:10:32 +0000 (19:10 +0100)]
pidl: Use C99 initializers for last element in ndr_interface_call(_pipes)

librpc/gen_ndr/ndr_witness.c:1421:2: warning: missing initializer for
field ‘in_pipes’ of ‘const struct ndr_interface_call’
[-Wmissing-field-initializers] <--[gcc]
  { NULL, 0, NULL, NULL, NULL }
  ^

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
4 months agobuild: Workaround python3 hash order issues (for now)
Andrew Bartlett [Thu, 13 Dec 2018 00:06:48 +0000 (13:06 +1300)]
build: Workaround python3 hash order issues (for now)

This works around python3 having a new hash seed each time it starts to allow
a second "make" not to rebuild the world.

This should probably be reverted once we find the hash that is causing
the issue, but should reduce frustration for now.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
4 months agoselftest: Run waf build --dup-symbol-check under $PYTHON
Andrew Bartlett [Wed, 12 Dec 2018 04:08:21 +0000 (17:08 +1300)]
selftest: Run waf build --dup-symbol-check under $PYTHON

This would often be python3 in the new build

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Noel Power <npower@samba.org>