sfrench/samba-autobuild/.git
3 years agolibsocket: Make sure ifr.ifr_name is null-terminated
Andreas Schneider [Wed, 22 Jun 2016 09:26:06 +0000 (11:26 +0200)]
libsocket: Make sure ifr.ifr_name is null-terminated

Found by Coverity

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Dec  3 03:40:53 CET 2016 on sn-devel-144

3 years agomanpages/vfs_fruit: add warning to fruit:resoure=stream
Ralph Boehme [Thu, 10 Nov 2016 08:07:41 +0000 (09:07 +0100)]
manpages/vfs_fruit: add warning to fruit:resoure=stream

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoWHATSNEW: document fruit:resource option spelling issue
Ralph Boehme [Thu, 10 Nov 2016 13:01:16 +0000 (14:01 +0100)]
WHATSNEW: document fruit:resource option spelling issue

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agovfs_fruit: fix fruit:resource option spelling
Ralph Boehme [Tue, 8 Nov 2016 11:35:12 +0000 (12:35 +0100)]
vfs_fruit: fix fruit:resource option spelling

Fix all occurences of bad spelling of "resource" as "res*s*ource" (two
s).

One of the places where this was wrong was when parsing parametric
options in the VFS connect() function in the module. As a result any
setting of

  fruit:resource=something

in smb.conf was silently ignored and the default ("file") was active.

In Samba 4.6 we accept both the wrong and the correct spelling, in Samba
4.7 the bad spelling will be removed.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoutil: Initialize pointer
Andreas Schneider [Wed, 22 Jun 2016 07:36:00 +0000 (09:36 +0200)]
util: Initialize pointer

Coverity warns about so this will silence it.
Reviewed-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
3 years agologon script: clarify usage for different Samba roles
Alexander Bokovoy [Thu, 10 Nov 2016 09:07:42 +0000 (11:07 +0200)]
logon script: clarify usage for different Samba roles

'logon script' is only used when Samba runs as a logon server in the
classical domain controller role. And even there 'ldapsam' passdb
backend will override it.

For Samba AD setup 'logon script' is not used at all.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agos3:libsmb: restructure cli_full_connection_creds* flow
Stefan Metzmacher [Fri, 4 Nov 2016 10:34:02 +0000 (11:34 +0100)]
s3:libsmb: restructure cli_full_connection_creds* flow

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): Fri Dec  2 17:32:26 CET 2016 on sn-devel-144

3 years agos3:libnet_join: make use of cli_full_connection_creds()
Stefan Metzmacher [Thu, 1 Dec 2016 15:37:43 +0000 (16:37 +0100)]
s3:libnet_join: make use of cli_full_connection_creds()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:libsmb: change cli_full_connection_send/recv into cli_full_connection_creds_send...
Stefan Metzmacher [Wed, 26 Oct 2016 11:48:58 +0000 (13:48 +0200)]
s3:libsmb: change cli_full_connection_send/recv into cli_full_connection_creds_send/recv

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3:winbindd: always use saf_store(domain->alt_name, controller) for ad domains
Stefan Metzmacher [Fri, 4 Nov 2016 11:56:20 +0000 (12:56 +0100)]
s3:winbindd: always use saf_store(domain->alt_name, controller) for ad domains

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agotests/libsmb_samba_internal.py: fully setup the Credentials by creds.guess(lp)
Stefan Metzmacher [Fri, 2 Dec 2016 09:23:28 +0000 (10:23 +0100)]
tests/libsmb_samba_internal.py: fully setup the Credentials by creds.guess(lp)

It's important that we correctly initialize domain and realm.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib: Remove a used-once variable
Volker Lendecke [Tue, 29 Nov 2016 16:11:59 +0000 (16:11 +0000)]
lib: Remove a used-once variable

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Dec  2 13:31:59 CET 2016 on sn-devel-144

