summaryrefslogtreecommitdiff
path: root/source4
Commit message (Collapse)AuthorAgeFilesLines
* s4:torture/raw: add multilock6 testStefan Metzmacher2019-09-091-0/+263
| | | | | | | | | | | | This is similar to multilock3, but uses a read-only (LOCKING_ANDX_SHARED_LOCK) locks for the 2nd lock request. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit d3bc0199697fd7d6e04479321ca644a227bc4ede)
* s4:torture/raw: add multilock5 testStefan Metzmacher2019-09-091-0/+269
| | | | | | | | | | | | This is similar to multilock3, but uses a read-only (LOCKING_ANDX_SHARED_LOCK) locks for the first lock request. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 6d4296aca0c9a9287c0c78c8f8847a560bd2ea24)
* s4:torture/raw: add multilock4 testStefan Metzmacher2019-09-091-0/+266
| | | | | | | | | | | | This is similar to multilock3, but uses read-only (LOCKING_ANDX_SHARED_LOCK) locks for the blocked requests. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit d3e65ceb1ec25c7b62a7e908506126269011f30d)
* s4:torture/raw: add multilock3 testStefan Metzmacher2019-09-091-0/+266
| | | | | | | | | | | | This demonstrates that unrelated lock ranges are not blocked by other blocked requests on the same fsp. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 297763c6b618c07148d788b46218a0798225bf79)
* s4:torture/raw: improvements for multilock2Stefan Metzmacher2019-09-091-1/+4
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 8a7039be530adcdda9e7e7621bdcf902f5ca1721)
* s4:torture/smb2: add smb2.samba3misc.localposixlock1Stefan Metzmacher2019-09-093-0/+190
| | | | | | | | | | | This demonstrates that the SMB2 code path doesn't do any retry for local posix locks. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 7155d3a2c5d7237f00cccb1802c1341cf295864e)
* s4:torture/raw: assert to get LOCK_NOT_GRANTED in ↵Stefan Metzmacher2019-09-091-3/+3
| | | | | | | | | | | | | torture_samba3_posixtimedlock() There should not be a different if the blocker is a posix process instead of another smbd. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 2a77025a1e16d897281e5840192c93fa03328681)
* downgradedatabase: installing scriptAaron Haslett2019-08-262-2/+3
| | | | | | | | | | | | | | | Installing downgrade script so people don't need the source tree for it. Exception added in usage test because running the script without arguments is valid. (This avoids the need to knownfail it). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> (cherry picked from commit 6dcf00ba0a470ba25aabae06b409ec95404c246f)
* downgradedatabase: rename to samba_downgrade_dbTim Beale2019-08-261-0/+0
| | | | | | | | | | | Just so that it's slightly less of a mouthful for users. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> (cherry picked from commit fdaaee8d3aac77d91642a7d75d4bcd15d4df8657)
* downgradedatabase: comply with samba.tests.sourceAaron Haslett2019-08-261-3/+23
| | | | | | | | | | | | | In next commit we'll install the script, samba.tests.source picked up the lack of a copyright message and some whitespace errors, so this patch fixes that stuff first. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14059 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> (cherry picked from commit c4aebb15001c830a46d5a6ad8ea11a6f9ea4fd04)
* smbtorture: extend rpc.lsa to lookup machine over forest-wide LookupNamesAlexander Bokovoy2019-08-191-1/+7
| | | | | | | | | | | | | | | | | | | Add a simple test to resolve DOMAIN\MACHINE$ via LSA LookupNames3 using LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 level. This level would pass zero lookup flags to lookup_name(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14091 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Wed Aug 14 13:07:42 UTC 2019 on sn-devel-184 (cherry picked from commit 4d276a93fc624dc04d880f5b4157f272d3555be6) Autobuild-User(v4-11-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-11-test): Mon Aug 19 12:36:22 UTC 2019 on sn-devel-184
* torture/rpc/lsa: allow testing different lookup levelsAlexander Bokovoy2019-08-192-53/+67
| | | | | | | | | | | | | Convert torture/rpc/lsa LookupNames/LookupSids code to allow testing different LSA_LOOKUP_NAMES_* levels. Keep existing level 1 (LSA_LOOKUP_NAMES_ALL) for the current set of tests. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14091 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit 317bc6a7342edfa2c503f5932142bf5883485cc9)
* tests/drs_no_dns: Check dbcheck and ldapcmp passGarming Sam2019-08-072-0/+190
| | | | | | | | | | | | | When joining a DC without DNS partitions, make sure that the alternate flow of creating them afterwards results in a database with everything that is necessary. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14051 RN: Allow a DC join without DNS partitions, to add them later Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 35c54007e6183829d9d85a24b3bd95f469739ad3)
* ldap_server: Regression in 0559430ab6e5c48d6e853fda0d8b63f2e149015cGarming Sam2019-08-071-0/+1
| | | | | | | | | | | | | | Extended DN requests seem to have been incorrectly handled. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14029 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Thu Jul 11 05:25:26 UTC 2019 on sn-devel-184 (cherry picked from commit 9f6b87d3f6cc9930d75c1f8d38ad4f5a37da34ab)
* gp_inf: Read/write files with a UTF-16LE BOM in GptTmpl.infGarming Sam2019-08-071-0/+0
| | | | | | | | | | | | | | | | | | | Regression caused by 16596842a62bec0a9d974c48d64000e3c079254e [MS-GPSB] 2.2 Message Syntax says that you have to write a BOM which I didn't do up until this patch. UTF-16 as input encoding was marked much higher up in the inheritance tree, which got overriden with the Python 3 fixes. I've now marked the encoding much more obviously for this file. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14004 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Fri Jul 19 02:20:47 UTC 2019 on sn-devel-184 (cherry picked from commit 0bcfc550b1a902e3a6a766b06603ac9285d0ff63)
* partition: reversing partition unlockingAaron Haslett2019-08-071-53/+72
| | | | | | | | | | | | | Unlock partition databases in the reverse order from which they were acquired. This is separated from the previous commit for future bisecting purposes, since the last commit was made to fix specific CI failures, while this one is a speculative fix made based on code inspection. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 6c691bf84e41b1edd3228c219f7a94e108795d28)
* partition: correcting lock orderingAaron Haslett2019-08-071-51/+84
| | | | | | | | | | | | | | A schema reading bug was traced to a lock ordering issue in partition.c. This patch fixes the problem by: 1. Releasing locks/transactions in the order they were acquired. 2. Always lock/start_trans on metadata.tdb first, before any other databases, and release it last, after all others. This is so that we are never exposed to MDB's lock semantics, which we don't support. Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 7f4bc0ea81f2b34607849911f1271b030be8ca02)
* dsdb repl_meta_data: Don't print ldif on errorGary Lockyer2019-07-091-5/+4
| | | | | | | | | | | | Don't call ldb_ldif_message_redacted_string when linked_attr_modify fails. When joining a large domain this takes way to much time, in excess of 3 hours for a join on a 200k domain. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Tim Beale <timbeale@catalyst.net.nz> Autobuild-User(master): Gary Lockyer <gary@samba.org> Autobuild-Date(master): Tue Jul 9 03:03:25 UTC 2019 on sn-devel-184
* s4/dsdb/schema: clang: Fix Array access results in null pointer derefNoel Power2019-07-081-1/+3
| | | | | | | | | | | Fixes: source4/dsdb/schema/schema_query.c:223:15: warning: Array access (from variable 'attr_list') results in a null pointer dereference <--[clang] attr_list[i] = NULL; ~~~~~~~~~ ^ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s4/dsdb/schema: Fix 'Value stored to 'ret' is never read'Noel Power2019-07-081-2/+0
| | | | | | | | | | | | | | Fixes: source4/dsdb/schema/schema_set.c:274:3: warning: Value stored to 'ret' is never read <--[clang] ret = LDB_SUCCESS; ^ ~~~~~~~~~~~ source4/dsdb/schema/schema_set.c:327:3: warning: Value stored to 'ret' is never read <--[clang] ret = LDB_SUCCESS; ^ ~~~~~~~~~~~ Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s4/dsdb/schema: Fix Access to field results in deference of null pointerNoel Power2019-07-081-0/+9
| | | | | | | | | | | | Fixes: source4/dsdb/schema/schema_info_attr.c:207:38: warning: Access to field 'revision' results in a dereference of a null pointer (loaded from variable 'schema_info') <--[clang] if (schema->schema_info->revision > schema_info->revision) { ^~~~~~~~~~~ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* torture: fix durable open/alloc-size testBjörn Jacke2019-07-071-1/+1
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* smbtorture: Add smb2.ioctl.zero_dataChristof Schmitt2019-07-052-0/+63
| | | | | | | | Allow to manually issue the FSCTL_ZERO_DATA call and verify the state of the file in the file system. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* smbtorture: Add smb2.ioctl.sparse_set_sparseChristof Schmitt2019-07-052-0/+51
| | | | | | | | This allows for manual testing of changing the sparse setting on a file and verifying the flag in the file system. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4 heimdal_build: Fix static heimdal builds with replacement closefrom()Karl Lenz2019-07-052-61/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If Samba was configured with "--nonshared-binary=winexe" to build winexe as a static binary, and the replacement closefrom() function was used (which is default on most GNU/Linux systems without the libbsd development package installed), then winexe would fail to link with the error message shown below. [2631/3059] Linking bin/default/examples/winexe/winexe source4/heimdal/lib/roken/closefrom.c.1.o: In function `rep_closefrom': closefrom.c:(.text+0x0): multiple definition of `rep_closefrom' lib/replace/closefrom.c.2.o:closefrom.c:(.text+0x292): first defined here collect2: error: ld returned 1 exit status The real problem here was not with the winexe build itself - that was merely the application that I was attempting to build statically when I encountered it. As Andrew Bartlett very helpfully pointed out to me, this regression was introduced when "lib/replace/closefrom.c" was added in commit 55529d0f and, more to the point, when the heimdal build started using it in commit 3a7ebd0e. From that point on, any time that Samba's embedded copy of heimdal was statically linked into an application, it would fail to link because heimdal's own rep_closefrom() function in its "roken" library would conflict with the rep_closefrom() function in the "replace" library used elsewhere in Samba - a library which the "roken" library itself depends on. To further compound the problem, heimdal's own "roken" library is also compiled for the host (a necessary distinction for cross-compiled builds) and linked into a small number of utility applications used during the heimdal build. However, they can't link directly against the "replace" library, unlike the main "roken" library build which carries that dependency, because the "replace" library is _not_ built for the host. I solved this problem by eliminating heimdal's version of rep_closefrom() and making it use the one from "lib/replace" everywhere. That wasn't a problem for the main heimdal library that is built for the target because it was already linking in "lib/replace" (that's what caused this problem in the first place!), but to solve the aforementioned issue with "lib/replace" not being built for the host, I added "lib/replace/closefrom.c" to the list of "source4/heimdal/lib/roken" sources to be built for the host to satisfy heimdal's host utilities. Everyone wins, I think. Signed-off-by: Karl Lenz <xorangekiller@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s4/scripting/smbstatus: begoneDouglas Bagnall2019-07-051-92/+0
| | | | | | | Untested and unused. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/torture: remove autoidlDouglas Bagnall2019-07-053-314/+0
| | | | | | | | | This has been turned off by default for 10 years (since 26e114b83ce1de7515bfbf365), and is only interesting for nostalgia purposes. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/scripting/autoidl: remove itDouglas Bagnall2019-07-051-164/+0
| | | | | | | | | | | | | What does it even do? Possibly nothing, not least because nobody ever runs it. It was introduced as source4/scripting/bin/autoidl.py in a2446e5f8550582c0d4353bb85874dea17cf1d98 ("initial work for script that uses probing to figure out IDL"). Since then it has only had superficial patches, generally aimed at Python 3. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/scripting/samba_dnsupdate: print usage with no argumentsDouglas Bagnall2019-07-051-4/+16
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/scripting/demodirsync: print usage if no host namedDouglas Bagnall2019-07-051-0/+3
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/scripting/mymachinepw: print usage with bad argumentsDouglas Bagnall2019-07-051-3/+6
| | | | | | | | Also, use sys.exit() function, not exit(), because sys.exit() reliably exists. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/scripting/get-descriptors: print usage with insufficient argumentsDouglas Bagnall2019-07-051-0/+4
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests: ensure that most python scripts have usage textDouglas Bagnall2019-07-051-0/+2
| | | | | | | | | | | | | | | | | | | | | When a script is run with the wrong arguments, it should at least say something like this: Usage: samba-foo [OPTIONS] For many samba scripts, especially without a server environment, having no arguments is the wrong arguments. Here we look for every executable file with '#![...]python[3]' on the first line, and exclude certain files and directories that have excuses to fail the test. For example, many selftest scripts are stream-oriented and will hang forever waiting for stdin, which is not an error. Some test modules are designed so they can be optionally run from the command line, but this option is typically only used by the developer who is writing them. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/libnet: Fix joining a Windows pre-2008R2 DCTim Beale2019-07-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From v4.8 onwards, Samba may not be able join a DC older than 2008R2 because the Windows DC doesn't support GET_TGT. If the dsdb repl_md code can't resolve a link target it returns an error, and the calling code (e.g. drs_util.py) should retry with GET_TGT. However, GET_TGT is only supported on Windows 2008R2 and later, so if you try to join an earlier Windows DC, the join will throw an error that you can't work-around. We can avoid this problem by setting the same DSDB flag that GET_TGT sets to indicate that the link targets are as up-to-date as possible, and so there's no point retrying. Missing targets are still logged, so this at least allows the admin to fix up any problems after the join completed. I've only done this for the join case (problems during periodic replication are probably still worth escalating to an error). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14021 RN: From Samba v4.8 onwards, joining a Windows 2003 or 2008 (non-R2) AD DC may not have worked. When this problem occurred, the following message would be displayed: 'Failed to commit objects: DOS code 0x000021bf' This particular issue has now been resolved. Note that there may still be other potential problems that occur when joining an older Windows DC. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4 samdb: pass ldb options to ldb_module_connect_backendGary Lockyer2019-07-041-1/+4
| | | | | | | | | Pass the ldb options into ldb_module_connect_backend, to ensure ldb options such as "batch mode" and "transaction index cache size" get passed through to the backend modules. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba-tool tests: add tests for contact managementBjörn Baumbach2019-07-041-1/+2
| | | | | Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba-tool tests: add test for 'samba-tool group edit' commandBjörn Baumbach2019-07-041-1/+2
| | | | | Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba-tool tests: add test for 'samba-tool computer edit' commandBjörn Baumbach2019-07-041-1/+2
| | | | | Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba-tool tests: rename "user edit" test from edit.sh to user_edit.shBjörn Baumbach2019-07-041-1/+1
| | | | | Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: check for PrimaryGroupId in DC returned group arrayIsaac Boukris2019-07-031-1/+48
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11362 Signed-off-by: Isaac Boukris <iboukris@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* selftest: remote_pac: s/s2u4self/s4u2self/gIsaac Boukris2019-07-031-32/+33
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11362 Signed-off-by: Isaac Boukris <iboukris@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* kcc: default to logging to DBGLVL_WARNINGGary Lockyer2019-07-021-1/+4
| | | | | | | | | | | | | | | | | If the "-d" debug level parameter is not supplied, default to DBGLVL_WARNING. Overiding the "log level" set in smb.conf. When samba runs the kcc command stderr output is logged at DBGLVL_ERR, the default log destination is stderr. As a result any log messages generated by the kcc command, are effectively logged at DBGLVL_ERR. This causes issues if auth or audit logging are enabled in smb.conf. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-with: Tim Beale <timbeale@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Jul 2 05:49:43 UTC 2019 on sn-devel-184
* s4/scripting/smbstatus: approach py3 compatibilityDouglas Bagnall2019-07-021-2/+2
| | | | | | | It is still unused and untested, probably not working. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/tests/dsdb_schema: not usefully executable as scriptDouglas Bagnall2019-07-021-1/+0
| | | | | | | You could run the script, but it wouldn't do anything. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/script/rodcdns: str type doesn't need decodingDouglas Bagnall2019-07-021-1/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/scripting/autoidl: another py3 incompatible exceptDouglas Bagnall2019-07-021-1/+2
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* repl_md: Avoid dropping cross-partition linksTim Beale2019-07-021-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Cross-partition links could still be dropped if GET_TGT was already previously set for the replication. This was due to a slight error in the order of logic. We never want to ignore cross-partition links (regardless of whether the TARGETS_UPTODATE /GET_TGT flag is set). We should only be returning early in the GET_TGT case if the objects are both in the same partition. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14022 RN: When the AD domain contained a linked attribute that spanned partitions, DRS replication could drop the link. This dropped link could then result in subtle differences in behaviour between DCs, as some DCs would have the link and others wouldn't. When this issue occurred, the dropped link would be logged in a warning message: "<target-dn> is Unknown but up to date. Ignoring link from <source-dn>" This issue would not always occur - it depended a lot on the database contents. Typically, it would only potentially occur when joining a new DC to the domain (doing an ldapcmp after the join would also highlight the problem, if it occurred). This issue has now been resolved. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests: Add getncchanges test for cross-partition links + TGTTim Beale2019-07-021-1/+27
| | | | | | | | | | | | | | | | | | | This adds a test-case to highlight a bug in the client side GetNCChanges handling. These tests mostly exercise the server-side behaviour of sending the GetNCChanges, however, there's a bug in the client-side code when we try to handle a missing cross-partition link target *in combination* with the GET_TGT flag already having been set. The test is exercising the client-side code by using the 'samba-tool drs replicate' command. By adding a one-way link to a deleted target object, we force the client code to retry with the GET_TGT flag set. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14022 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba-tool dcpromo tests: add --backend-store-size optionGary Lockyer2019-07-021-0/+2
| | | | | | | | | Add a new "samba-tool domain dcpromo" option "backend-store-size". This allows the lmdb map size to be set during a promotion, instead of hard-wiring it to 8Gb. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* clone-dc-database tests: Add --backend-store-size optionGary Lockyer2019-07-021-0/+2
| | | | | | | | | Add a new "samba-tool drs clone-dc-database" option "backend-store-size". This allows the lmdb map size to be set during a clone, instead of hard-wiring it to 8Gb. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>' Reviewed-by: Andrew Bartlett <abartlet@samba.org>