summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos and ban the rams from sambatdb-1.3.17Swen Schillig2019-01-108-10/+10
| | | | | | Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
* selftest: Remove duplicate dependency definitionVolker Lendecke2019-01-101-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dsdb: Print strerror in addition to errnoVolker Lendecke2019-01-101-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dns: Do NULL checks in dns_sign_tsigVolker Lendecke2019-01-101-0/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: cli_smb2_list() can sometimes fail initially on a connectionTim Beale2019-01-101-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cli_smb2_list() appears to be a slightly unique SMB operation in that it specifies the max transaction size for the response buffer size. The Python bindings highlighted a problem where if cli_smb2_list() were one of the first operations performed on the SMBv2 connection, it would fail due to insufficient credits. Because the response buffer size is (potentially) so much larger, it requires more credits (128) compared with other SMB operations. When talking to a samba DC, the connection credits seem to start off at 1, then increase by 32 for every SMB reply we receive back from the server. After cli_full_connection(), the connection has 65 credits. The cli_smb2_create_fnum() in cli_smb2_list() adds another 32 credits, but this is still less than the 128 that smb2cli_query_directory() requires. This problem doesn't happen for smbclient because the cli_cm_open() API it uses ends up sending more messages, and so the connection has more credits. This patch changes cli_smb2_list(), so it requests a smaller response buffer size if it doesn't have enough credits available for the max transaction size. smb2cli_query_directory() is already in a loop, so it can span multiple SMB messages if for some reason the transaction size isn't big enough for the listings. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13736 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Jan 10 02:40:16 CET 2019 on sn-devel-144
* libcli: Add error log if insufficient SMB2 creditsTim Beale2019-01-091-0/+3
| | | | | | | | | | | | Although it's unusual to hit this case, I was seeing it happen while working on the SMB python bindings. Even with debug level 10, there was nothing coming out to help pin down the source of the NT_STATUS_INTERNAL_ERROR. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13736 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:utils:net: Print debug message about NetbiosJustin Stephenson2019-01-092-2/+10
| | | | | | | | | | | | | | | | | With a preceding patch, cli_connect_nb() will return NT_STATUS_NOT_SUPPORTED when 'disable netbios' is set in smb.conf. Print an informative error message to indicate Netbios is disabled if this occurs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13727 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Noel Power <nopower@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Wed Jan 9 22:38:21 CET 2019 on sn-devel-144
* s3:smbpasswd: Print debug message about NetbiosJustin Stephenson2019-01-091-4/+12
| | | | | | | | | | | | | | With a preceding patch, cli_connect_nb() will return NT_STATUS_NOT_SUPPORTED when 'disable netbios' is set in smb.conf. Print an informative error message to indicate Netbios is disabled if this occurs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13727 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Noel Power <nopower@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: Print debug message about NetbiosJustin Stephenson2019-01-092-0/+8
| | | | | | | | | | | | | | With a preceding patch, cli_connect_nb() will return NT_STATUS_NOT_SUPPORTED when 'disable netbios' is set in smb.conf. Print an informative error message to indicate Netbios is disabled if this occurs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13727 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Noel Power <nopower@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: Check disable_netbios in socket connectJustin Stephenson2019-01-091-0/+5
| | | | | | | | | If the disable_netbios option is set then return NT_STATUS_NOT_SUPPORTED for a port 139 connection in the low level socket connection code. Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Noel Power <nopower@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:libsmb: Revert SMB Py bindings name back to libsmb_samba_internalTim Beale2019-01-096-10/+13
| | | | | | | | | | | | | | | | | | In order to make it clear that the APIs in these Python bindings are unstable and should not be used by external consumers, this patch changes the name of the Python bindings back to libsmb_samba_internal. To make the Python code that uses these bindings (i.e. samba-tool, etc) look a little cleaner, we can just change the module name as we import it, e.g. from samba.samba3 import libsmb_samba_internal as libsmb Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Jan 9 14:30:31 CET 2019 on sn-devel-144
* netcmd/user: python[3]-gpgme unsupported and replaced by python[3]-gpgJoe Guo2019-01-091-25/+61
| | | | | | | | | | | | python[3]-gpgme is deprecated since ubuntu 1804 and debian 9. use python[3]-gpg instead, and adapt the API. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13728 Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* xml_docs: update traffic script documentationDouglas Bagnall2019-01-092-22/+64
| | | | | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Tim Beale <timbeale@samba.org> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Wed Jan 9 03:53:58 CET 2019 on sn-devel-144
* traffic_replay: use packets per second as primary scaleDouglas Bagnall2019-01-082-9/+30
| | | | | | | | The old -S/--scale-traffic is relative to the original model, which made its relationship to true traffic volumes quite opaque Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: assert json equality in learner testDouglas Bagnall2019-01-081-0/+6
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic tests: use TestCaseInTempdir.mktemp()Douglas Bagnall2019-01-083-45/+6
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/tests: add TestCaseInTempdir.mktemp()Douglas Bagnall2019-01-081-1/+16
| | | | | | | | | | | | | | | | | This gives you a name of a temporary file within the test case's tempdir. Use it like this: with self.mktemp() as filename: self.check_run("samba-tool foo --output %s" % filename) self.assertStringsEqual(open(filename).read(), expected) and filename will flick out of existence when the with block ends. This is based on an idea used in the traffic_runner tests, which will soon be adapted to use this method. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic_replay: --old-scale to mimic the old traffic_replayDouglas Bagnall2019-01-083-0/+24
| | | | | | | | | traffic_replay had a broken sense of traffic scale. That is fixed, but in order to compare old and new tests, it helps to be able to approximate the old behaviour. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: add option to reanimate dying conversationsDouglas Bagnall2019-01-085-7/+45
| | | | | | | | | | | | | | | The traffic model is generated from a window in time, which makes conversations appear to start and stop unnaturally at the window boundaries. When the window is short compared to the traffic replay time and the true expected conversation length, this has a significant distorting effect, leading to more conversations than would be expected to generate a given number of packets. To offset this slightly we add the --conversation-persistence option which tries to convert apparent death into a longish wait. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic_model: don't report generation errors as parse errorsDouglas Bagnall2019-01-081-16/+10
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: improve debug messages in traffic_replayDouglas Bagnall2019-01-081-7/+6
| | | | | | | tracebacks and less nonsense at higher debug levels. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: Conversation.add_short_packet is discerning about packetsDouglas Bagnall2019-01-081-1/+4
| | | | | | | If the packets really wouldn't do anything, we might as well not add them. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: remove useless branch in stats reportDouglas Bagnall2019-01-081-25/+12
| | | | | | | | | This completes the work of 68c64c634ad7576b2ab5ef838c203320afd90f44, but differs from that in that it makes no actual change because isatty was not being called so was always evaluated as true. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: generate more statistics in replayDouglas Bagnall2019-01-081-30/+69
| | | | | | | | | | | | | | | | | | | | | Add more "header" values indicating the progress of the run as a whole. The new fields are: Max sleep miss - the longest sleep() oversleep. Indicates client load. Maximum lag - the longest gap between a planned packet time and its actual time. Start lag - the longest gap between intended and actual conversation start. Planned conversations - how many conversations we meant to have. Planned packets - how many "packets" we thought we were making. Not all "packets" result in actual operations or packets. Unfinished conversations - how many conversations had not finished when they were killed. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: avoid bare except: clausesDouglas Bagnall2019-01-081-2/+2
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: simplify tests for badpassword_frequencyDouglas Bagnall2019-01-081-3/+4
| | | | | | | x <= 0 will fail one or both of the other test clauses. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: assign context domain at startDouglas Bagnall2019-01-081-7/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: traffic_replay --latency-timeout to control final waitDouglas Bagnall2019-01-082-1/+5
| | | | | | | | | Conversations that haven't finished within some acceptable margin of on-time can be said to have failed. This is where you specify that margin. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic_replay: --stop-on-any-error option to not ignore client troubleDouglas Bagnall2019-01-082-1/+7
| | | | | | | | Sometimes you want to know if any client is crashing for any reason. In those times use --stop-on-any-error for an early exit. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: evoke OS error codes by name, not numberDouglas Bagnall2019-01-081-2/+3
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: reinitialise RNG in each childDouglas Bagnall2019-01-081-2/+8
| | | | | | | Otherwise they all replay using the same random sequence. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: avoid generating conversations without packetsDouglas Bagnall2019-01-081-0/+28
| | | | | | | | | | | | Some "packets" don't generate any actual traffic. If we have a conversation consisting only of those, we can avoid forking a client for it. This *slightly* increases the load over that which would be generated otherwise for a given traffic rate, but that's OK. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: rework conversation generation to better use memoryDouglas Bagnall2019-01-082-150/+174
| | | | | | | | Use less memory altogether and don't allocated shared mutable before the fork. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: generate sparser descriptions of conversationsDouglas Bagnall2019-01-083-15/+10
| | | | | | | | | | | | | Rather than building all the packets at this point, we stick to the barest details of the packets (which is all the model gives us anyway). The advantage is that will take a lot less memory, which matters because this process forks into many clients that were sharing and mutate the conversation list. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: new version of model with packet_rate, version numberDouglas Bagnall2019-01-0810-95/+205
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: fix hash non-determinism when loading JSONDouglas Bagnall2019-01-081-0/+2
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Tim Beale <timbeale@samba.org>
* traffic: Conversation gets given id, list of short packetsDouglas Bagnall2019-01-081-8/+8
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: rename packet_rate -> replay_speed for accuracy and roomDouglas Bagnall2019-01-081-5/+6
| | | | | | | | We are soon going to have a self.packet_rate, and replay_speed is more accurate in this case. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: initialise conversation specific lists after the forkDouglas Bagnall2019-01-081-12/+12
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: split is_a_real_packet() function out of classDouglas Bagnall2019-01-081-17/+21
| | | | | | | | So we can use it to determine whether a packet should be a Packet before making the leap. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: give Packet __slots__ for reduced memoryDouglas Bagnall2019-01-081-1/+10
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: make random_colour_print more deterministic, silent on demandDouglas Bagnall2019-01-081-9/+21
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: delete empty temp directoriesDouglas Bagnall2019-01-081-1/+10
| | | | | | | | | even if someone asked to keep the temporary data, they don't want to see 5000 empty directries. Non-empty directories will remain. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: use namedtuple for ConversationAccounts namespace classDouglas Bagnall2019-01-081-9/+10
| | | | | | | Saving memory, which reduces fork overhead. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: fix mk_masked_dir doc and commentsDouglas Bagnall2019-01-081-1/+2
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: Packet.from_line classmethod uses cls varDouglas Bagnall2019-01-081-3/+3
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic learner: avoid truncated output files on errorDouglas Bagnall2019-01-081-1/+8
| | | | | | | | add_argument(type=argparse.FileType('w'), ...) will open the file and leave it empty if the script fails. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic_learner: use samba.logger, not print(file=sys.stderr)Douglas Bagnall2019-01-081-4/+8
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic_learner: return an error codeDouglas Bagnall2019-01-082-9/+5
| | | | | | | And use it in tests, rather than expecting exact strings. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* traffic: use default value for --durationDouglas Bagnall2019-01-081-7/+3
| | | | | | | | We could not do this when we replayed traffic summaries (as opposed to models), but now this script does not do that. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>