3 years agolib: Fix a comment
Volker Lendecke [Tue, 29 Nov 2016 16:01:58 +0000 (16:01 +0000)]
lib: Fix a comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib: Avoid includes.h in samlogon_cache.c
Volker Lendecke [Tue, 29 Nov 2016 15:59:21 +0000 (15:59 +0000)]
lib: Avoid includes.h in samlogon_cache.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib: Replace use of deprecated talloc_destroy
Volker Lendecke [Tue, 29 Nov 2016 15:56:19 +0000 (15:56 +0000)]
lib: Replace use of deprecated talloc_destroy

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib: Avoid fstring in samlogon_cache.c
Volker Lendecke [Tue, 29 Nov 2016 15:52:29 +0000 (15:52 +0000)]
lib: Avoid fstring in samlogon_cache.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib: Add samlogon_cache.h
Volker Lendecke [Tue, 29 Nov 2016 15:41:27 +0000 (15:41 +0000)]
lib: Add samlogon_cache.h

Move prototypes into its own header file

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib: Fix netsamlogon_cache_have for README.Coding
Volker Lendecke [Tue, 29 Nov 2016 15:20:14 +0000 (15:20 +0000)]
lib: Fix netsamlogon_cache_have for README.Coding

"False" should have gone long ago

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib: Delete unused netsamlogon_cache_shutdown
Volker Lendecke [Tue, 29 Nov 2016 14:58:51 +0000 (14:58 +0000)]
lib: Delete unused netsamlogon_cache_shutdown

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib: Delete an orphaned piece of code in samlogon_cache.c
Volker Lendecke [Tue, 29 Nov 2016 14:55:47 +0000 (14:55 +0000)]
lib: Delete an orphaned piece of code in samlogon_cache.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolib: Avoid includes.h in bitmap.c
Volker Lendecke [Sat, 26 Nov 2016 14:55:38 +0000 (15:55 +0100)]
lib: Avoid includes.h in bitmap.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agoselftest: Do not include system krb5.conf in selftest
Andreas Schneider [Thu, 1 Dec 2016 07:18:58 +0000 (08:18 +0100)]
selftest: Do not include system krb5.conf in selftest

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 years agos3:libads: Include system /etc/krb5.conf if we use MIT Kerberos
Andreas Schneider [Wed, 23 Nov 2016 13:40:42 +0000 (14:40 +0100)]
s3:libads: Include system /etc/krb5.conf if we use MIT Kerberos

The system /etc/krb5.conf defines some defaults like:

    default_ccache_name = KEYRING:persistent:%{uid}

We need to respect that so should include it in our own created
krb5.conf file.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 years agos3:param: Add an 'include system krb5 conf' option
Andreas Schneider [Wed, 23 Nov 2016 13:39:47 +0000 (14:39 +0100)]
s3:param: Add an 'include system krb5 conf' option

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
3 years agoctdb-tests: Use a separate directory for each local daemon
Martin Schwenke [Thu, 24 Nov 2016 05:37:26 +0000 (16:37 +1100)]
ctdb-tests: Use a separate directory for each local daemon

Separate directory contains configuration file, PID file, public
addresses file, socket, databases and log file.

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): Fri Dec  2 04:19:18 CET 2016 on sn-devel-144

3 years agoctdb-ipalloc: Optimise check to see if IP is available on a node
Martin Schwenke [Fri, 18 Nov 2016 05:08:13 +0000 (16:08 +1100)]
ctdb-ipalloc: Optimise check to see if IP is available on a node

Use a "bitmap" of available IPs for each IP address instead of walking
the list of available IP addresses.

For ctdb/tests/takeover/lcp2.030.sh, this improves the time taken on
my laptop from:

  real 0m11.997s
  user 0m11.960s
  sys 0m0.000s

to

  real 0m8.571s
  user 0m8.544s
  sys 0m0.000s

So, when assigning all 900 IP addresses the improvement is about 25%.

For the no-op case (where all IPs are already assigned to nodes), the
extra setup adds a small fraction of a second for 900 IPs.
Intermediate cases result in intermediate improvements.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-daemon: Exit early if there are trailing command-line arguments
Martin Schwenke [Sun, 27 Nov 2016 22:51:48 +0000 (09:51 +1100)]
ctdb-daemon: Exit early if there are trailing command-line arguments

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agoctdb-daemon: Don't call ctdb_local_node_got_banned() on flag changes
Martin Schwenke [Tue, 8 Nov 2016 05:37:24 +0000 (16:37 +1100)]
ctdb-daemon: Don't call ctdb_local_node_got_banned() on flag changes

