metze/samba/wip.git
5 years agoallow_remaining master4-drsuapi
Stefan Metzmacher [Mon, 10 Dec 2012 23:12:39 +0000 (00:12 +0100)]
allow_remaining

5 years agoRevert "dbcheck transaction..."
Stefan Metzmacher [Wed, 23 Jan 2013 15:34:28 +0000 (16:34 +0100)]
Revert "dbcheck transaction..."

This reverts commit 772214889835d66e1fa3273ac7614ee169868acb.

5 years agodbcheck transaction...
Stefan Metzmacher [Mon, 14 Jan 2013 08:45:34 +0000 (09:45 +0100)]
dbcheck transaction...

5 years agorevert ...
Stefan Metzmacher [Tue, 8 Jan 2013 15:10:06 +0000 (16:10 +0100)]
revert ...

Conflicts:

5 years agoallow_remaining
Stefan Metzmacher [Mon, 10 Dec 2012 23:12:39 +0000 (00:12 +0100)]
allow_remaining

5 years agoreformat
Stefan Metzmacher [Wed, 23 Jan 2013 15:32:18 +0000 (16:32 +0100)]
reformat

5 years agogeneric mapping inherit
Stefan Metzmacher [Sat, 1 Dec 2012 16:25:44 +0000 (17:25 +0100)]
generic mapping inherit

5 years agontvfs: inherit generic
Stefan Metzmacher [Sat, 1 Dec 2012 16:11:10 +0000 (17:11 +0100)]
ntvfs: inherit generic

5 years agodebug gpo
Stefan Metzmacher [Sat, 1 Dec 2012 16:10:40 +0000 (17:10 +0100)]
debug gpo

