summaryrefslogtreecommitdiff
path: root/source4/torture/libnet
Commit message (Collapse)AuthorAgeFilesLines
* s4:torture: Do not overrun arrays in test_displayshares()Andreas Schneider2017-08-251-19/+61
| | | | | | | | | If we do not 'break', we overrun the array access size. Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s4: popt: Global replace of cmdline_credentials -> ↵Jeremy Allison2017-05-118-19/+20
| | | | | | | | | | | popt_get_cmdline_credentials(). Add one use of popt_set_cmdline_credentials(). Fix 80 column limits when cmdline_credentials changes to popt_get_cmdline_credentials(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4: torture: Change torture_register_suite() to add a TALLOC_CTX *.Jeremy Allison2017-05-051-2/+2
| | | | | | | | Change callers to use the passed in TALLOC_CTX * instead of talloc_autofree_context(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* lib: modules: Change XXX_init interface from XXX_init(void) to ↵Jeremy Allison2017-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | XXX_init(TALLOC_CTX *) Not currently used - no logic changes inside. This will make it possible to pass down a long-lived talloc context from the loading function for modules to use instead of having them internally all use talloc_autofree_context() which is a hidden global. Updated all known module interface numbers, and added a WHATSNEW. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 22 01:17:00 CEST 2017 on sn-devel-144
* s4:torture:libnet: fix 'Syscall param writev(vector[...])' valgrind errorNoel Power2016-04-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | smbtorture test net.api.delshare.api.delshare generates the following valgrind trace ==29209== Syscall param writev(vector[...]) points to uninitialised byte(s) ==29209== at 0xFBA2C87: writev (in /lib64/libc-2.19.so) ==29209== by 0x106CB033: writev_handler (async_sock.c:340) ==29209== by 0xF67812A: ??? (in /usr/lib64/libtevent.so.0.9.26) ==29209== by 0xF6765F6: ??? (in /usr/lib64/libtevent.so.0.9.26) ==29209== by 0xF6727FC: _tevent_loop_once (in /usr/lib64/libtevent.so.0.9.26) ==29209== by 0xF673ACE: tevent_req_poll (in /usr/lib64/libtevent.so.0.9.26) ==29209== by 0x5D19325: tevent_req_poll_ntstatus (tevent_ntstatus.c:109) ==29209== by 0x88B2E0D: dcerpc_binding_handle_call (binding_handle.c:556) ==29209== by 0xBC6B4A1: dcerpc_srvsvc_NetShareAdd_r (ndr_srvsvc_c.c:3327) ==29209== by 0x5990D8: test_addshare (libnet_share.c:194) ==29209== by 0x5992D5: torture_delshare (libnet_share.c:228) ==29209== by 0x9553F62: wrap_simple_test (torture.c:632) ==29209== by 0x955368F: internal_torture_run_test (torture.c:442) ==29209== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==29209== by 0x26013F: run_matching (smbtorture.c:110) ==29209== by 0x260001: run_matching (smbtorture.c:95) ==29209== by 0x260260: torture_run_named_tests (smbtorture.c:143) ==29209== by 0x261EDF: main (smbtorture.c:665) ==29209== Address 0x1887fd16 is 598 bytes inside a block of size 1,325 alloc'd ==29209== at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==29209== by 0xF464A73: _talloc_pooled_object (in /usr/lib64/libtalloc.so.2.1.5) ==29209== by 0xF67366D: _tevent_req_create (in /usr/lib64/libtevent.so.0.9.26) ==29209== by 0xB0D49FF: smb1cli_req_create (smbXcli_base.c:1322) ==29209== by 0xB0E1E6D: smb1cli_trans_send (smb1cli_trans.c:512) ==29209== by 0xB0ED47D: tstream_smbXcli_np_readv_trans_start (tstream_smbXcli_np.c:901) ==29209== by 0xB0EC847: tstream_smbXcli_np_writev_write_next (tstream_smbXcli_np.c:578) ==29209== by 0xB0EC4D7: tstream_smbXcli_np_writev_send (tstream_smbXcli_np.c:505) ==29209== by 0xC259DFA: tstream_writev_send (tsocket.c:695) ==29209== by 0xC25AD64: tstream_writev_queue_trigger (tsocket_helpers.c:513) ==29209== by 0xF673023: tevent_common_loop_immediate (in /usr/lib64/libtevent.so.0.9.26) ==29209== by 0xF677EED: ??? (in /usr/lib64/libtevent.so.0.9.26) ==29209== by 0xF6765F6: ??? (in /usr/lib64/libtevent.so.0.9.26) ==29209== by 0xF6727FC: _tevent_loop_once (in /usr/lib64/libtevent.so.0.9.26) ==29209== by 0xF673ACE: tevent_req_poll (in /usr/lib64/libtevent.so.0.9.26) ==29209== by 0x5D19325: tevent_req_poll_ntstatus (tevent_ntstatus.c:109) ==29209== by 0x88B2E0D: dcerpc_binding_handle_call (binding_handle.c:556) ==29209== by 0xBC6B4A1: dcerpc_srvsvc_NetShareAdd_r (ndr_srvsvc_c.c:3327) ==29209== by 0x5990D8: test_addshare (libnet_share.c:194) ==29209== by 0x5992D5: torture_delshare (libnet_share.c:228) ==29209== by 0x9553F62: wrap_simple_test (torture.c:632) ==29209== by 0x955368F: internal_torture_run_test (torture.c:442) ==29209== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==29209== by 0x26013F: run_matching (smbtorture.c:110) ==29209== by 0x260001: run_matching (smbtorture.c:95) ==29209== by 0x260260: torture_run_named_tests (smbtorture.c:143) ==29209== by 0x261EDF: main (smbtorture.c:665) Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:torture:libnet: fix 'Conditional jump or move' valgrind errorNoel Power2016-04-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | smbtorture test net.domopen.domopen generated the following valgrind trace. ==29054== Conditional jump or move depends on uninitialised value(s) ==29054== at 0x9788D31: libnet_DomainOpen_send (libnet_domain.c:617) ==29054== by 0x9788E01: libnet_DomainOpen (libnet_domain.c:676) ==29054== by 0x595F5D: test_domainopen (domain.c:41) ==29054== by 0x5961AD: torture_domainopen (domain.c:101) ==29054== by 0x9553F62: wrap_simple_test (torture.c:632) ==29054== by 0x955368F: internal_torture_run_test (torture.c:442) ==29054== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==29054== by 0x26013F: run_matching (smbtorture.c:110) ==29054== by 0x260001: run_matching (smbtorture.c:95) ==29054== by 0x260260: torture_run_named_tests (smbtorture.c:143) ==29054== by 0x261EDF: main (smbtorture.c:665) ==29054== ==29054== Conditional jump or move depends on uninitialised value(s) ==29054== at 0x9788D95: libnet_DomainOpen_recv (libnet_domain.c:648) ==29054== by 0x9788E1D: libnet_DomainOpen (libnet_domain.c:677) ==29054== by 0x595F5D: test_domainopen (domain.c:41) ==29054== by 0x5961AD: torture_domainopen (domain.c:101) ==29054== by 0x9553F62: wrap_simple_test (torture.c:632) ==29054== by 0x955368F: internal_torture_run_test (torture.c:442) ==29054== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==29054== by 0x26013F: run_matching (smbtorture.c:110) ==29054== by 0x260001: run_matching (smbtorture.c:95) ==29054== by 0x260260: torture_run_named_tests (smbtorture.c:143) Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s4:torture/libnet: add missing #include "torture/libnet/proto.h"Stefan Metzmacher2014-04-024-0/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4:torture/libnet: make use of dcerpc_binding_get_string_option("host")Stefan Metzmacher2014-02-134-7/+10
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:torture/libnet: fix compiler warnings in libnet_lookup.cStefan Metzmacher2014-01-161-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:torture/libnet: check the result of libnet_LookupName()Stefan Metzmacher2014-01-161-1/+5
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:torture/libnet: remove bogus usage of p->conn->event_ctxStefan Metzmacher2014-01-161-7/+0
| | | | | | | | ctx->event_ctx and p->conn->event_ctx already have the same value as torture->ev. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:libnet: let libnet_rpc_usermod() take tevent_context/dcerpc_binding_handleStefan Metzmacher2014-01-161-1/+1
| | | | | | | This avoids usage/dereferencing 'struct dcerpc_pipe'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:libnet: let libnet_rpc_userdel() take tevent_context/dcerpc_binding_handleStefan Metzmacher2014-01-161-1/+3
| | | | | | | This avoids usage/dereferencing 'struct dcerpc_pipe'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:libnet: let libnet_rpc_useradd() take tevent_context/dcerpc_binding_handleStefan Metzmacher2014-01-161-1/+1
| | | | | | | This avoids usage/dereferencing 'struct dcerpc_pipe'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:libnet: let libnet_rpc_useradd_send() take ↵Stefan Metzmacher2014-01-161-1/+2
| | | | | | | | | tevent_context/dcerpc_binding_handle This avoids usage/dereferencing 'struct dcerpc_pipe'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:libnet: let libnet_rpc_userinfo() take tevent_context/dcerpc_binding_handleStefan Metzmacher2014-01-162-3/+5
| | | | | | | This avoids usage/dereferencing 'struct dcerpc_pipe'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:libnet: let libnet_rpc_userinfo_send() take ↵Stefan Metzmacher2014-01-161-2/+4
| | | | | | | | | tevent_context/dcerpc_binding_handle This avoids usage/dereferencing 'struct dcerpc_pipe'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:libnet: let libnet_rpc_groupadd() take tevent_context/dcerpc_binding_handleStefan Metzmacher2014-01-161-3/+7
| | | | | | | This avoids usage/dereferencing 'struct dcerpc_pipe'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:libnet: let libnet_rpc_groupinfo() take tevent_context/dcerpc_binding_handleStefan Metzmacher2014-01-161-2/+4
| | | | | | | This avoids usage/dereferencing 'struct dcerpc_pipe'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* Force cast to long as on some platform tv_usec is 32bit longMatthieu Patou2012-09-101-2/+2
| | | | | Autobuild-User(master): Matthieu Patou <mat@samba.org> Autobuild-Date(master): Mon Sep 10 07:33:50 CEST 2012 on sn-devel-104
* s4-libnet: Add mem_ctx to libnet_rpc_useradd calls (bug #8889)Andrew Bartlett2012-04-301-1/+1
|
* s4:libnet: pass an explicit mem_ctx to libnet_rpc_userinfo_send() (bug #8889)Stefan Metzmacher2012-04-241-2/+2
| | | | | | | | | This hopefully fixes the flakey autobuild. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Apr 24 16:43:03 CEST 2012 on sn-devel-104
* torture/libnet: Include prototype headers.Jelmer Vernooij2012-02-071-0/+1
|
* s4-param Remove 'sam database' parameterAndrew Bartlett2011-06-061-5/+5
| | | | | | This now just relies on the private dir parameter, which remains. Andrew Bartlett
* s4-libcli Remove resolve_name() as it conflicts with Samba3.Andrew Bartlett2011-05-031-2/+3
| | | | | | | This was just a wrapper around resolve_name_ex(), so just call that instead. Andrew Bartlett
* Use TestCase.get_credentials() where possible.Jelmer Vernooij2011-01-031-4/+3
|
* s4-smbtorture: Make test names lowercase and dot-separated.Jelmer Vernooij2010-12-111-33/+34
| | | | | | | | This is consistent with the test names used by selftest, should make the names less confusing and easier to integrate with other tools. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Dec 11 04:16:13 CET 2010 on sn-devel-104
* torture/becomedc: Add test for global schema, use samdb_connect().Jelmer Vernooij2010-10-121-6/+8
| | | | | Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Tue Oct 12 18:35:33 UTC 2010 on sn-devel-104
* s4-libnet: print the domain name on domain open failureAndrew Tridgell2010-09-152-2/+4
| | | | Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-test: refactor API-DELETEUSER test a little to:Kamen Mazdrashki2010-09-051-29/+23
| | | | | | - fail torture_context in case libnet_DeleteUser() has failed - make use of torture_assert_* macros to track down where failur occured - use only one memory context internally
* s4: use GetTimeOfDay macro instead of gettimeofdayBjörn Jacke2010-08-311-1/+1
|
* s4:torture/libnet: avoid dereferencing dcerpc_binding_handle internalsStefan Metzmacher2010-08-021-4/+5
| | | | metze
* s4-loadparm: 2nd half of lp_ to lpcfg_ conversionAndrew Tridgell2010-07-1611-30/+30
| | | | | | | this converts all callers that use the Samba4 loadparm lp_ calling convention to use the lpcfg_ prefix. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s4-python: python is not always in /usr/binAndrew Tridgell2010-06-241-1/+1
| | | | | | | | Using "#!/usr/bin/env python" is more portable. It still isn't ideal though, as we should really use the python path found at configure time. We do that in many places already, but some don't. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* python: Use samba.tests.TestCase, make sure base class tearDown andJelmer Vernooij2010-06-191-3/+1
| | | | setUp methods are called, fix formatting.
* s4:lib: merge LDB_WRAP and LDBSAMBA and make LDBSAMBA a library.Stefan Metzmacher2010-06-162-2/+2
| | | | | | | | | This is needed to remove samba specifc symbols from the bundled ldb, in order to get the ABI right. metze Signed-off-by: Andreas Schneider <asn@samba.org>
* s4:torture Rework NET-API-BECOMEDC test to use libnet_vampire callbacks.Andrew Bartlett2010-06-151-582/+59
| | | | | | | | | | | The libnet_vampire code was derived from this code in the first place, but has continued to evolve, while this code has often bitrotted. This avoids the needless duplication of the callbacks, while keeping the toture wrapper. Andrew Bartlett Signed-off-by: Kamen Mazdrashki <kamenim@samba.org>
* s4/test-libnet: Re-align code a bit - more readable this way IMOKamen Mazdrashki2010-06-113-24/+28
|
* s4/test-libnet: Refactor test_group_create() a little to:Kamen Mazdrashki2010-06-111-11/+22
| | | | | - Close unused policy handle for created group - re-align code - it is more readable this way IMHO
* s4/test-libnet: Refactor test_user_create() little bit to:Kamen Mazdrashki2010-06-111-11/+7
| | | | | | | | - fix a flaw that user RID is not returned in case user is recreated - close unused policy handle to created user - do not take into account the result from test_samr_close_handle - we don't case
* s4/test-libnet: add few comments for utility functionsKamen Mazdrashki2010-06-111-3/+11
|
* s4/test-libnet: Move LSA close handle function to a common locationKamen Mazdrashki2010-06-113-40/+26
|
* s4/test-libnet: remove unused codeKamen Mazdrashki2010-06-111-25/+0
| | | | | Pre-connecting SAMR and LSA pipes is implemented in test_libnet_context_init() function
* s4/test-libnet: Fix compile-time warningKamen Mazdrashki2010-06-111-1/+1
|
* s4/test: use test_libnet_context_init() function to create libnet_contextKamen Mazdrashki2010-06-112-24/+23
| | | | | This way we ensure that LIBNET call will be issued against the DC we are testing against
* s4/test: fix SEGFAULT in test_group_create when rid is NULLKamen Mazdrashki2010-06-111-1/+4
| | | | | Caller of this function may not need group RID and in such case it passes NULL for rid parameter
* s4/test-libnet: Helper func to initialize libnet_contextKamen Mazdrashki2010-06-111-0/+54
| | | | | | | | | | | | | | | | | | and create rpc connections to SAMR and LSA pipes. This function should be used in cases where we need 'deterministic' connection to the DC we are testing against. The problem is that most of the test follow the pattern: 1. Connect to server supplied on command line 2. Create user/group through connection in 1. 3. Use 'fresh' libnet_context to query/alter the object in step 2. In singe-DC environment this work well. But in multiple-DC environment libnet may connect to another DC (step 3), not the one we use in step 1 and 2. This leads to false error - object created in step 2 is not found on DC we are querying in step 3.
* s4/test: Call test_user_cleanup with original RDN for the userKamen Mazdrashki2010-06-111-1/+1
| | | | | | 'name' var is changed during the test execution and should contain samAccountName for the user, while test_user_cleanup() expects account RDN to be passed
* s4/test: Fix incorrect NTSTATUS comparisonKamen Mazdrashki2010-06-111-2/+2
| | | | In case group already exists, we should get NT_STATUS_GROUP_EXISTS.
* s4/test: remove create/delete group implementation in API-CREATEGROUP testKamen Mazdrashki2010-06-111-110/+3
| | | | | We already have common implementation for create/delete group in libnet/utils.c