This function is currently called twice each time a node is banned.

ctdb_local_node_got_banned() is already called from the banning code,
either due to a received banning control or a node banning itself.
Given that other nodes can't set a node's BANNED flag, a node can only
be banned via the above mechanisms, so drop the redundant call.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agos3-libads: Fix canonicalization support with MIT Kerberos
Andreas Schneider [Mon, 15 Feb 2016 11:09:59 +0000 (12:09 +0100)]
s3-libads: Fix canonicalization support with MIT Kerberos

This allows to authenticate using user@DOMAIN against an AD DC.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec  2 00:23:02 CET 2016 on sn-devel-144

3 years agos3: libsmb: Setting the LIBSMBCLIENT_NO_CCACHE environment variable doesn't turn...
Jeremy Allison [Wed, 30 Nov 2016 18:25:53 +0000 (10:25 -0800)]
s3: libsmb: Setting the LIBSMBCLIENT_NO_CCACHE environment variable doesn't turn off credential cache use.

Signed-off-by: Jeremy Allison <jra@samba.org>
3 years agoreplace: Include libgen.h if available
Amitay Isaacs [Thu, 1 Dec 2016 01:12:47 +0000 (12:12 +1100)]
replace: Include libgen.h if available

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Dec  1 18:08:54 CET 2016 on sn-devel-144

3 years agosmbd: avoid extra churn on a debug print
Uri Simchoni [Thu, 1 Dec 2016 04:29:34 +0000 (06:29 +0200)]
smbd: avoid extra churn on a debug print

Remove the user / group name in debug-printing of a
POSIX-ACL-derived ACE.

Obtaining the user name might result an extra lookup
to the domain. In a typical case, a user raises logging
level to 10 to troubleshoot an issue, so connectivity
problems are likely to exist. In that case we won't want
the extra debug printing to create more issues.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
3 years agoperf: Add simple tests for the open/close a database case
Andrew Bartlett [Mon, 17 Oct 2016 21:39:00 +0000 (10:39 +1300)]
perf: Add simple tests for the open/close a database case

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Dec  1 09:40:20 CET 2016 on sn-devel-144

3 years agoKCC: unconnected graph test
Clive Ferreira [Thu, 3 Nov 2016 23:31:09 +0000 (12:31 +1300)]
KCC: unconnected graph test

Uses a unconnected 5 DC single site database to test Douglas Bagnalls
patch which corrected a mix up between a str and an object which caused
infinite recursion and a method call on a None type.

This test patch originally triggered an edge case bug. This bug is
triggered by code to create additional edges which normally never ran.
In normal cases, the leftover connections made during a join would
prevent these additional edges from being created.

Signed-off-by: Clive Ferreira <cliveferreira@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoKCC: avoid infinite recursion when edgelist contains self
Douglas Bagnall [Wed, 2 Nov 2016 03:49:49 +0000 (16:49 +1300)]
KCC: avoid infinite recursion when edgelist contains self

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoKCC: Graphnode.add_edge_from expects dn strings, not objects
Douglas Bagnall [Wed, 2 Nov 2016 03:48:50 +0000 (16:48 +1300)]
KCC: Graphnode.add_edge_from expects dn strings, not objects

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb: new ldb version 1.1.29 ldb-1.1.29
Andrew Bartlett [Mon, 28 Nov 2016 01:05:41 +0000 (14:05 +1300)]
ldb: new ldb version 1.1.29

 - new OID LDB_CONTROL_RECALCULATE_RDN_OID
 - honour LDB_CONTROL_RECALCULATE_RDN_OID in rdn_modify
 - fix handling of @ATTRIBUTES containing * in rdn_modify
 - improve startup performance on AD DC databases
  - These have lots of index attributes and attributes specified

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb: Add test for behaviour of rdn_name
Andrew Bartlett [Wed, 30 Nov 2016 23:11:46 +0000 (12:11 +1300)]
ldb: Add test for behaviour of rdn_name