5 years agoTODO review after conflicts s4:provision: fix sysvol security_descriptors (let them...
Stefan Metzmacher [Sat, 1 Dec 2012 15:05:11 +0000 (16:05 +0100)]
TODO review after conflicts s4:provision: fix sysvol security_descriptors (let them match a Windows 2008R2 DC)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos4:python/ntacl: add fsacl_child_sd() function
Stefan Metzmacher [Sat, 1 Dec 2012 13:36:21 +0000 (14:36 +0100)]
s4:python/ntacl: add fsacl_child_sd() function

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agotests/posixacl.py
Stefan Metzmacher [Sat, 1 Dec 2012 14:59:18 +0000 (15:59 +0100)]
tests/posixacl.py

5 years agos4:samba-tool/gpo: fix 'aclcheck' against a Windows 2008R2 DC
Stefan Metzmacher [Sat, 1 Dec 2012 13:31:19 +0000 (14:31 +0100)]
s4:samba-tool/gpo: fix 'aclcheck' against a Windows 2008R2 DC

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos4:provision: add SYSVOL specific security_descriptors
Stefan Metzmacher [Sat, 1 Dec 2012 13:29:44 +0000 (14:29 +0100)]
s4:provision: add SYSVOL specific security_descriptors

These are the onces used to provision the SYSVOL on
a Windows 2008R2 DC.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos4:samba-tool/gpo: set the same security.descriptor type as the Windows GUI
Stefan Metzmacher [Thu, 29 Nov 2012 08:57:44 +0000 (09:57 +0100)]
s4:samba-tool/gpo: set the same security.descriptor type as the Windows GUI

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos4:python/ntacl: change dsacl2fsacl() to match a windows client
Stefan Metzmacher [Thu, 29 Nov 2012 08:57:44 +0000 (09:57 +0100)]
s4:python/ntacl: change dsacl2fsacl() to match a windows client

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoTODO s3:util_sd: also print the SACL if available
Stefan Metzmacher [Fri, 30 Nov 2012 13:50:09 +0000 (14:50 +0100)]
TODO s3:util_sd: also print the SACL if available

5 years agoRevert "TODO breaks tests libcli/security: fix the CREATOR_OWNER order in calculate_i...
Stefan Metzmacher [Thu, 19 Apr 2018 11:13:41 +0000 (13:13 +0200)]
Revert "TODO breaks tests libcli/security: fix the CREATOR_OWNER order in calculate_inherited_from_parent()"

This reverts commit 810b0506be38d65b6aef63df2236c8d3ff1618ca.

5 years agoTODO breaks tests libcli/security: fix the CREATOR_OWNER order in calculate_inherited...
Stefan Metzmacher [Fri, 30 Nov 2012 21:44:58 +0000 (22:44 +0100)]
TODO breaks tests libcli/security: fix the CREATOR_OWNER order in calculate_inherited_from_parent()

The inherited object/container specific CREATOR_OWNER ace should be inserted
before the generic CREATOR_OWNER ace.

This also matches the behavior of a Windows (2008R2) DC
for active directory SDs and also matches the logic for filesystem SDs,
see se_create_child_secdesc().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoDEBUG s4:torture/dssync: ...
Stefan Metzmacher [Sat, 15 Dec 2012 10:14:58 +0000 (11:14 +0100)]
DEBUG s4:torture/dssync: ...

5 years agoRevert "TODO this could be wrong, but NULL also...? dsdb-acl: pass the object type...
Stefan Metzmacher [Thu, 19 Apr 2018 11:09:19 +0000 (13:09 +0200)]
Revert "TODO this could be wrong, but NULL also...? dsdb-acl: pass the object type to dsdb_module_check_access_on_dn()"

This reverts commit acce19b702c34d71ccd0e321c0da32d382d5c3c3.

5 years agoTODO this could be wrong, but NULL also...? dsdb-acl: pass the object type to dsdb_mo...
Stefan Metzmacher [Thu, 17 Jan 2013 12:45:30 +0000 (13:45 +0100)]
TODO this could be wrong, but NULL also...? dsdb-acl: pass the object type to dsdb_module_check_access_on_dn()

5 years agoHACK samba_upgradeprovision backtrace
Stefan Metzmacher [Wed, 23 Jan 2013 14:56:13 +0000 (15:56 +0100)]
HACK samba_upgradeprovision backtrace

5 years agoTODO: samba_upgradeprovision: do not overwrite changed nTSecurityDescriptor values
Stefan Metzmacher [Fri, 1 Feb 2013 09:27:19 +0000 (10:27 +0100)]
TODO: samba_upgradeprovision: do not overwrite changed nTSecurityDescriptor values

5 years agoRevert "TODO... s4:scripting/python: add support for utf-8 passwords from the command...
Stefan Metzmacher [Thu, 14 Feb 2019 08:45:08 +0000 (09:45 +0100)]
Revert "TODO... s4:scripting/python: add support for utf-8 passwords from the command line BETTER PyUnicode_FromString???"

This reverts commit d8ff9bb0bf25ee7f82b00acfb1e5914162200579.

5 years agoTODO... s4:scripting/python: add support for utf-8 passwords from the command line...
Stefan Metzmacher [Mon, 4 Feb 2013 10:41:39 +0000 (11:41 +0100)]
TODO... s4:scripting/python: add support for utf-8 passwords from the command line BETTER PyUnicode_FromString???

5 years agoRevert "s4:dsdb:repl_meta_data: make sure we have an invocation id"
Stefan Metzmacher [Tue, 30 Oct 2012 09:50:37 +0000 (10:50 +0100)]
Revert "s4:dsdb:repl_meta_data: make sure we have an invocation id"

This reverts commit 1ac892ea69e43ae175d13d9c0fd76b1a3288b296.

5 years agoRevert "panic without invocation_id 1"
Stefan Metzmacher [Tue, 30 Oct 2012 09:50:34 +0000 (10:50 +0100)]
Revert "panic without invocation_id 1"

This reverts commit 8d0b0e3c6a23ac9781a92f64c73ec994410550ab.

5 years agoRevert "panic without invocation_id 2"
Stefan Metzmacher [Tue, 30 Oct 2012 09:50:31 +0000 (10:50 +0100)]
Revert "panic without invocation_id 2"

This reverts commit 4892185ef8f0eda50e804c2b608cb438c9fdb12d.

5 years agoRevert "move invocation_id check"
Stefan Metzmacher [Tue, 30 Oct 2012 09:50:26 +0000 (10:50 +0100)]
Revert "move invocation_id check"

This reverts commit 3389503849e22efabe83a9ba8a0b3920e63752e7.

5 years agoRevert "repl_meta_data was aecb1a1d8997fc6a1ddf8b32ec02dcfcea1e0469 IMPORTANT!!!!"
Stefan Metzmacher [Thu, 19 Apr 2018 10:59:29 +0000 (12:59 +0200)]
Revert "repl_meta_data was aecb1a1d8997fc6a1ddf8b32ec02dcfcea1e0469 IMPORTANT!!!!"

This reverts commit c73436f3f0c57ba2a70a100a52eeb342c769763d.

5 years agorepl_meta_data was aecb1a1d8997fc6a1ddf8b32ec02dcfcea1e0469 IMPORTANT!!!!
Stefan Metzmacher [Wed, 17 Oct 2012 14:01:40 +0000 (16:01 +0200)]
repl_meta_data was aecb1a1d8997fc6a1ddf8b32ec02dcfcea1e0469 IMPORTANT!!!!

5 years agomove invocation_id check
Stefan Metzmacher [Wed, 17 Oct 2012 10:39:09 +0000 (12:39 +0200)]
move invocation_id check

5 years agopanic without invocation_id 1
Stefan Metzmacher [Wed, 17 Oct 2012 10:35:41 +0000 (12:35 +0200)]
panic without invocation_id 1

5 years agoRevert "TODO: s3:smb2:durable: get up-to-date stat in vfs_default_durable_disconnect"
Michael Adam [Wed, 13 Feb 2013 13:31:33 +0000 (14:31 +0100)]
Revert "TODO: s3:smb2:durable: get up-to-date stat in vfs_default_durable_disconnect"

This reverts commit 6796f09aa9de931f61aeb8065fe49fb3879b6c95.

5 years agoTODO: s3:smb2:durable: get up-to-date stat in vfs_default_durable_disconnect
Michael Adam [Tue, 12 Feb 2013 16:22:33 +0000 (17:22 +0100)]
TODO: s3:smb2:durable: get up-to-date stat in vfs_default_durable_disconnect

strangely, the st_ex_mode was masked down to the permissions for me
so S_ISREG() failed, and disconnect failed, and file was closed recgularly

5 years agoTODO.net_serverid_wipedbs
Michael Adam [Tue, 12 Feb 2013 12:45:28 +0000 (13:45 +0100)]
TODO.net_serverid_wipedbs

5 years agos4:torture/smb2: test_notify_tcp_dis trigger idle event every 0.25s
Stefan Metzmacher [Sun, 17 Feb 2013 21:45:32 +0000 (22:45 +0100)]
s4:torture/smb2: test_notify_tcp_dis trigger idle event every 0.25s

This is 1000 times longer than before and is less likely to
change the timing behavior whe n running under valgrind.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos4:torture/raw: test_notify_tcp_dis trigger idle event every 0.25s
Stefan Metzmacher [Sun, 17 Feb 2013 21:43:49 +0000 (22:43 +0100)]
s4:torture/raw: test_notify_tcp_dis trigger idle event every 0.25s

This is 1000 times longer than before and is less likely to
change the timing behavior whe n running under valgrind.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos4:libcli/smb2: don't schedule idle handlers on a dead connection
Stefan Metzmacher [Sun, 17 Feb 2013 21:41:00 +0000 (22:41 +0100)]
s4:libcli/smb2: don't schedule idle handlers on a dead connection

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agos4:libcli/raw: don't schedule idle handlers on a dead connection
Stefan Metzmacher [Sun, 17 Feb 2013 21:39:40 +0000 (22:39 +0100)]
s4:libcli/raw: don't schedule idle handlers on a dead connection

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years agoRevert "TODO: dsdb/repl: Reduce noice during replication of Windows 2012 R2 schema...
Stefan Metzmacher [Fri, 15 Feb 2019 15:58:05 +0000 (16:58 +0100)]
Revert "TODO: dsdb/repl: Reduce noice during replication of Windows 2012 R2 schema by ignoring more attributes"

This reverts commit 5546d46770fe6955ff835ad21cf74b94f78a1b23.

5 years agoTODO: dsdb/repl: Reduce noice during replication of Windows 2012 R2 schema by ignorin...
Andrew Bartlett [Sat, 3 Sep 2016 09:58:47 +0000 (21:58 +1200)]
TODO: dsdb/repl: Reduce noice during replication of Windows 2012 R2 schema by ignoring more attributes

We do not need to know about the attributes that are permitted in a
class, nor the permitted parent or subClass values to convert the
objects from DRS, as we never enforce schema restrictions on DRS
replicated objects.

This will not change how we eventually succeed or fail, because we
have to convert the object in the end, but this means less looping
while we do that.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
5 years agoTODO: add protection against DC restores
Stefan Metzmacher [Thu, 19 Apr 2018 12:38:38 +0000 (14:38 +0200)]
TODO: add protection against DC restores

5 years agoTODO: drs_local_replicate schema
Stefan Metzmacher [Tue, 12 Feb 2019 10:33:44 +0000 (11:33 +0100)]
TODO: drs_local_replicate schema

5 years agodsdb/repl: we need to replicate the whole schema before we can apply it
Stefan Metzmacher [Fri, 8 Feb 2019 14:49:55 +0000 (14:49 +0000)]
dsdb/repl: we need to replicate the whole schema before we can apply it

Otherwise we may not be able to construct a working schema that's
required to apply the changes.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
5 years ago.gitignore: add ignore rules for a few dev tools
Joe Guo [Thu, 7 Feb 2019 22:25:44 +0000 (11:25 +1300)]
.gitignore: add ignore rules for a few dev tools

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Feb 15 06:07:07 CET 2019 on sn-devel-144

5 years agoautobuild: Drop 'py2' flag
Tim Beale [Thu, 14 Feb 2019 23:20:10 +0000 (12:20 +1300)]
autobuild: Drop 'py2' flag

This isn't used any more. It was only being set, never referenced.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoautobuild: Replace samba-buildpy2-only with samba-nopython-py2
Tim Beale [Thu, 14 Feb 2019 23:17:49 +0000 (12:17 +1300)]
autobuild: Replace samba-buildpy2-only with samba-nopython-py2

For Samba 4.11, the minimum python2 functionality we will support (for
now, at least - we may change our minds) is for the --disable-python
target, i.e. if you're excluding all the python functionality from
samba, then WAF should still support being built with python2.

The use case here is old unix platforms that want to use smbd, but don't
have python3 support.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoautobuild: Remove ${EXTRA_PYTHON} variable
Tim Beale [Thu, 14 Feb 2019 22:58:51 +0000 (11:58 +1300)]
autobuild: Remove ${EXTRA_PYTHON} variable

We no longer build the python2 bindings, only python3. So we can get rid
of this variable now.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoautobuild: Tidy up unnecessary line-breaks in 'TESTS='
Tim Beale [Thu, 14 Feb 2019 22:45:53 +0000 (11:45 +1300)]
autobuild: Tidy up unnecessary line-breaks in 'TESTS='

Now that we've dropped the {PY3_ONLY} variable, there's no need for
line-breaks in some of the 'TESTS=' values. We can tidy this up a bit.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoautobuild: Remove the PY3_ONLY variable
Tim Beale [Thu, 14 Feb 2019 22:44:21 +0000 (11:44 +1300)]
autobuild: Remove the PY3_ONLY variable

This variable is no longer needed as all the tests run using python3
now.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoautobuild: Update variable name to make more sense
Tim Beale [Tue, 12 Feb 2019 23:41:34 +0000 (12:41 +1300)]
autobuild: Update variable name to make more sense

When we switched from python2 being the default to python3, we didn't
update this variable name. It's now handling the python2 case, but it's
a boolean flag named 'py3', which is rather confusing.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoautobuild: Drop py2 autobuild jobs
Tim Beale [Tue, 12 Feb 2019 23:12:18 +0000 (12:12 +1300)]
autobuild: Drop py2 autobuild jobs

Samba v4.11 will no longer support python2, so let's drop the autobuild
jobs. This will save some gitlab/sn-devel time and money, as it's less
work for CI to do.

Note that this highlights some previous inconsistencies:
- samba-none-env-py2 was being built for gitlab but not sn-devel.
- samba-nt4-py2 was being built for sn-devel but not gitlab

I've left samba-buildpy2-only for now, which will be addressed in a
subsequent patch.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agogitlab-ci: Rename DOCKER to CONTAINER
Andreas Schneider [Thu, 14 Feb 2019 07:19:46 +0000 (08:19 +0100)]
gitlab-ci: Rename DOCKER to CONTAINER

This is just a runc container, not tied to docker. See podman.io

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Björn Jacke <bj@sernet.de>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb 14 17:32:38 CET 2019 on sn-devel-144

5 years agowaf: Do not install internal header
Andreas Schneider [Wed, 13 Feb 2019 09:44:45 +0000 (10:44 +0100)]
waf: Do not install internal header

We should not install header files without an public API:

- memory.h
- safe_strings.h
- talloc_stack.h

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agolib:util: Move discard_const(_p) to own header for libndr.h
Andreas Schneider [Wed, 6 Feb 2019 15:05:48 +0000 (16:05 +0100)]
lib:util: Move discard_const(_p) to own header for libndr.h

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agopidl: Use NDR_ZERO_STRUCT(P) macros
Andreas Schneider [Wed, 13 Feb 2019 09:41:19 +0000 (10:41 +0100)]
pidl: Use NDR_ZERO_STRUCT(P) macros

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agolibrpc:ndr: Add NDR_ZERO_STRUCT(P) macros
Andreas Schneider [Wed, 13 Feb 2019 09:38:02 +0000 (10:38 +0100)]
librpc:ndr: Add NDR_ZERO_STRUCT(P) macros

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agolibrpc:ndr: Implement ndr_zero_memory()
Andreas Schneider [Wed, 13 Feb 2019 09:35:13 +0000 (10:35 +0100)]
librpc:ndr: Implement ndr_zero_memory()

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agolib:util: Add GPL header to tftw.c
Andreas Schneider [Wed, 6 Feb 2019 16:03:59 +0000 (17:03 +0100)]
lib:util: Add GPL header to tftw.c

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agolib:util: Add missing "replace.h" header in tftw
Andreas Schneider [Wed, 6 Feb 2019 16:03:28 +0000 (17:03 +0100)]
lib:util: Add missing "replace.h" header in tftw

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
5 years agos4 dsdb util: samdb_client_site_name clean up
Gary Lockyer [Wed, 13 Feb 2019 21:53:37 +0000 (10:53 +1300)]
s4 dsdb util: samdb_client_site_name clean up

* Initialise pointers to NULL
* replace talloc_free with TALLOC_FREE
* add goto exit to ensure memory deallocated correctly

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 Feb 14 06:53:14 CET 2019 on sn-devel-144

5 years agos4 dsdb util: remove samdb_search_count
Gary Lockyer [Wed, 13 Feb 2019 20:19:21 +0000 (09:19 +1300)]
s4 dsdb util: remove samdb_search_count

All the uses have been replaced with calls to dsdb_domain_count, so it
is no longer needed.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4 dsdb util: samdb_client_site_name use dsdb_domain_count
Gary Lockyer [Wed, 13 Feb 2019 20:18:20 +0000 (09:18 +1300)]
s4 dsdb util: samdb_client_site_name use dsdb_domain_count

Replace the call to samdb_search_count with dsdb_domain_count. As this
is the only remaining caller of samdb_search_count, replacing it will
allow the removal of samdb_search_count.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4 rpc_server_samr: DomGeneralInformation use dsdb_domain_count
Gary Lockyer [Wed, 13 Feb 2019 20:33:57 +0000 (09:33 +1300)]
s4 rpc_server_samr: DomGeneralInformation use dsdb_domain_count

Use dsdb_domain_count instead of samdb_search_count to determine the
number of users, groups and aliases.  This gives a performance gain of
around 10%, reduces the total memory allocated and fixes the incorrect
count returned for aliases.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4 dsdb util: add dsdb_domain_count
Gary Lockyer [Wed, 13 Feb 2019 01:36:33 +0000 (14:36 +1300)]
s4 dsdb util: add dsdb_domain_count

This counts the number of objects that are in the domain,
provided a domain SID was supplied (otherwise it just
counts all the objects).

This routine avoids allocating memory for the full
result set by using a callback.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos2 decrpc samr: Add tests for QueryDomainInfo
Gary Lockyer [Wed, 13 Feb 2019 01:34:06 +0000 (14:34 +1300)]
s2 decrpc samr: Add tests for QueryDomainInfo

Add tests for the number of domain users, groups and aliases returned by
QueryDomainInfo.

These tests revealed that the existing code was not checking the
returned elements to ensure they were part of the domain.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years ago.gitlab-ci.yml: Make docker image name more explicit
Tim Beale [Wed, 13 Feb 2019 23:26:26 +0000 (12:26 +1300)]
.gitlab-ci.yml: Make docker image name more explicit

The 'image' YAML tag implies a docker image, but for people who find
gitlab mysterious, let's make it blatantly obvious what we're doing
here.

+ added a comment
+ added 'DOCKER' to the variable names
+ removed 'BUILD', as we've now dropped this from all the job-names
+ tried to make the variable names consistent, both within the file and
WRT docker terminology

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 14 03:51:21 CET 2019 on sn-devel-144

5 years ago.gitlab-ci.yml: Include the actual command used by gitlab
Tim Beale [Wed, 13 Feb 2019 22:20:16 +0000 (11:20 +1300)]
.gitlab-ci.yml: Include the actual command used by gitlab

Someone who finds gitlab mysterious will have no idea what $CI_JOB_NAME
should be, if they wanted to reproduce the autobuild job manually. It
should be trivial to include the actual command being run in the logs.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years ago.gitlab-ci.yml: Re-indent comments on test times
Andrew Bartlett [Wed, 13 Feb 2019 20:55:45 +0000 (09:55 +1300)]
.gitlab-ci.yml: Re-indent comments on test times

(some of these need to be updated, but for now improve the formatting)

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
5 years ago.gitlab-ci.yml: Use .extends to avoid duplication of autobuild command
Andrew Bartlett [Wed, 13 Feb 2019 03:43:51 +0000 (16:43 +1300)]
.gitlab-ci.yml: Use .extends to avoid duplication of autobuild command

This should make our .gitlab-ci.yml file much less overwealming.

The downside is that $CI_JOB_NAME is printed rather than the job name
in the log, but the upside is that the names must now strictly match.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
5 years ago.gitlab-ci.yml: Fix the registry as "registry.gitlab.com"
Andrew Bartlett [Wed, 13 Feb 2019 03:14:13 +0000 (16:14 +1300)]
.gitlab-ci.yml: Fix the registry as "registry.gitlab.com"

This is important as our team docker images are only in this registry, but
the .gitlab-ci.yml file is also run on other private GitLab hosts.

This partially undoes 8989916b5af6fed9c4c63035d4488583396b8c5a

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
5 years ago.gitlab-ci.yml: add retries on runner_system_failure/stuck_or_timeout_failure
Stefan Metzmacher [Mon, 11 Feb 2019 11:53:03 +0000 (12:53 +0100)]
.gitlab-ci.yml: add retries on runner_system_failure/stuck_or_timeout_failure

This hopefully avoids pipeline failures due too docker/runner
errors.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years ago.gitlab-ci*.yml: use 'extends: ' instead of YAML Anchors
Stefan Metzmacher [Mon, 11 Feb 2019 12:26:22 +0000 (13:26 +0100)]
.gitlab-ci*.yml: use 'extends: ' instead of YAML Anchors

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years ago.gitlab-ci*.yml: remove build_ prefixes
Stefan Metzmacher [Mon, 11 Feb 2019 11:47:29 +0000 (12:47 +0100)]
.gitlab-ci*.yml: remove build_ prefixes

It's useless to see 'builf_samba_ad...' 7 times in the gitlab pipeline summary.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years ago.gitlab-ci.yml: print out more information in the before_script section
Stefan Metzmacher [Mon, 11 Feb 2019 12:23:58 +0000 (13:23 +0100)]
.gitlab-ci.yml: print out more information in the before_script section

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoscript/autobuild.py: add 'lsb_release -a' and 'mount' to system-info.txt
Stefan Metzmacher [Mon, 11 Feb 2019 12:18:18 +0000 (13:18 +0100)]
script/autobuild.py: add 'lsb_release -a' and 'mount' to system-info.txt

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest:Samba4: wait for DNS names being registered
Stefan Metzmacher [Tue, 29 Jan 2019 12:57:04 +0000 (13:57 +0100)]
selftest:Samba4: wait for DNS names being registered

We can't reliable start tests without registered dns names.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest:Samba4: report when samba is started and ready
Stefan Metzmacher [Wed, 30 Jan 2019 12:44:04 +0000 (13:44 +0100)]
selftest:Samba4: report when samba is started and ready

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba_dnsupdate: make rodc_dns_update() more robust against timing problems
Stefan Metzmacher [Thu, 7 Feb 2019 08:42:36 +0000 (09:42 +0100)]
samba_dnsupdate: make rodc_dns_update() more robust against timing problems

Without this we had an interesting race!

The messaging_dgm code caches connected datagram sockets based on the
destination pid for 1 second.

The fact that samba_dnsupdate constantly recreates its messaging
context (and the underlying datagram socket) means that we the winbindd
messaging context may get a stale connection. As a result sending any
message from winbindd back to samba_dnsupdate will result in
ECONNREFUSED.

That means the IRPC response from winbindd never reaches
samba_dnsupdate, which will then hit a timeout.

In turn samba_dnsupdate on the RODC times out.

This was a workaround for the problem, by having just one global
IRPC handle and thus just one messaging_dgm context.
The actual problem is solved a few commits before
("messages_dgm: Properly handle receiver re-initialization").
But we keep this as an performance optimization, which hopefully
means that the overall samba_dnsupdate is less likely to
timeout after the hardcoded 20 seconds.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agosamba_dnsupdate: make it clear that opts.use_file is active and we're not using nsupdate
Stefan Metzmacher [Thu, 7 Feb 2019 08:40:19 +0000 (09:40 +0100)]
samba_dnsupdate: make it clear that opts.use_file is active and we're not using nsupdate

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agowinbindd_irpc: remove unused winbind_DsrUpdateReadOnlyServerDnsRecords from wb_irpc_f...
Stefan Metzmacher [Thu, 7 Feb 2019 09:07:18 +0000 (10:07 +0100)]
winbindd_irpc: remove unused winbind_DsrUpdateReadOnlyServerDnsRecords from wb_irpc_forward_state

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agos4:setup: register ${NTDSGUID}._msdcs.${DNSFOREST} first in dns_update_list
Stefan Metzmacher [Thu, 31 Jan 2019 07:49:53 +0000 (08:49 +0100)]
s4:setup: register ${NTDSGUID}._msdcs.${DNSFOREST} first in dns_update_list

After the A and AAAA records for the ${HOSTNAME} this is the most
important name.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agomessages_dgm: Properly handle receiver re-initialization
Volker Lendecke [Thu, 7 Feb 2019 15:15:46 +0000 (16:15 +0100)]
messages_dgm: Properly handle receiver re-initialization

This only properly covers the small-message nonblocking case. Covering
the large-message and the blocking case is a much larger effort assuming
we want to re-send the failed message if parts of the message has gone
through properly. Don't do that for now.

This was found by sanba_dnsupdate constantly recreating its irpc handle to
winbindd in the RODC case.

The messaging_dgm code cached connected datagram sockets based on the
destination pid for 1 second. Which means the IRPC responses from
winbindd are never delivered to samba_dnsupdate,
which will then hit a timeout.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agotorture3: Extend read3 for the "messaging target re-inits" failure
Volker Lendecke [Thu, 7 Feb 2019 16:48:34 +0000 (17:48 +0100)]
torture3: Extend read3 for the "messaging target re-inits" failure

Do ping_pong a hundred times, re-initializing the msg_ctx every time.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agomessages_dgm: Use saved errno value
Volker Lendecke [Thu, 7 Feb 2019 14:57:06 +0000 (15:57 +0100)]
messages_dgm: Use saved errno value

In this case this is just a cleanup, the value has just been set by
messaging_dgm_sendmsg. But as that already saves errno into a local
variable, use that.

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agowaf: Check for libnscd
Christof Schmitt [Tue, 12 Feb 2019 19:28:32 +0000 (12:28 -0700)]
waf: Check for libnscd

The check was in the old autoconf, but not in waf. As the code is still
in source3/lib/util_nscd.c, add the check for libnscd to allow building
and using the code.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Feb 13 17:58:33 CET 2019 on sn-devel-144

5 years agoMake sure results from GetAttrString are decref'ed where needed
Noel Power [Mon, 28 Jan 2019 16:57:17 +0000 (16:57 +0000)]
Make sure results from GetAttrString are decref'ed where needed

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett abartlet@samba.org
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed Feb 13 14:51:12 CET 2019 on sn-devel-144

5 years agoFix instances of PyDict_SetItem to decref the value
Noel Power [Mon, 28 Jan 2019 15:23:59 +0000 (15:23 +0000)]
Fix instances of PyDict_SetItem to decref the value

Although it would be better to use the BuildValue approach to
create the dictionares here, unfortunately the dictionaries created
here have key/values that are created dynamically (based on input params).

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett abartlet@samba.org
5 years agoFix mem leak with PyBytes_FromStringAndSize
Noel Power [Mon, 28 Jan 2019 15:23:48 +0000 (15:23 +0000)]
Fix mem leak with PyBytes_FromStringAndSize
Reviewed-by: Andrew Bartlett abartlet@samba.org
5 years agoselftest: Only set clockskew to 5 seconds for MIT Kerberos
Andrew Bartlett [Mon, 11 Feb 2019 20:34:54 +0000 (09:34 +1300)]
selftest: Only set clockskew to 5 seconds for MIT Kerberos

This was added in ac5427c6eba09134411f76a5e6f7e2643fa74eed as part of the MIT KDC
effort, but makes some tests much less reliable under high load.

As the Heimdal build does not need this, only specify for the MIT build.

Tested with an MIT AD DC build with:
 make test TESTS="samba3.raw.session samba3.smb2.session"

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): Wed Feb 13 05:49:43 CET 2019 on sn-devel-144

