summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* blackbox/dbcheck-links.sh: reproduce lost deleted object problemStefan Metzmacher2019-03-143-0/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | When a parent object is removed during the tombstone garbage collection before a child object and samba-tool dbcheck runs at the same time, the following can happen: - If the object child had DISALLOW_MOVE_ON_DELETE in systemFlags, samba-tool dbcheck moves the object under the LostAndFound[Config] object (as an originating update!) - The lastKnownParent attribute is removed (as an originating update!) These originating updates cause the object to have an extended time as tombstone. And these changes are replicated to other DCs, which very likely already removed the object completely! This means the destination DC of replication has no chance to handle the object it gets from the source DC with just 2 attributes (name, lastKnownParent). The destination logs something like: No objectClass found in replPropertyMetaData BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* blackbox/*.sh: pass -u to 'diff'Stefan Metzmacher2019-03-143-28/+28
| | | | | | | | | This is what we work with every day... BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Remove unnecessary dns_hub hashmap entriesTim Beale2019-03-141-4/+1
| | | | | | | | These are only used within the function, and there's already a local variable that stores the same info. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Use consistent env variables for dns_hubTim Beale2019-03-141-6/+6
| | | | | | | | | | | | | | | | Setting up a testenv involves populating 2 different hashmaps - an intermediary one (usually called 'ctx') and one that is used to populate the testenv environment variables (usually called 'env_vars' or 'dcvars'). Because the dns_hub setup is very simple, it doesn't need two different hashmaps. However, the variable names are still a mix of the two hashmaps. This patch updates dns_hub to use the second, more finalized hashmap variable-names. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Use new helper function for client's smb.conf IPTim Beale2019-03-141-1/+1
| | | | | | | | | This has the side-effect of giving the client an IPv6 address, which it hasn't had up until now. But it at least makes the client and server interfaces settings consistent, and gets rid of a hard-coded IP address. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests: Make IPv4 assumption explicitTim Beale2019-03-142-4/+5
| | | | | | | | | | | | | | This test is asserting the expected number of *IPv4* addresses, not any interface address (including IPv6). It works currently because the selftest client doesn't have an IPv6 address in its smb.conf. This patch makes the IPv4 assumption explicit by importing interface_ips_v4() from the provision code. We need to tweak this to pass through an 'all_interfaces' flag, otherwise it filters out the loopback IP addresses that the testenv is using. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add helper function to get interfaces configTim Beale2019-03-143-3/+18
| | | | | | | | | | | | Add a helper function to return the IPv4/IPv6 addresses for the smb.conf. This keeps the netmask assumptions in the same places as the IP subnet assumptions. This refactor means we no longer need to store $ctx->{interfaces}, as it was only used in one place. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Remove secondary client interfacesTim Beale2019-03-142-7/+5
| | | | | | | | | | | | | I can't see anything in the tests that ever tries to use these other IP addresses. While it makes sense that we might want the tests to simulate multiple different clients (with different IPs), we don't appear to do this currently. Removing the spare client addresses minimizes the number of hard-coded IP addresses in selftest. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/scripting: remove obsolete w32err_code.pyDouglas Bagnall2019-03-141-363/+0
| | | | | | | | This has been replaced by gen_werror.py which shares common code with other scripts (e.g. gen_ntstatus) and is more likely to work with conteporary microsoft HTML. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* testsuite: Remove build_farm testsuitesTim Beale2019-03-1264-666/+1
| | | | | | | | | | | | This test code is not run (and has not been run for about a decade). Let's remove it - it's there in the git history if we ever want to try to repurpose it again. 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): Tue Mar 12 02:56:05 UTC 2019 on sn-devel-144
* selftest: Remove RUN_FROM_BUILD_FARM env variableTim Beale2019-03-121-4/+1
| | | | | | | | The build farm is no longer used, so we can remove checks for this environment variable in the selftest code. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/scripting: Remove legacy selftest-vars.sh scriptTim Beale2019-03-121-36/+0
| | | | | | | | | | | | | | This script was added in 2010 and has only been sporadically kept up-to-date since. It doesn't appear to work (I think that selftest and the testenvs have perhaps grown in complexity since 2010 and it's no longer possible to try to access a testenv from a different process-space, due to how we use the cwrap libraries). There's now an alternative (export_envvars_to_file()) in the selftest code to regenerate a similar file, if anyone actually needs it. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Add helper function to create exports file for a testenvTim Beale2019-03-121-0/+10
| | | | | | | | | | | | This writes out the environment variables that are normally setup in the testenv xterm to a file. This allows them to be sourced later. This function is currently unused. However, it provides an alternative replacement for the selftest-vars.sh script (which is really out of date). I do plan to make use of this function in a subsequent patch-set. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Move @exported_envvars into Samba.pmTim Beale2019-03-122-98/+111
| | | | | | | | This brings it closer to the code that actually sets these variables (i.e. Samba3/4.pm). Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Remove unused SELFTEST_INTERFACESTim Beale2019-03-122-6/+0
| | | | | | | This doesn't appear to be used anywhere and dates back to 2008. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba-tool domain provision: Fix --interactive module in python3Andrew Bartlett2019-03-121-0/+1
| | | | | | | | | | | | | The prompts were not being printed to the screen because the stream was not being flushed. As reported on the samba mailing list by Adam Xu: https://lists.samba.org/archive/samba/2019-March/221753.html BUG: https://bugzilla.samba.org/show_bug.cgi?id=13828 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Tim Beale <timbeale@catalyst.net.nz>
* gpo: Backup a policy folder containing GPE.INIGarming Sam2019-03-121-0/+6
| | | | | | | | | | | | | | | | | | The GPE.INI file does not appear to be documented anywhere in the protocol specifications and seems to be due to legacy code. It appears that it used to be how the gPCUserExtensionNames and gPCMachineExtensionNames were maintained without the requirement for LDAP. All we do is ignore the parsing of this file and copy it over as binary. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13825 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Mar 12 01:41:32 UTC 2019 on sn-devel-144
* gpo: During restore clobber GPT.INI with a blank versionGarming Sam2019-03-122-12/+32
| | | | | | | | | | | | | Generally speaking, there is not much value to keeping this file. The display name does not ever seem to be used and the version only applies to the original domain or DC it was on. The command line option to revert this behaviour is mostly for the tests or for having a straight 1:1 backup-restore for pure restoration. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13806 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* gpo: Parse GPT.INI with Latin-1Garming Sam2019-03-121-0/+11
| | | | | | | | | For some reason the French version of RSAT turns accents into ISO-8859-1. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13806 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* gpo: Add test for saving gPCXXXExtensionNames in backupGarming Sam2019-03-121-0/+69
| | | | | | | | | | | | The test only checks that the LDAP values are equal before and after. The format and specifics should be up to the implementation -- and be amenable to changes later. As long as the extension doesn't match .SAMBABACKUP or .xml, it won't be detected by the tools. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13627 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* gpo: Restore gPCMachineExtensionNames and gPCUserExtensionNamesGarming Sam2019-03-121-1/+25
| | | | | | | | | | | | After creating a backup and calling 'gpo restore', this makes it so that restoring a GPO will instantly enable it for use. There might be some cases where we might not want to do this, but for now just do it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13627 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* py3: io.open takes a numeric buffering argument at index 2Garming Sam2019-03-121-1/+1
| | | | | | | It's unsure why this doesn't fail generically, but it fails on my machine sometimes... Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* gpo: Add tests to make sure that an empty gplink worksGarming Sam2019-03-121-0/+34
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13564 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* gpo: Ensure that gplink works when emptyGarming Sam2019-03-121-1/+5
| | | | | | | | | It appears that RSAT can leave a space in the gPLink field, which we need to handle. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13564 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* modules: Add dependency on tirpc to vfs_nfs4acl_xattrAndrew Bartlett2019-03-121-8/+11
| | | | | | | | | | | This is done as a new subsystem (either filled or empty) rather than via string manipulation. This will fix compile error on fedora. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* libsmb: Use sid_parse()Volker Lendecke2019-03-121-16/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib: Remove "struct sid_parse_ret" againVolker Lendecke2019-03-129-32/+29
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib: Make sid_parse return the parsed lengthVolker Lendecke2019-03-129-32/+54
| | | | | | | | | Use a temporary struct as a return value to make the compiler catch all callers. If we just changed bool->ssize_t, this would just generate a warning. struct sid_parse_ret will go away in the next commit Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Avoid NULL pointer dereference in SMBsendend handlerMichael Hanselmann2019-03-121-0/+6
| | | | | | | | | | The "reply_sendend" function wouldn't check whether the connection had any pending message state. A client sending an out-of-order SMBsendend message would trigger a NULL pointer dereference. Reviewed-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/scripting/autoidl: p3 exception syntaxDouglas Bagnall2019-03-121-1/+2
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* test/blackbox: py3 compatible print in documentation.Douglas Bagnall2019-03-121-1/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/scripting: MORE py3 compatible print functionsDouglas Bagnall2019-03-129-62/+71
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest/filter-subunit: use py3 printDouglas Bagnall2019-03-121-3/+3
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest/format-subunit-json: remove useless py2 printDouglas Bagnall2019-03-121-1/+0
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pidl/s4/python: call export "export" in py exceptionsDouglas Bagnall2019-03-121-1/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libsmb: Use tevent_req_simple_finish_ntstatusVolker Lendecke2019-03-081-5/+1
| | | | | | | | 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): Fri Mar 8 19:16:18 UTC 2019 on sn-devel-144
* libsmb: Add "in_cblobs" to cli_smb2_unlinkVolker Lendecke2019-03-083-8/+18
| | | | | | | | | This reveals the fact that unlink is an open/close in smb2 through the API. This is not nice, but it's an internal API with currently only one user. And it enables posix semantics for the open easily. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Add "in_cblobs" to cli_smb2_rmdirVolker Lendecke2019-03-083-14/+26
| | | | | | | | | This reveals the fact that rmdir is an open/close in smb2 through the API. This is not nice, but it's an internal API with currently only one user. And it enables posix semantics for the open easily. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make cli_smb2_unlink asyncVolker Lendecke2019-03-082-35/+154
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Simplify cli_smb2_mxacVolker Lendecke2019-03-081-12/+5
| | | | | | | smb2_create_blob_find() can search for a create blob for us Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib:util: Move debug message for mkdir failing to log level 1Andreas Schneider2019-03-081-3/+3
| | | | | | | | | | | | If you connnect to a host with smbclient this gets always printed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13823 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Mar 8 01:41:27 UTC 2019 on sn-devel-144
* samba-o3: fix -Werror=maybe-uninitialized in lib/mscat/mscat_pks7.cJoe Guo2019-03-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | samba-o3 test failed in ubuntu:1804 image with: ../../lib/mscat/mscat_pkcs7.c: In function ‘mscat_pkcs7_import_catfile’: ../../lib/mscat/mscat_pkcs7.c:143:18: error: ‘blob.length’ may be used uninitialized in this function [-Werror=maybe-uninitialized] mscat_data.size = blob.length; ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ ../../lib/mscat/mscat_pkcs7.c:142:18: error: ‘blob.data’ may be used uninitialized in this function [-Werror=maybe-uninitialized] mscat_data.data = blob.data; ~~~~~~~~~~~~~~~~^~~~~~~~~~~ ../../lib/mscat/mscat_pkcs7.c: In function ‘mscat_pkcs7_verify’: ../../lib/mscat/mscat_pkcs7.c:225:16: error: ‘blob.length’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ca_data.size = blob.length; ~~~~~~~~~~~~~^~~~~~~~~~~~~ ../../lib/mscat/mscat_pkcs7.c:224:16: error: ‘blob.data’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ca_data.data = blob.data; ~~~~~~~~~~~~~^~~~~~~~~~~ cc1: all warnings being treated as errors Since in `mscat_read_file`, it may still return rc = 0 while goto error, ends up with blob uninitialized. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba-o3: fix -Werror=strict-overflow error in s4/torture/raw/eas moduleJoe Guo2019-03-081-2/+3
| | | | | | | | | | | | | | | | | samba-o3 test failed in ubuntu:16.04 docker container: ==> /home/samba/samba/samba-o3.stderr <== ../../source4/torture/raw/eas.c: In function ‘test_max_eas’: ../../source4/torture/raw/eas.c:286:12: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] static bool test_max_eas(struct smbcli_state *cli, struct torture_context *tctx) ^ cc1: all warnings being treated as errors `total += j` may overflow. Change total type to `size_t` to mute error. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* samba-o3: fix -Werror=strict-overflow error in lib/ldb-samba/ldb_ildap moduleJoe Guo2019-03-081-4/+4
| | | | | | | | | | | | | | | | | | | | samba-o3 test failed in ubuntu:16.04 docker container: ==> /home/samba/samba/samba-o3.stderr <== ../../lib/ldb-samba/ldb_ildap.c: In function ‘ildb_handle_request’: ../../lib/ldb-samba/ldb_ildap.c:535:2: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] for (i = 0; i < n; i++) { ^ ../../lib/ldb-samba/ldb_ildap.c:579:2: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] for (i = 0; i < n; i++) { ^ cc1: all warnings being treated as errors Change type to mute errors. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* pygpo: take ownership of password pointerKristján Valur2019-03-071-3/+3
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson <kristjan@rvx.is> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Thu Mar 7 15:08:19 UTC 2019 on sn-devel-144
* pygpo: Safer handling of memory for ads_ptr.Kristján Valur2019-03-071-27/+37
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson <kristjan@rvx.is> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* pygpo: Fix module initialization.Kristján Valur2019-03-071-16/+19
| | | | | | | | | | | | | * Add reference count to type. * Add error checking. * Remove unnecessary tp_new method. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson <kristjan@rvx.is> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* pygpo: keep a reference to python credentials in the ADS struct to keep the ↵Kristján Valur2019-03-071-5/+8
| | | | | | | | | internal pointer valid. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson <kristjan@rvx.is> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* pygpo: More python exception cleanup.Kristján Valur2019-03-071-52/+51
| | | | | | | | | | | | | | | * Don't override existing exceptions. * Careful with talloc contexts. * Return NULL on error. * Add more information to exception messages from internal functions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson <kristjan@rvx.is> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* pygpo: Fix error handing when getting gpo unix path.Kristján Valur2019-03-071-6/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13822 Signed-off-by: Kristján Valur Jónsson <kristjan@rvx.is> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <npower@samba.org>