Cover a wildcard in @ATTRIBUTES and the normal case.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb: Cope with a->name being *
Andrew Bartlett [Tue, 29 Nov 2016 03:20:07 +0000 (16:20 +1300)]
ldb: Cope with a->name being *

The default schema when loaded from the DB will have a name of *, not NULL.

This feature is rarely used, and was incompatible with the rdn_name module
until now.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb:rdn_name: add support for LDB_CONTROL_RECALCULATE_RDN_OID on ldb_modify()
Stefan Metzmacher [Thu, 10 Nov 2016 17:03:26 +0000 (18:03 +0100)]
ldb:rdn_name: add support for LDB_CONTROL_RECALCULATE_RDN_OID on ldb_modify()

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb:rdn_name: normalize rdn_name in rdn_rename_callback()
Stefan Metzmacher [Thu, 10 Nov 2016 13:01:21 +0000 (14:01 +0100)]
ldb:rdn_name: normalize rdn_name in rdn_rename_callback()

We already do that on 'add'.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb: load @ATTRIBUTES faster by sorting once, not at each insertion
Andrew Bartlett [Wed, 19 Oct 2016 00:24:36 +0000 (13:24 +1300)]
ldb: load @ATTRIBUTES faster by sorting once, not at each insertion

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb: Add helper function ldb_schema_attribute_fill_with_syntax()
Andrew Bartlett [Thu, 20 Oct 2016 03:01:42 +0000 (16:01 +1300)]
ldb: Add helper function ldb_schema_attribute_fill_with_syntax()

This will allow us to avoid calling ldb_schema_attribute_add_with_syntax()
in a tight loop.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb: Reduce per-attribute memory allocation during @ATTRIBUTES load
Andrew Bartlett [Fri, 14 Oct 2016 02:42:53 +0000 (15:42 +1300)]
ldb: Reduce per-attribute memory allocation during @ATTRIBUTES load

This means we do just a few allocations, not multiple per configured attribute (there can be 1000s)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb: Reduce scope of allocation and de-allocation of @ATTRIBUTES
Andrew Bartlett [Fri, 14 Oct 2016 02:35:46 +0000 (15:35 +1300)]
ldb: Reduce scope of allocation and de-allocation of @ATTRIBUTES

This memory does not need to be around long-term

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb: Add helper function ldb_schema_attribute_remove_flagged()
Andrew Bartlett [Thu, 20 Oct 2016 03:04:04 +0000 (16:04 +1300)]
ldb: Add helper function ldb_schema_attribute_remove_flagged()

This helps us avoid keeping a list of attributes to later remove on @ATTRIBUTES reload

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoldb:controls: add LDB_CONTROL_RECALCULATE_RDN_OID
Stefan Metzmacher [Thu, 10 Nov 2016 17:01:47 +0000 (18:01 +0100)]
ldb:controls: add LDB_CONTROL_RECALCULATE_RDN_OID

This will be used by 'samba-tool dbcheck' to fix the rdn attribute name.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
(Patch reduced by Andrew Bartlett to only allocate the OID)

3 years agoldb: Avoid individual memory allocations when searching for indexlist
Andrew Bartlett [Mon, 24 Oct 2016 21:56:43 +0000 (10:56 +1300)]
ldb: Avoid individual memory allocations when searching for indexlist

This reduces the talloc_free() cost when the ldb is terminated.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agodsdb: specify attributes when loading schema
Andrew Bartlett [Fri, 14 Oct 2016 02:43:46 +0000 (15:43 +1300)]
dsdb: specify attributes when loading schema

The LDB code performs better when the required attributes are listed, even when it is almost
all the attributes

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agopidl: Make static struct api_struct also const
Andrew Bartlett [Sun, 20 Nov 2016 22:58:07 +0000 (11:58 +1300)]
pidl: Make static struct api_struct also const