5 years agowafsamba/samba_utils.py: override symlink to allow force link
Joe Guo [Tue, 12 Feb 2019 06:16:06 +0000 (19:16 +1300)]
wafsamba/samba_utils.py: override symlink to allow force link

if bin is not empty and I have been sharing the samba tree into
a Vagrant environment and we run make, we get annoying linking error like this:

     File "~/samba/lib/tevent/wscript", line 130, in build
        installdir='python')
      File "./buildtools/wafsamba/wafsamba.py", line 745, in SAMBA_SCRIPT
        os.symlink(link_src, link_dst)
    FileExistsError: [Errno 17] File exists: '~/samba/lib/tevent/tevent.py' -> '~/samba/bin/default/../python/tevent.py'
    Makefile:7: recipe for target 'all' failed

Override the symlink method to allow force linking.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Change backup/restore testenvs to use 1 prefork child
Tim Beale [Mon, 4 Feb 2019 23:23:43 +0000 (12:23 +1300)]
selftest: Change backup/restore testenvs to use 1 prefork child

Recently the gitlab CI jobs were hitting memory resource limits and
using swap, which then caused test failures. The process model used in
the testenvs seemed to be contributing to this problem.

We can reduce the memory overhead of the restore/backup testenvs by
using 1 prefork child process instead of the default of 4 (kudos to
Garming for the idea). The tests run against these testenvs are basic
sanity-checks, rather than heavy-duty stress tests, so the number of
prefork workers shouldn't matter.

