summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* traffic replay: allow --random-seed=0Douglas Bagnall2019-01-081-2/+2
| | | | | | | Zero is a valid seed. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/traffic: remove duplicate test fileDouglas Bagnall2019-01-081-60/+0
| | | | | | | The other one is python/samba/tests/blackbox/testdata/traffic-sample-very-short.model Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/tests/blackbox: check_exit_code() explains by defaultDouglas Bagnall2019-01-081-0/+2
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* idmap: In _wbint_Sids2UnixIDs, pass back what we haveVolker Lendecke2019-01-082-1/+9
| | | | | | | | | | | SOME_UNMAPPED does not mean that nothing worthwhile is in here. We need to pass what we have. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Jan 8 13:15:35 CET 2019 on sn-devel-144
* idmap_tdb: If one SID fails to map, try the restVolker Lendecke2019-01-081-1/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* selftest: Test sids-to-xids with one failing sidVolker Lendecke2019-01-083-0/+38
| | | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* waf: fix tri-state of --with-sendfile-support being auto the defaultBjörn Jacke2019-01-081-8/+4
| | | | | | | | | | | | | | | --with-sendfile-support should be used automatically if it's found. Configure now also fails reliably for all platforms when sendfile was explicitly requested but failed to be detected. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9707 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jan 8 07:03:49 CET 2019 on sn-devel-144
* waf: fix waf errors with sendfail detection on SolarisBjörn Jacke2019-01-081-3/+4
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: net: Do not set NET_FLAGS_ANONYMOUS with -kJustin Stephenson2019-01-081-2/+8
| | | | | | | | | | | | This affects net rpc getsid and net rpc changetrustpw commands. This avoids an anonymous IPC connection being made when -k is used, this only affects net rpc getsid and net rpc changetrustpw commands. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13726 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* libnet4: Use dom_sid_str_bufVolker Lendecke2019-01-083-21/+21
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind4: Use dom_sid_str_bufVolker Lendecke2019-01-081-14/+16
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* pysecurity: Use dom_sid_str_bufVolker Lendecke2019-01-081-6/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* auth4: Use dom_sid_str_bufVolker Lendecke2019-01-083-28/+21
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ntpd: Use dom_sid_str_bufVolker Lendecke2019-01-081-6/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* passdb: Use dom_sid_str_bufVolker Lendecke2019-01-081-33/+64
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Fix a typoVolker Lendecke2019-01-081-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* pydsdb: Use dom_sid_str_bufVolker Lendecke2019-01-081-8/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libndr: Use dom_sid_str_bufVolker Lendecke2019-01-081-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbclient: Use dom_sid_str_bufVolker Lendecke2019-01-081-3/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: Simplify smblsa_lookup_nameVolker Lendecke2019-01-081-7/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbindd: Use dom_sid_str_bufVolker Lendecke2019-01-081-8/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* auth3: Use dom_sid_str_bufVolker Lendecke2019-01-081-3/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove StrnCpyVolker Lendecke2019-01-082-27/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use strlcpy instead of StrnCpyVolker Lendecke2019-01-081-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* nmbd: Use strlcpy instead of StrnCpyVolker Lendecke2019-01-081-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Use strlcpy instead of StrnCpyVolker Lendecke2019-01-081-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4:torture:base:bench-readwrite: fix uninitialized memory causing segfaultAliaksei Karaliou2019-01-081-2/+2
| | | | | | | | | | Allocation of 'struct smb_composite_connect' happens without zeroing so that smb_composite_connect_send() thinks that connection already exists and fails on its handling. Signed-off-by: Aliaksei Karaliou <akaraliou@panasas.com> Reviewed-by: Douglas Bagnall <dbagnall@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* netcmd: Small refactor to SMB connection in domain backupTim Beale2019-01-081-2/+7
| | | | | | | | | | | | Rework the code so we only do this in one place. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Tim Beale <timbeale@samba.org> Autobuild-Date(master): Tue Jan 8 03:13:48 CET 2019 on sn-devel-144
* netcmd: Refactor duplicated SMB connect in GPO commandsTim Beale2019-01-071-24/+18
| | | | | | | | | | | | Do the SMB connection in a single helper function. Note: this highlights that perhaps we want all SMB connections to be signed, but we can fix that up separately. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* tests: Avoid hardcoding domain in GPO testsTim Beale2019-01-071-10/+15
| | | | | | | | | | | | | The realm varies by testenv. Currently the GPO tests will only run on the ad_dc testenv. A slightly better solution is to use the REALM environmental variable, so that the test can run on any testenv. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* python/ntacls: Convert ntacls to use s3 flagsTim Beale2019-01-071-6/+6
| | | | | | | | | | This helper code is just using the flags defined by the Python bindings. Convert it over to use s3 bindings instead of s4. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Add flags used by .list() to SMB Py bindingsTim Beale2019-01-071-0/+20
| | | | | | | | | | | | | These flags are exposed by the s4 code. Python code that calls .list() checks the returned attribs/mode for the directory listing, e.g. to work out whether something is a sub-directory: if item['attrib'] & libsmb.FILE_ATTRIBUTE_DIRECTORY... BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Rename 'credentials' param to match s4Tim Beale2019-01-072-2/+2
| | | | | | | | | | | s4 just calls it 'creds'. Renaming it will make it easier to convert existing SMB connections over to use the new bindings. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* tests: Rename libsmb_samba_internal test to libsmbTim Beale2019-01-072-1/+1
| | | | | | | | | So that it better matches the updated Python bindings name. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Rename libsmb_samba_internal Py bindings to libsmbTim Beale2019-01-075-17/+15
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* tests: Run SMB Py bindings tests against testenv with SMBv1-disabledTim Beale2019-01-071-1/+3
| | | | | | | | | | | | | | | Sanity-check that the SMBv2 connection actually works by running it against a testenv with SMBv1 disabled. I've dropped 'local' from the ad_dc target, because it shouldn't be needed. We're trying to test the client-side SMB connection, so running it without 'local' is probably a better test. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Tim Beale <timbeale@samba.org> Autobuild-Date(master): Mon Jan 7 04:29:51 CET 2019 on sn-devel-144
* tests: Avoid hardcoding domain in testTim Beale2019-01-071-6/+7
| | | | | | | | | | | | | | Currently the sysvol domain directory is hard-coded, so the tests can only ever run on the ad_dc. This patch makes things marginally better by using the REALM environmental variable instead. This allows us to run it against other testenvs (like the SMBv2-only restoredc). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* tests: Completely replace s4 connection in smb testsTim Beale2019-01-071-5/+1
| | | | | | | | | | This test now uses the s3 python bindings completely, so we can remove the s4 connection. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:pylibsmb: Add .deltree() API to SMB py bindingsTim Beale2019-01-072-4/+100
| | | | | | | | | | | | | | | | | | | This basically re-uses the underlying functionality of existing APIs in order to support a .deltree() API, i.e. - we use the .list() functionality (i.e. do_listing()) to traverse every item in the given directory. - we then use either .unlink() (i.e. unlink_file()) or .rmdir() (i.e. remove_dir()) to delete the individual item. - sub-directories are handled recursively, by repeating the process. Note that the .deltree() API is currently only really used for testing (and deleting GPO files). So the recursion is never going to be excessive. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:pylibsmb: Minor refactor to py_cli_list() variablesTim Beale2019-01-071-5/+5
| | | | | | | | | | Add a define for the file attribute mask (we'll reuse it in a subsequent patch), and make the variable type explicit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: Avoid duplicated code by making cli_read_sink() publicTim Beale2019-01-073-10/+7
| | | | | | | | | | cli_read_sink() and pull_helper() were essentially identical. By making cli_read_sink() non-static, we can delete the latter. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Add .loadfile() API to SMB py bindingsTim Beale2019-01-072-6/+137
| | | | | | | | | | | | Add a .loadfile API to read a file's contents. This provides a convenient way to read a file and is consistent with the existing source4 API, which is used by things like the GPO python code and the ntacls backup. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Add .savefile() API to SMB py bindingsTim Beale2019-01-073-10/+97
| | | | | | | | | | | | | | | | | | This provides a simple API for writing a file's contents and makes the s3 API consistent with the s4 API. All the async APIs here support SMBv2 so we don't need to use the sync APIs at all. Note that we have the choice here of using either cli_write_send() or cli_push_send(). I chose the latter, because that's what smbclient uses. It also appears to handle writing a large file better (i.e. one that exceeds the max write size of the underlying connection). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Free async .list() memoryTim Beale2019-01-071-0/+3
| | | | | | | | | finfos was being allocated but never freed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:pylibsmb: Make s3 and s4 listings return the same dictTim Beale2019-01-072-4/+18
| | | | | | | | | | | | Make the python dictionary generated by the s3 .list() use the same keys as the current source4 dict. The reason for using the source4 dict is that other python code depends on these keys (e.g. ntacls.py), whereas the source3 API is currently unused. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:pylibsmb: Don't return '.'/'..' in .list()Tim Beale2019-01-072-3/+8
| | | | | | | | | | | The source4 .list() API wasn't doing this. This makes source3 and source4 have *almost* equivalent functionality, so we can start usign the source3 API in the tests. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:pylibsmb: Make .list() work for SMBv2Tim Beale2019-01-071-8/+16
| | | | | | | | | | In order for .list() to work on an SMBv2 connection we need to use the synchronous API. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:pylibsmb: Split code out into do_listing() helperTim Beale2019-01-071-31/+50
| | | | | | | | | | | We'll want to reuse the directory listing function for the deltree API. This patch splits the bulk of the work out into a do_listing() helper function. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:pylibsmb: Split out code into list_helper()Tim Beale2019-01-071-15/+27
| | | | | | | | | | Refactor out the code so we can re-use it for the synchronous API as well. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:pylibsmb: Consolidate .readdir()/.list() py bindings APITim Beale2019-01-071-9/+23
| | | | | | | | | | | | | | Rename the .readdir API to .list and make the parameters match up with the s4 python bindings, i.e. 'mask' is optional and separate from the directory parameter. Note that nothing uses the .readdir source3 API currently, so it's safe to rename. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>