This moves the table to read-only memory

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agopidl: Change *_get_pipe_fns() to return const struct api_struct *
Andrew Bartlett [Sun, 20 Nov 2016 22:57:48 +0000 (11:57 +1300)]
pidl: Change *_get_pipe_fns() to return const struct api_struct *

This will allow the table to be made static const in the next commit

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agos4-rpc_server: Use an initialised static const struct in dcerpc_server_remote_init
Andrew Bartlett [Sun, 20 Nov 2016 22:42:30 +0000 (11:42 +1300)]
s4-rpc_server: Use an initialised static const struct in dcerpc_server_remote_init

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agos4-rpc_server: Use a type-safe struct signature in dcerpc_register_ep_server
Andrew Bartlett [Sun, 20 Nov 2016 22:39:16 +0000 (11:39 +1300)]
s4-rpc_server: Use a type-safe struct signature in dcerpc_register_ep_server

This is much safer than void *, and the void * feature appears no longer
to be needed after 31ded4901b4529ad2e49871502cab5ecba71483a

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agopidl: Use a static const initialised struct in dcerpc_server_$name_init(void)
Andrew Bartlett [Sun, 20 Nov 2016 22:38:24 +0000 (11:38 +1300)]
pidl: Use a static const initialised struct in dcerpc_server_$name_init(void)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agotorture: Remove access to LSARPC via \\pipe\netlogon in rpc.netlogon for ManyGetDCNam...
Andrew Bartlett [Wed, 9 Nov 2016 01:22:33 +0000 (14:22 +1300)]
torture: Remove access to LSARPC via \\pipe\netlogon in rpc.netlogon for ManyGetDCName test

This exploited the fact that we had \\pipe\lsass in both netlogon.idl and lsarpc.idl

To do this, we reset the binding to a new endpoint and reset the association group.

We add a new test specifically for this "feature" that we can knownfail if we
break it to add other new functionality.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agos4/rpc_server: Show what RPC interfaces are listening on which TCP port
Andrew Bartlett [Tue, 18 Oct 2016 23:45:05 +0000 (12:45 +1300)]
s4/rpc_server: Show what RPC interfaces are listening on which TCP port

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agotalloc: Add tests for talloc_parent() after realloc() of the parent
Andrew Bartlett [Sun, 27 Nov 2016 22:47:41 +0000 (11:47 +1300)]
talloc: Add tests for talloc_parent() after realloc() of the parent

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agotalloc: clarify that talloc_magic never includes the bits in TALLOC_FLAG_MASK
Andrew Bartlett [Tue, 22 Nov 2016 21:26:14 +0000 (10:26 +1300)]
talloc: clarify that talloc_magic never includes the bits in TALLOC_FLAG_MASK

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agotalloc: add ASCII art to describe parent/child arrangement
Andrew Bartlett [Mon, 28 Nov 2016 01:44:40 +0000 (14:44 +1300)]
talloc: add ASCII art to describe parent/child arrangement

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoFix typo
Alexis La Goutte [Wed, 26 Oct 2016 20:18:09 +0000 (22:18 +0200)]
Fix typo

Fix (minor) typo found in wireshark with lintian tools
https://code.wireshark.org/review/#/c/18485/

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agopython: Add py3compat.h
Petr Viktorin [Tue, 28 Jun 2016 15:58:04 +0000 (17:58 +0200)]
python: Add py3compat.h

This adds a shared header file with macros that enable compatibility
between Python 2 and 3.
The macros are the ones used in ldb/tdb, with some additions
that make sense when the header is shared among several modules.
See the module for a summary of contents.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agopython: samba.subunit.run: Fix Python 3 compatibility.
Lumir Balhar [Wed, 19 Oct 2016 11:32:59 +0000 (13:32 +0200)]
python: samba.subunit.run: Fix Python 3 compatibility.

Usage of function _test_id() which generates test id in bytes breaks
Python 3 compatibility. After fix, this function is not used any more.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agopython: selftesthelpers: Add possibility for planning tests for
Lumir Balhar [Wed, 19 Oct 2016 18:51:47 +0000 (20:51 +0200)]
python: selftesthelpers: Add possibility for planning tests for
'extra_python' (Python 3).