This is a bit of a tradeoff between testing the defaults that will
actually be used in production vs using limited resources efficiently on
shared CI runner machines.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoselftest: Use default 'prefork children' smb.conf setting
Tim Beale [Mon, 4 Feb 2019 23:18:38 +0000 (12:18 +1300)]
selftest: Use default 'prefork children' smb.conf setting

The default setting should be 4, so there should be no need to specify
this in the testenv smb.conf.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoldb_dn: don't free a known NULL pointer
Douglas Bagnall [Fri, 8 Feb 2019 02:49:56 +0000 (15:49 +1300)]
ldb_dn: don't free a known NULL pointer

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoldb_dn: remove unreachable code in dn_explode
Douglas Bagnall [Thu, 7 Feb 2019 00:39:09 +0000 (13:39 +1300)]
ldb_dn: remove unreachable code in dn_explode

Every time I look at this file, I spend a few minutes wondering how
these bits of code are ever run. Never again.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agoreplmd: move a if (ret) closer to ret source
Douglas Bagnall [Wed, 16 Jan 2019 04:35:48 +0000 (17:35 +1300)]
replmd: move a if (ret) closer to ret source

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodsdb: check NULL guid strings in la_fix_links
Douglas Bagnall [Wed, 9 Jan 2019 23:55:19 +0000 (12:55 +1300)]
dsdb: check NULL guid strings in la_fix_links

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
5 years agodsdb: linked attrs: check a talloc_new()
Douglas Bagnall [Wed, 9 Jan 2019 04:55:38 +0000 (17:55 +1300)]
dsdb: linked attrs: check a talloc_new()

Also we can defer it past a thing that doesn't need or check for it.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>