Noel Power [Fri, 28 Feb 2020 13:32:01 +0000 (13:32 +0000)]
selftest/manage-ca: Add certificiate etc. for DC addcsmb1
Preparatory commit pre adding new addc_smb1 environment.
In order to support new addc_smb1 test environment we need new
certificate(s) in order to satisfy some tests
(e.g. samba4.blackbox.pkinit.*)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Noel Power [Tue, 7 Jan 2020 10:17:49 +0000 (10:17 +0000)]
script: Add testenv fileserver_smb1 to autobuild jobs
Adjust the existing autobuild jobs that currently include/exclude
test env fileserver to also use fileserver_smb1.
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Noel Power [Wed, 4 Dec 2019 11:50:48 +0000 (11:50 +0000)]
selftest: Add new test environment fileserver_smb1
fileserver_smb1 is a copy of the fileserver test environment but
with the difference that it still supports SMB1, this will allow
use to still run SMB1 tests.
Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Noel Power [Thu, 5 Dec 2019 17:00:29 +0000 (17:00 +0000)]
selftest: adjust skip_file (after adjusting s4member and rpc_proxy)
The orig skip file was created with *all* test environments by
default not support SMB1.
Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Noel Power [Wed, 4 Dec 2019 11:06:44 +0000 (11:06 +0000)]
selftest: Allow rpc_proxy & s4member also negotiate SMB1
Test environments rpc_proxy & s4member depend on ad_dc_ntvfs
so these environments additionally need to also be able to
still support SMB1.
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Noel Power [Fri, 27 Sep 2019 14:24:25 +0000 (15:24 +0100)]
selftest: disable SMB1 from testenv(s) make >=SMB2 the default
Change the values of 'min protocol' set for the various test
environments to be SMB2_02.
Servers will only offer protocols starting with the min specified in the
conf files. We don't change the client value here yet (until SMB1 is
truely gone) as we still want to be able to run SMB1 tests.
Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Noel Power [Tue, 22 Oct 2019 21:57:36 +0000 (22:57 +0100)]
selftest: Exclude SMB1 tests that would fail when SMB1 is disabled
Exclude the tests specified in the file 'skip_smb1_fails' which
contains the list of tests that would fail if min protocol >= SMB2_02
Note: a subsequent commit will change the default min protocol so
in order to maintain bisectability we skip the tests before
we change the default.
Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Noel Power [Mon, 21 Oct 2019 14:27:10 +0000 (15:27 +0100)]
selftest: Create a file to exclude tests that fail with SMB1
skip_smb1_fails contains tests that will fail when the min protocol
of the test environments is set to SMB2_02
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Noel Power [Wed, 27 Nov 2019 08:30:06 +0000 (08:30 +0000)]
selftest: Allow ad_dc_ntvfs negotiate smb1 still
The default for most test envs will be changed in a future
commit(s) to be >= SMB2 then we need to still allow ad_dc_ntvfs to
support SMB1. This will make the number of tests to port easier to
deal with. In addition to test env ad_dc_ntvfs still supporting SMB1
we need to do the same with test other environments that depend on
ad_dc_ntvfs (this will be handled in followup commits).
In addition to the above this change will ensure we don't trigger
failures for ntvfs tests when we switch to default >= SMB2 which will
make the associated skip file (added in a future commit) smaller.
Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Noel Power [Mon, 9 Dec 2019 10:12:17 +0000 (10:12 +0000)]
s3/selftest: Fix typo in test generator script
Introduced in
a64516099936 but only makes a difference when
environments limit protocols for testing.
Reviewed-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Noel Power <noel.power@suse.com>
Ralph Boehme [Fri, 21 Feb 2020 16:44:55 +0000 (17:44 +0100)]
selftest: allow SMB1 in clusteredmember env
This is a relatively new test environment that only uses very few tests
yet. Skip the env name rename dance for this env, but someone has to convert the
tests later on.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Rowland Penny [Thu, 2 Apr 2020 08:29:18 +0000 (09:29 +0100)]
samba-tool group show: only shows global security groups, this patch makes it show all groups.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14335
Signed-off-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Björn Baumbach <bb@samba.org>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Thu Apr 2 15:27:53 UTC 2020 on sn-devel-184
Swen Schillig [Mon, 30 Mar 2020 10:54:00 +0000 (12:54 +0200)]
dbwrap: fix possible memleak and false result check.
A cstatus != 0 or a data.dsize != sizeof(uint32_t)
does not guarantee to have no received data referenced by data.dptr.
Therefore, make sure data.dptr is free'd.
Reusing the same data structure as data input and data output parameter
can lead to wrong results, especially when the output parameters value
is used to detect errors. Create the additional local variable outdata
to prevent this issue.
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Apr 2 11:26:32 UTC 2020 on sn-devel-184
Swen Schillig [Mon, 30 Mar 2020 10:44:59 +0000 (12:44 +0200)]
dbwrap: fix comment in code leading to wrong function parameter
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Swen Schillig [Mon, 30 Mar 2020 10:34:12 +0000 (12:34 +0200)]
ctdbd_conn: possible memleak in ctdbd_db_attach
A cstatus != 0 or a data.dsize != sizeof(uint32_t)
does not guarantee to have no received data referenced by data.dptr.
Therefore, make sure data.dptr is free'd.
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Swen Schillig [Mon, 30 Mar 2020 10:29:38 +0000 (12:29 +0200)]
ctdbd_conn: possible memleak in ctdbd_dbpath
A cstatus != 0 does not guarantee to have no received data
referenced by rdata.dptr.
Therefore, make sure rdata.dptr is free'd.
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Swen Schillig [Mon, 30 Mar 2020 10:22:46 +0000 (12:22 +0200)]
ctdbd_conn: possible memleak in ctdbd_working
A cstatus != 0 does not guarantee to have no received data
referenced by outdata.dptr.
Therefore, make sure outdata.dptr is free'd.
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Stefan Metzmacher [Thu, 27 Feb 2020 23:00:08 +0000 (00:00 +0100)]
script/autobuild.py: allow write_system_info commands to fail
These commands are just there as hints to debug possible problems.
In order to support autobuild.py on non-linux platforms we should
just ignore errors here.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Apr 2 07:36:07 UTC 2020 on sn-devel-184
Stefan Metzmacher [Thu, 27 Feb 2020 22:59:00 +0000 (23:59 +0100)]
script/autobuild.py: use more portable 'cp -R -a -l'
On platforms like FreeBSD 12 cp doesn't accept the long options,
using the one letter options works there and keeps working on Linux
as well.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Stefan Metzmacher [Thu, 27 Feb 2020 22:58:42 +0000 (23:58 +0100)]
script/autobuild.py: add support git worktree
.git is not always a directory, with 'git worktree' it's a file.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Stefan Metzmacher [Wed, 1 Apr 2020 22:22:26 +0000 (00:22 +0200)]
.gitlab-ci.yml: actually run ubuntu2004-samba-o3
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Noel Power [Wed, 1 Apr 2020 11:26:09 +0000 (12:26 +0100)]
s3/utils: Fix double free error with smbtree
==3632==
WORKGROUP
\\ATP
\\ATP\IPC$ IPC Service ()
==3632== Invalid read of size 8
==3632== at 0x773C926: poptResetContext (in /usr/lib64/libpopt.so.0.0.0)
==3632== by 0x773E5DD: poptFreeContext (in /usr/lib64/libpopt.so.0.0.0)
==3632== by 0x10A8BC: main (smbtree.c:354)
==3632== Address 0x16085e00 is 640 bytes inside a block of size 784 free'd
==3632== at 0x4C2F1AD: free (vg_replace_malloc.c:530)
==3632== by 0x773E6F7: poptFreeContext (in /usr/lib64/libpopt.so.0.0.0)
==3632== by 0x10A84B: main (smbtree.c:342)
==3632== Block was alloc'd at
==3632== at 0x4C2FE45: calloc (vg_replace_malloc.c:711)
==3632== by 0x773C79A: poptGetContext (in /usr/lib64/libpopt.so.0.0.0)
==3632== by 0x10A829: main (smbtree.c:339)
==3632==
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14332
Signed-off-by: Noel Power <npower@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Wed Apr 1 18:51:43 UTC 2020 on sn-devel-184
Samuel Cabrero [Fri, 27 Mar 2020 18:52:26 +0000 (19:52 +0100)]
s3:rpc_server: Fix talloc_free() with references error on server exit
Fixes talloc_free() with references when smbd exists and talloc_free the
global dcesrv context:
ERROR: talloc_free with references at ../../source3/rpc_server/rpc_config.c:73
reference at ../../source3/rpc_server/rpc_server.c:193
reference at ../../source3/rpc_server/rpc_server.c:592
...
The talloc_reference to make the dcerpc_ncacn_listen_state a parent of
the dcesrv context is not necessary as the listen state is allocated
under the endpoint, which is allocated under the dcesrv context:
full talloc report on 'struct dcesrv_context' (total 12298 bytes in 188 blocks)
...
struct dcesrv_endpoint contains 691 bytes in 11 blocks (ref 0) 0x55ae964d79a0
struct dcerpc_ncacn_listen_state contains 160 bytes in 2 blocks (ref 0) 0x55ae964fca60
struct tevent_fd contains 104 bytes in 1 blocks (ref 0) 0x55ae964f36f0
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964e8a40
../../librpc/rpc/dcesrv_core.c:360 contains 104 bytes in 1 blocks (ref 0) 0x55ae964e8ac0
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964e8870
../../librpc/rpc/dcesrv_core.c:327 contains 104 bytes in 1 blocks (ref 0) 0x55ae964e8970
struct dcerpc_binding contains 108 bytes in 2 blocks (ref 0) 0x55ae964e87a0
\pipe\lsass contains 12 bytes in 1 blocks (ref 0) 0x55ae964e88f0
struct dcerpc_binding contains 111 bytes in 2 blocks (ref 0) 0x55ae964e86d0
\pipe\netlogon contains 15 bytes in 1 blocks (ref 0) 0x55ae964e8650
...
struct dcesrv_endpoint contains 1728 bytes in 27 blocks (ref 0) 0x55ae964e0db0
struct dcerpc_ncacn_listen_state contains 160 bytes in 2 blocks (ref 0) 0x55ae964fd540
struct tevent_fd contains 104 bytes in 1 blocks (ref 0) 0x55ae964f3890
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964fbd70
../../librpc/rpc/dcesrv_core.c:360 contains 104 bytes in 1 blocks (ref 0) 0x55ae964f67a0
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964fff60
../../librpc/rpc/dcesrv_core.c:360 contains 104 bytes in 1 blocks (ref 0) 0x55ae964f66c0
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964eb8b0
../../librpc/rpc/dcesrv_core.c:360 contains 104 bytes in 1 blocks (ref 0) 0x55ae964eba00
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964eb200
../../librpc/rpc/dcesrv_core.c:360 contains 104 bytes in 1 blocks (ref 0) 0x55ae964eb350
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964eab70
../../librpc/rpc/dcesrv_core.c:360 contains 104 bytes in 1 blocks (ref 0) 0x55ae964eabf0
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964ea360
../../librpc/rpc/dcesrv_core.c:360 contains 104 bytes in 1 blocks (ref 0) 0x55ae964ea4b0
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964e9cb0
../../librpc/rpc/dcesrv_core.c:360 contains 104 bytes in 1 blocks (ref 0) 0x55ae964e9e00
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964e96a0
../../librpc/rpc/dcesrv_core.c:360 contains 104 bytes in 1 blocks (ref 0) 0x55ae964e97f0
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964e8430
../../librpc/rpc/dcesrv_core.c:360 contains 104 bytes in 1 blocks (ref 0) 0x55ae964e8580
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964e6250
../../librpc/rpc/dcesrv_core.c:360 contains 104 bytes in 1 blocks (ref 0) 0x55ae964e8070
struct dcesrv_if_list contains 128 bytes in 2 blocks (ref 0) 0x55ae964e7e50
../../librpc/rpc/dcesrv_core.c:327 contains 104 bytes in 1 blocks (ref 0) 0x55ae964e7fa0
struct dcerpc_binding contains 104 bytes in 2 blocks (ref 0) 0x55ae964e7ed0
DEFAULT contains 8 bytes in 1 blocks (ref 0) 0x55ae964eaa10
....
Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Apr 1 10:28:43 UTC 2020 on sn-devel-184
Andrew Bartlett [Fri, 27 Mar 2020 03:10:44 +0000 (16:10 +1300)]
dlz_bind9: Avoid talloc_new(NULL), use a parent variable
This will help provide a better memory tree if we ever suspect a problem
here. The tmp_ctx varaible is always freed before the end of this
function.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Andreas Schneider [Sun, 29 Mar 2020 15:20:32 +0000 (17:20 +0200)]
gitlab-ci: Use a shared ccache for the runners
https://docs.gitlab.com/ee/ci/caching/
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Apr 1 07:25:33 UTC 2020 on sn-devel-184
Andreas Schneider [Sun, 29 Mar 2020 14:49:51 +0000 (16:49 +0200)]
gitlab-ci: Add ccache and wget
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Ralph Boehme [Mon, 30 Mar 2020 06:06:10 +0000 (08:06 +0200)]
smbd: remove struct privilege_paths
The last user of this had been removed by
d485c43cc74c5550d151fe728ddc53b02ab23df8.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 31 19:32:12 UTC 2020 on sn-devel-184
Gary Lockyer [Sun, 29 Mar 2020 23:08:30 +0000 (12:08 +1300)]
lib ldb: lmdb clear stale readers on write txn start
In use process failures and Bind9 shut downs leave stale entries in the
lmdb reader table. This can result in lmdb filling it's database file, as
the free list can not be reclaimed due to the stale reader.
In this fix we call mdb_reader_check at the start of each transaction,
to free any stale readers. As the default maximum number of readers is
127, this should not impact on performance to any great extent.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14330
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Mar 31 01:26:07 UTC 2020 on sn-devel-184
Jeremy Allison [Thu, 26 Mar 2020 23:30:48 +0000 (16:30 -0700)]
s3: smbd: RIP smb_filename->original_lcomp.
Removed from struct smb_filename. You will not be missed :-).
Note that VFS ABI modified.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Mar 30 16:23:45 UTC 2020 on sn-devel-184
Jeremy Allison [Thu, 26 Mar 2020 23:27:25 +0000 (16:27 -0700)]
s3: smbd: Remove UCF_SAVE_LCOMP flag. Note it is no longer used.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 26 Mar 2020 23:24:08 +0000 (16:24 -0700)]
s3: smbd: Remove all references to original_lcomp from name copying code.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 26 Mar 2020 23:22:36 +0000 (16:22 -0700)]
s3: smbd: Now we no longer use it, remove all references to original_lcomp from pathname processing code.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 26 Mar 2020 23:18:53 +0000 (16:18 -0700)]
s3: smbd: Use get_original_lcomp() inside smb_file_rename_information().
Pass to rename_internals_fsp() and rename_internals().
Removes the last uses of the struct member original_lcomp
outside of the filename and struct util copying code.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 26 Mar 2020 22:59:51 +0000 (15:59 -0700)]
s3: smbd: Use get_original_lcomp() inside smb2_file_rename_information().
Pass to rename_internals_fsp(). Note this is a logic change,
as the original code only set smb_fname->original_lcomp if
it was doing a stream rename. Inside rename_internals_fsp()
we only look at original_lcomp in the stream rename case, so
this code worked. However, it is much safer to always correctly
create dst_original_lcomp than pass in a NULL here. It won't
hurt if it's not actually looked at.
Removes one more use of the struct member original_lcomp.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 26 Mar 2020 22:51:18 +0000 (15:51 -0700)]
s3: smbd: Use get_original_lcomp() inside reply_mv().
Pass to rename_internals().
Removes one more use of the struct member original_lcomp.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 26 Mar 2020 22:48:08 +0000 (15:48 -0700)]
s3: smbd: Use get_original_lcomp() inside reply_ntrename().
Pass to rename_internals().
Removes one more use of the struct member original_lcomp.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 26 Mar 2020 22:32:36 +0000 (15:32 -0700)]
s3: smbd: Inside rename_internals() wildcard case, re-purpose dst_original_lcomp.
Pass to rename_internals_fsp() instead of using smb_fname_dst->original_lcomp.
Removes one more use of the struct member original_lcomp.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 26 Mar 2020 01:41:10 +0000 (18:41 -0700)]
s3: smbd: Add 'const char *dst_original_lcomp' parameter to rename_internals()
Pass through the existing smb_fname_dst->original_lcomp
parameter so no logic change. Preparing to remove the
use of original_lcomp.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 26 Mar 2020 00:17:30 +0000 (17:17 -0700)]
s3: smbd: Reformatting caller of rename_internals() to make it easer to see changed parameters.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 25 Mar 2020 23:20:23 +0000 (16:20 -0700)]
s3: smbd: Add a dst_original_lcomp parameter to rename_internals_fsp().
Currently passed in as dst_fname->original_lcomp in all callers
but will eventually be converted to allow original_lcomp to be
removed from struct smb_filename.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 25 Mar 2020 20:42:34 +0000 (13:42 -0700)]
s3: smbd: Reformatting callers of rename_internals_fsp() to make it easer to see changed parameters.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 25 Mar 2020 17:20:14 +0000 (10:20 -0700)]
s3: smbd: Remove use of smb_fname->original_lcomp from call_trans2findfirst().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 25 Mar 2020 17:03:16 +0000 (10:03 -0700)]
s3: smbd: Remove use of smb_fname->original_lcomp from smb2 query directory.
Use get_original_lcomp() call. Removes one use of smb_fname->original_lcomp.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Wed, 25 Mar 2020 17:00:57 +0000 (10:00 -0700)]
s3: smbd: Add utility function get_original_lcomp().
Gets the last component from a client passed-in
filename. Copes with @GMT snapshot and MS-DFS names.
Preparing to remove original_lcomp from
struct smb_filename.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Jeremy Allison [Thu, 26 Mar 2020 19:35:26 +0000 (12:35 -0700)]
s3: smbd: Extract large directory case normalization code into a utility function normalize_filename_case().
It is done before the original_lcomp is extracted
from the client pathname, so the new function that
will allow us to remove original_lcomp also needs
this logic.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Günther Deschner [Fri, 27 Mar 2020 09:13:11 +0000 (10:13 +0100)]
nsswitch: fix use-after-free causing segfault in _pam_delete_cred
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14327
Guenther
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Mar 30 13:01:20 UTC 2020 on sn-devel-184
Stefan Metzmacher [Thu, 13 Feb 2020 15:29:38 +0000 (16:29 +0100)]
s4:selftest: run samba.tests.krb5.simple_tests against ad_dc_default
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Mar 27 19:54:25 UTC 2020 on sn-devel-184
Stefan Metzmacher [Thu, 13 Feb 2020 15:29:38 +0000 (16:29 +0100)]
python/tests/krb5: add simple_tests.py with the first simple test
This just demonstrates that the infrastructure works:-)
I'm running this as:
SERVER=172.31.9.188 DOMAIN=W2012R2-L6 REALM=W2012R2-L6.BASE \
USERNAME=administrator PASSWORD=
A1b2C3d4 SERVICE_USERNAME="w2012r2-188" \
python/samba/tests/krb5/simple_tests.py
Pair-Programmed-With: Isaac Boukris <iboukris@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Stefan Metzmacher [Thu, 13 Feb 2020 15:29:38 +0000 (16:29 +0100)]
python/tests/krb5: add raw_testcase.py as the base for our Kerberos protocol testing
Pair-Programmed-With: Isaac Boukris <iboukris@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Stefan Metzmacher [Thu, 13 Feb 2020 15:29:38 +0000 (16:29 +0100)]
python/tests/krb5: modify rfc4120.asn1 in order to generate pyasn1 code
The pyasn1 bindings are generated by pyasn1gen.py from
https://github.com/kimgr/asn1ate.git
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Stefan Metzmacher [Thu, 13 Feb 2020 15:29:38 +0000 (16:29 +0100)]
python/tests/krb5: add rfc4120.asn1
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Stefan Metzmacher [Mon, 23 Mar 2020 07:53:54 +0000 (08:53 +0100)]
python/tests/krb5: add support for Cksumtype.MD5
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Stefan Metzmacher [Wed, 25 Mar 2020 21:07:39 +0000 (22:07 +0100)]
s4:selftest: run samba.tests.krb5.kcrypto test
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Stefan Metzmacher [Fri, 20 Mar 2020 11:47:39 +0000 (12:47 +0100)]
python/tests/krb5: convert kcrypto.py to python3-cryptography and a few Samba helpers
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Isaac Boukris [Sat, 15 Feb 2020 17:33:33 +0000 (18:33 +0100)]
python/tests/krb5: add crypto.py from greghudson/pyk5 as kcrypto.py
This is crypto.py of commit
f0612aa908062fb239d1c3873595e7204ae1691d
from https://github.com/greghudson/pyk5.git
This will be used in order to do raw protocol testing against
[MS-KILE] KDCs.
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Isaac Boukris <iboukris@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Stefan Metzmacher [Tue, 24 Mar 2020 13:02:58 +0000 (14:02 +0100)]
python/tests: let usage.py be more verbose on errors
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Stefan Metzmacher [Tue, 24 Mar 2020 14:36:48 +0000 (15:36 +0100)]
bootstrap: add python3-pyasn1/python3-cryptography for kerberos testing
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Stefan Metzmacher [Wed, 25 Mar 2020 21:17:46 +0000 (22:17 +0100)]
bootstrap: add ubuntu2004 Ubuntu Focal Fossa (development branch)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
Stefan Metzmacher [Wed, 23 Jan 2019 23:23:34 +0000 (00:23 +0100)]
selftest: we no longer need '--use-dns-faking' on Linux and FreeBSD
For now I'll leave it arround for others I haven't tested.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Mar 27 10:39:32 UTC 2020 on sn-devel-184
Stefan Metzmacher [Wed, 23 Jan 2019 21:29:19 +0000 (22:29 +0100)]
selftest: use 10.53.57.0/8 instead of 127.0.0.1/8
This makes our testing much more realistic and allows
the removal of some knowfail entries.
It also means the testing with network namespaces on Linux
can use the same addresses as our socket wrapper testing.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Wed, 11 Mar 2020 16:03:01 +0000 (17:03 +0100)]
selftest: pass ipv4 and ipv6 listener addresses to dns_hub.py
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Wed, 11 Mar 2020 15:57:02 +0000 (16:57 +0100)]
selftest: let realm_to_ip_mappings() return stable (sorted) results
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Thu, 31 Oct 2019 14:39:53 +0000 (15:39 +0100)]
selftest: {offlinebackupdc,restoredc,customdc} are disconnected from other environments
These restore copies of others and better use their own resolv.conf
and use '--use-samba-tool --no-credentials' for samba_dnsupdate in order
to avoid talking to the real environments.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Thu, 27 Feb 2020 11:33:48 +0000 (12:33 +0100)]
selftest: correctly use RESOLV_CONF from the DC environment or "no_resolv.conf"
It's important to have the correct $resolv_conf variable within
provision(), because it also sets "RESOLV_WRAPPER_CONF" if needed,
instead of just setting "RESOLV_CONF".
There's also no point in creating an resolv.conf with the ip addresses
for other roles than "active directory domain controller".
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Wed, 30 Oct 2019 17:17:36 +0000 (18:17 +0100)]
selftest: always explicitly use RESOLV_CONF
By default point RESOLV_CONF to a non-existing file and
use the per environment RESOLV_CONF explicitly where needed.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Thu, 31 Oct 2019 14:37:40 +0000 (15:37 +0100)]
selftest: split out Samba::mk_resolv_conf() helper
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Thu, 27 Feb 2020 11:30:43 +0000 (12:30 +0100)]
selftest: we have a global $ENV{UID_WRAPPER} = 1, don't set it again
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Thu, 27 Feb 2020 10:21:51 +0000 (11:21 +0100)]
selftest: let get_env_for_process() include RESOLV_CONF
This is needed for all environments not just "samba".
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Thu, 27 Feb 2020 00:47:31 +0000 (01:47 +0100)]
selftest: handle proc{killdom,limit}.samba.example.com in dns_hub
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Wed, 11 Mar 2020 16:09:13 +0000 (17:09 +0100)]
selftest: allow dns_hub.py to do forwarding to ipv6 servers
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Wed, 11 Mar 2020 15:55:33 +0000 (16:55 +0100)]
selftest: allow dns_hub.py to listen on more than one address
This makes it possible to serve ipv4 and ipv6 at the same time.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Fri, 13 Mar 2020 06:06:05 +0000 (07:06 +0100)]
selftest: make sure dns_hub.py exits on SIGINT
Otherwise we have a deadlock in the python threading
that prevents out EOF detection on stdin to work
if someone aborts 'make test' with strg+c.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Tue, 5 Nov 2019 10:25:52 +0000 (11:25 +0100)]
samba_dnsupdate: fix delete (samba-tool) message
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Tue, 5 Nov 2019 10:25:14 +0000 (11:25 +0100)]
samba_dnsupdate: fix --no-credentials handling
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Tue, 5 Nov 2019 10:23:48 +0000 (11:23 +0100)]
python/netcmd/dns: improve exception handling in cmd_add_record()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Tue, 5 Nov 2019 10:23:48 +0000 (11:23 +0100)]
python/netcmd/dns: improve exception handling in cmd_delete_record()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Thu, 27 Feb 2020 00:51:18 +0000 (01:51 +0100)]
librpc/tests: make use of replace.h in test_ndr*.c
This fixes the build on FreeBSD 12.1 and maybe other systems.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Wed, 6 Nov 2019 07:49:30 +0000 (08:49 +0100)]
s4:torture/ldb: fix the build on FreeBSD
clock_t is 'int' instead' of 'long' there.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Stefan Metzmacher [Wed, 6 Nov 2019 07:47:31 +0000 (08:47 +0100)]
s3:util_sec: fix the build on non-linux platforms
This fixes a regression introduced by
"util_sec.c: Move __thread variable to global scope"
(
5a80f399b51221fb0b8661f30d940ca24e1ce627).
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Ralph Boehme [Thu, 26 Mar 2020 14:08:53 +0000 (15:08 +0100)]
smbd: use a helper variable in filename_convert_internal()
Avoids the complicated pointer-to-pointer dereferencing.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Mar 27 02:41:39 UTC 2020 on sn-devel-184
Ralph Boehme [Thu, 26 Mar 2020 13:49:33 +0000 (14:49 +0100)]
smbd: use filename_convert() in smb_file_rename_information()
Replaces direct calls to resolve_dfspath_wcard() and filename_convert(). On the
way to consolidate all callers of pathname processing onto filename_convert().
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Wed, 25 Mar 2020 18:00:32 +0000 (19:00 +0100)]
smbd: modernize DEBUG in unix_convert()
I'm also consolidating on level 10 instead of 5 for "debug" level messages, as
that what's tend to be the canonical debug level these days.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Wed, 25 Mar 2020 06:56:37 +0000 (07:56 +0100)]
smbd: turn (*orig_path != '/') assert into a normal if check
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Wed, 25 Mar 2020 06:53:29 +0000 (07:53 +0100)]
smbd: consolidate comments in unix_convert()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Wed, 25 Mar 2020 06:48:16 +0000 (07:48 +0100)]
smbd: modernize unix_convert() replacing True with true
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Wed, 25 Mar 2020 06:47:22 +0000 (07:47 +0100)]
smbd: modernize unix_convert() replacing False with false
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Wed, 25 Mar 2020 06:46:22 +0000 (07:46 +0100)]
smbd: initialize end to NULL in unix_convert()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Wed, 25 Mar 2020 06:45:43 +0000 (07:45 +0100)]
smbd: leave start at NULL, it's not used before being set to smbfname->basename
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 10:15:28 +0000 (11:15 +0100)]
tdbtorture: Use ARRAY_DEL_ELEMENT()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Mar 26 16:22:00 UTC 2020 on sn-devel-184
Volker Lendecke [Thu, 26 Mar 2020 10:12:55 +0000 (11:12 +0100)]
ldb: Use ARRAY_DEL_ELEMENT() in ldb_dn_set_extended_component()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 10:11:35 +0000 (11:11 +0100)]
ldb: Use ARRAY_DEL_ELEMENT() in ldb_dn_extended_filter()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 10:08:07 +0000 (11:08 +0100)]
ldb: Use ARRAY_DEL_ELEMENT() in ldb_kv_index_del_value()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 10:06:23 +0000 (11:06 +0100)]
ldb: Use ARRAY_DEL_ELEMENT() in ldb_kv_msg_delete_element()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 10:04:31 +0000 (11:04 +0100)]
libcli: Use ARRAY_DEL_ELEMENT() in security_descriptor_acl_del()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 10:02:02 +0000 (11:02 +0100)]
dsdb: Use ARRAY_DEL_ELEMENT() in dirsync_filter_entry()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 09:41:30 +0000 (10:41 +0100)]
vfs_fruit: Use ARRAY_DEL_ELEMENT() in del_fruit_stream()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 09:39:24 +0000 (10:39 +0100)]
vfs_fruit: Use ARRAY_DEL_ELEMENT() in filter_empty_rsrc_stream()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 09:36:19 +0000 (10:36 +0100)]
libsmb: Use ARRAY_DEL_ELEMENT() in remove_duplicate_addrs2()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 09:34:09 +0000 (10:34 +0100)]
smbd: Use ARRAY_DEL_ELEMENT() in merge_default_aces()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Volker Lendecke [Thu, 26 Mar 2020 09:31:47 +0000 (10:31 +0100)]
smbd: Use ARRAY_DEL_ELEMENT() in smbd_smb1_blocked_locks_cleanup()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>