This change allows us to mark modules which are Python 3 compatible
with the keyword argument `py3_compatible`. Then, if building with
Python 3 is configured using --extra-python, `planpythontestsuite`
will plan an extra Python test for each marked module.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agopython: wscript_build: Prepare build environment for Python 3 porting
Lumir Balhar [Wed, 19 Oct 2016 18:26:22 +0000 (20:26 +0200)]
python: wscript_build: Prepare build environment for Python 3 porting

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agojoin.py: Attempt to allocate a RID Set during the join
Andrew Bartlett [Mon, 31 Oct 2016 03:48:33 +0000 (16:48 +1300)]
join.py: Attempt to allocate a RID Set during the join

If we are joining the RID Manager, then we should get a RID Set, but
otherwise we should accept failure with the right error code

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoselftest: Ensure vampiredc has a full copy of localdc before we start
Andrew Bartlett [Wed, 30 Nov 2016 04:09:44 +0000 (17:09 +1300)]
selftest: Ensure vampiredc has a full copy of localdc before we start

Otherwise we may fail tests because we are still pulling in the full replica
from localdc during the tests.  This may block RID allocation in particular.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoselftest: Rework child process cleanup
Andrew Bartlett [Wed, 30 Nov 2016 01:18:46 +0000 (14:18 +1300)]
selftest: Rework child process cleanup

We now:
 - call gdb_backtrace on the stuck pid to determine why it is stuck
 - cleanup faster as we catch the process exit
   (by not waiting until 1 second after the exit for waitpid() to return -1)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agoselftest/gdb_*: make use of 'mktemp'
Stefan Metzmacher [Wed, 23 Nov 2016 11:26:18 +0000 (12:26 +0100)]
selftest/gdb_*: make use of 'mktemp'

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
3 years agolibrpc: cab: Fix ndr_size_cab_file() to detect integer wrap.
Jeremy Allison [Wed, 30 Nov 2016 17:23:52 +0000 (09:23 -0800)]
librpc: cab: Fix ndr_size_cab_file() to detect integer wrap.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Dec  1 05:53:43 CET 2016 on sn-devel-144

3 years agolibrpc: cab: Integer wrap protection for ndr_count_cfdata().
Jeremy Allison [Wed, 30 Nov 2016 17:19:43 +0000 (09:19 -0800)]
librpc: cab: Integer wrap protection for ndr_count_cfdata().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agosmbclient: fix string formatting in print command
Douglas Bagnall [Tue, 1 Nov 2016 01:18:38 +0000 (14:18 +1300)]
smbclient: fix string formatting in print command

At one time, the variables lname and rname were char arrays, but now they
are pointers. When they were arrays, sizeof(rname) was the length of the
array, but now it gives the size of the pointer which is not what we want.

In the case where the filename is -, rname was alloced as size 1, which
could never fit the name it wanted to have contain ("stdin-<pid>").

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agosmbd/service_stream: connection processing flag is not really bool
Douglas Bagnall [Wed, 30 Nov 2016 01:56:16 +0000 (14:56 +1300)]
smbd/service_stream: connection processing flag is not really bool

The warning is:

../source4/smbd/service_stream.c: In function ‘stream_io_handler’:
../source4/smbd/service_stream.c:94:18: warning: increment of a boolean expression [-Wbool-operation]
  conn->processing++;
                    ^~
../source4/smbd/service_stream.c:100:18: warning: decrement of a boolean expression [-Wbool-operation]
  conn->processing--;
                    ^~

while the code in question looks like:

conn->processing++;
if (flags & TEVENT_FD_WRITE) {
conn->ops->send_handler(conn, flags);
} else if (flags & TEVENT_FD_READ) {
conn->ops->recv_handler(conn, flags);
}
conn->processing--;

If this is never going to be nested, processing can be bool and the ++
and -- can be true/false assignments. But it seems possible that these
might be nested so it is better to go the other way.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Dec  1 00:28:05 CET 2016 on sn-devel-144

3 years agolib/registry/regf: better initialise nk_block
Douglas Bagnall [Wed, 30 Nov 2016 01:19:39 +0000 (14:19 +1300)]
lib/registry/regf: better initialise nk_block

We were initialising a uint32_t[5] block with memset(..., 5) when we
surely meant memset(..., 5 * sizeof(uint32_t)) or some equivalent.

Thanks go to gcc-7 and -Wmemset-elt-size. The warning looks like this:

../source4/lib/registry/regf.c: In function ‘reg_create_regf_file’:
../source4/lib/registry/regf.c:2095:2: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
  memset(nk.unk3, 0, 5);
    ^~~~~~

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agoldb: Fix an unused variable warning
Volker Lendecke [Mon, 21 Nov 2016 20:41:51 +0000 (21:41 +0100)]
ldb: Fix an unused variable warning

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agoldb: Fix typos
Volker Lendecke [Mon, 21 Nov 2016 20:40:21 +0000 (21:40 +0100)]
ldb: Fix typos

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
3 years agotdb: version 1.3.12 tdb-1.3.12
Stefan Metzmacher [Wed, 30 Nov 2016 15:05:28 +0000 (16:05 +0100)]
tdb: version 1.3.12

* Bug 12455 - tdb mutexes don't work on FreeBSD

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Nov 30 20:02:28 CET 2016 on sn-devel-144

3 years agoparam: fix lp_parameter_value_is_valid() for parametric options
Ralph Wuerthner [Mon, 28 Nov 2016 09:42:33 +0000 (10:42 +0100)]
param: fix lp_parameter_value_is_valid() for parametric options

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Nov 30 04:00:54 CET 2016 on sn-devel-144

3 years agotdb: Fix mutexes on FreeBSD
Volker Lendecke [Mon, 21 Nov 2016 20:00:01 +0000 (21:00 +0100)]
tdb: Fix mutexes on FreeBSD

susv4 on mmap has the following snippet:

> The state of synchronization objects such as mutexes, semaphores,
> barriers, and conditional variables placed in shared memory mapped
> with MAP_SHARED becomes undefined when the last region in any process
> containing the synchronization object is unmapped.

This means we can't keep the mutex mmap area unmapped at any point
in time.

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

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 Nov 29 23:59:52 CET 2016 on sn-devel-144

3 years agotdb: Only mmap the mutex area if not already mmap'ed
Volker Lendecke [Mon, 21 Nov 2016 19:58:08 +0000 (20:58 +0100)]
tdb: Only mmap the mutex area if not already mmap'ed

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agotdb: NULL out tdb->mutexes in tdb_mutex_munmap
Volker Lendecke [Mon, 21 Nov 2016 19:56:55 +0000 (20:56 +0100)]
tdb: NULL out tdb->mutexes in tdb_mutex_munmap

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
3 years agoctdb-common: Drop CTDB's copy of sys_read() and sys_write()
Martin Schwenke [Tue, 29 Nov 2016 01:55:06 +0000 (12:55 +1100)]
ctdb-common: Drop CTDB's copy of sys_read() and sys_write()

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 Nov 29 11:22:40 CET 2016 on sn-devel-144

3 years agoctdb-lock-helper: Drop include of ctdb_private.h
Martin Schwenke [Tue, 29 Nov 2016 01:54:00 +0000 (12:54 +1100)]
ctdb-lock-helper: Drop include of ctdb_private.h

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agolib/util: Make sys_rw available to CTDB
Martin Schwenke [Tue, 29 Nov 2016 01:21:33 +0000 (12:21 +1100)]
lib/util: Make sys_rw available to CTDB

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
3 years agontlm_auth4: Remove it
Volker Lendecke [Tue, 22 Nov 2016 00:54:08 +0000 (01:54 +0100)]
ntlm_auth4: Remove it

This had install=False for rather exactly 4 years now. If someone wants to
start working on it again, we can always dig it up from the git history.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Nov 29 02:18:37 CET 2016 on sn-devel-144

3 years agoctdb-daemon: Mark RecoverPDBBySeqNum tunable deprecated
Amitay Isaacs [Fri, 18 Nov 2016 04:09:26 +0000 (15:09 +1100)]
ctdb-daemon: Mark RecoverPDBBySeqNum tunable deprecated

Persistent databases are now always recovered by sequence number, so
there is no need for this tunable.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Nov 25 08:13:59 CET 2016 on sn-devel-144

3 years agoctdb-daemon: Remove unused code cmdline.[ch]
Amitay Isaacs [Fri, 18 Nov 2016 03:57:47 +0000 (14:57 +1100)]
ctdb-daemon: Remove unused code cmdline.[ch]

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-daemon: Consolidate command line options to ctdbd
Amitay Isaacs [Fri, 18 Nov 2016 03:52:38 +0000 (14:52 +1100)]
ctdb-daemon: Consolidate command line options to ctdbd

This inserts the code from ctdb_cmdline_init() function directly in
main(), so common/cmdline.[ch] can be removed.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agoctdb-tests: Remove unused test code
Amitay Isaacs [Fri, 18 Nov 2016 03:27:35 +0000 (14:27 +1100)]
ctdb-tests: Remove unused test code

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
3 years agos4-torture: Add LZX compressed cabinet test
Günther Deschner [Fri, 23 Sep 2016 15:19:59 +0000 (17:19 +0200)]
s4-torture: Add LZX compressed cabinet test

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Nov 25 00:17:02 CET 2016 on sn-devel-144

3 years agos4-torture: Add MSZIP compressed cabinet test
Günther Deschner [Fri, 23 Sep 2016 15:19:25 +0000 (17:19 +0200)]
s4-torture: Add MSZIP compressed cabinet test

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4-torture: Add a validation test for uncompressed Cabinet files
Günther Deschner [Fri, 23 Sep 2016 15:20:30 +0000 (17:20 +0200)]
s4-torture: Add a validation test for uncompressed Cabinet files

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos4-torture: Introduce Cabinet ndr testsuite
Günther Deschner [Fri, 23 Sep 2016 15:18:12 +0000 (17:18 +0200)]
s4-torture: Introduce Cabinet ndr testsuite

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibrpc: Add ndr_cab_get_compression() for Cabinet compression evaluation
Günther Deschner [Mon, 19 Sep 2016 22:20:18 +0000 (00:20 +0200)]
librpc: Add ndr_cab_get_compression() for Cabinet compression evaluation

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibrpc: Add autogenerated file offset calculation for Cabinet files
Günther Deschner [Sat, 24 Sep 2016 00:51:20 +0000 (02:51 +0200)]
librpc: Add autogenerated file offset calculation for Cabinet files

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibrpc: Add autogenerated total cabinet size for Cabinet files
Günther Deschner [Tue, 20 Sep 2016 23:46:54 +0000 (01:46 +0200)]
librpc: Add autogenerated total cabinet size for Cabinet files

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibrpc: Add autogenerated checksum calculation for Cabinet files
Günther Deschner [Thu, 15 Sep 2016 22:15:30 +0000 (00:15 +0200)]
librpc: Add autogenerated checksum calculation for Cabinet files

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agolibrpc: Introduce cab.idl
Günther Deschner [Thu, 15 Sep 2016 11:36:35 +0000 (13:36 +0200)]
librpc: Introduce cab.idl

This allows processing of Windows Cabinet files (required for the MS-PAR
print protocol implementation)

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3-rpcclient: Add AsyncCorePrinterDriverInstalled command
Günther Deschner [Tue, 22 Nov 2016 11:07:23 +0000 (12:07 +0100)]
s3-rpcclient: Add AsyncCorePrinterDriverInstalled command

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3-rpcclient: Add rpcclient IRemoteWinspool commands
Günther Deschner [Tue, 15 Jan 2013 14:22:43 +0000 (15:22 +0100)]
s3-rpcclient: Add rpcclient IRemoteWinspool commands

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
3 years agos3-rpc_cli: Support the use of the object_uuid in rpc_cli interfaces
Günther Deschner [Wed, 23 Jan 2013 09:34:12 +0000 (10:34 +0100)]
s3-rpc_cli: Support the use of the object_uuid in rpc_cli interfaces

Guenther

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