UNEXPECTED(failure): samba3.raw.oplock.batch26(nt4_dc)
REASON: Exception: Exception: (../../source4/torture/raw/oplock.c:3718): wrong value for break_info.count got 0x2 - should be 0x1
You can reproduce it with two small msleeps, which means it's a race
condition:
15a8af075a2 introduced a bug where we immediately wake up ourselves
after doing a watch_send, leading to two inter-smbd oplock break
messages for this case. In theory, this should not matter, as in the
oplock break handler in the destination smbd we check
(fsp->sent_oplock_break != NO_BREAK_SENT)
so that the break does not get sent twice. However, with the above two
sleeps the oplock holding client could send out its oplock downgrade
while the second inter-smbd break messages was on its way.
The real fix would be to note in the share mode array that the
inter-smbd message has already been sent, but as other users of
dbwrap_watched_watch_send might also be affected by this bug, this fix
should be sufficient to get rid of this flaky test.
Unfortunately, dbwrap_watch.c is now pretty complex and needs some
serious refactoring to become understandable again. But that's
something for another day, sorry.
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
dbwrap_watch: Move reallocating watchers to dbwrap_watched_watch_send()
Before 15a8af075a2 we did not have a separately allocated watchers
array and dbwrap_watched_save() could play (too) smart tricks with
dbwrap_record_storev(). Now that we always have watchers talloc'ed, we
can remove those smart tricks from dbwrap_watched_save() in the next
commit.
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Ralph Boehme [Thu, 26 Sep 2019 17:31:51 +0000 (10:31 -0700)]
s3:smbd: use is_named_stream() in a a few places
This simplifies (and corrects) things in the VFS as there the caller is only
interested in whether a name is pointing to a real named stream most of the times.
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Ralph Boehme [Mon, 23 Sep 2019 22:16:58 +0000 (15:16 -0700)]
s3:smbd: when storing DOS attribute call dos_mode() beforehand
This is required to ensure File-ID info is populated with the correct on-disk
value, before calling file_set_dosmode() which will update the on-disk value.
Ralph Boehme [Mon, 23 Sep 2019 22:15:31 +0000 (15:15 -0700)]
s3:smbd: change the place where we call dos_mode() when processing SMB2_CREATE
This is needed for ordinary file or directory opens so the QFID create context
response gets the correct File-ID value via dos_mode() from the DOS attributes
xattr.
Noel Power [Fri, 27 Sep 2019 07:07:24 +0000 (08:07 +0100)]
s3: passdb: ret doesn't seem to be needed at all
I was looking at the wrong hunk when examining this, ret seems redundant
and the existing status can cover things
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 1 00:28:44 UTC 2019 on sn-devel-184
Noel Power [Thu, 15 Aug 2019 13:50:33 +0000 (14:50 +0100)]
s3/libsmb: clang: Fix 'Value stored during its initialization is never read'
Fixes:
source3/libsmb/cliconnect.c:1877:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_NO_MEMORY;
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
This functionality was undone as part of "winbind: Restructure get_pwsid"
https://git.samba.org/?p=samba.git;a=commitdiff;h=bce19a6efe11980933531f0349c8f5212419366a
I think that this semantic change was accidential.
This patch undoes the semantic change and re-establishes the
functionality.
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Fri Sep 27 17:25:29 UTC 2019 on sn-devel-184
ID_TYPE_BOTH means that each user and group has two mappings, a uid and
gid. In addition the calls to getpwent, getpwuid, getgrent and getgrgid
always return some information, so that uid and gid can be mapped to a
name. Establish a test to verify that the expected information is
returned.
Noel Power [Thu, 15 Aug 2019 13:30:29 +0000 (14:30 +0100)]
s3/libsmb: clang: Fix 'warning: Value stored to 'p' is never read'
Fixes:
source3/libsmb/cliconnect.c:649:2: warning: Value stored to 'p' is never read <--[clang]
p += ret;
^ ~~~
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 26 19:59:24 UTC 2019 on sn-devel-184
Noel Power [Thu, 5 Sep 2019 14:42:41 +0000 (14:42 +0000)]
s3/passdb: clang: Value stored to 'c' is never read
source3/passdb/pdb_smbpasswd.c:405:4: warning: Value stored to 'c' is never read <--[clang]
c = '\0';
^ ~~~~
/home/samba/samba/source3/passdb/pdb_smbpasswd.c:809:4: warning: Value stored to 'c' is never read <--[clang]
c = '\0';
^ ~~~~
2 warnings generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Tue, 17 Sep 2019 14:43:20 +0000 (14:43 +0000)]
s3/lib/netapi: clang: Fix 'Value stored during initialization is never read'
Fixes:
source3/lib/netapi/user.c:1290:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
source3/lib/netapi/user.c:1610:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
source3/lib/netapi/user.c:2990:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
source3/lib/netapi/user.c:3184:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
source3/lib/netapi/user.c:3522:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Tue, 17 Sep 2019 14:20:03 +0000 (14:20 +0000)]
s3/rpc_client: clang: Fix 'Value stored during initialization is never read'
Fixes:
source3/rpc_client/cli_winreg.c:728:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
/source3/rpc_client/cli_winreg.c:897:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~ Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Tue, 17 Sep 2019 08:13:00 +0000 (08:13 +0000)]
lib/talloc: clang: Fix 'Value stored during its initialization is never read'
Fixes:
ib/talloc/pytalloc_util.c:245:8: warning: Value stored to 'type_obj' during its initialization is never read <--[clang]
void *type_obj = talloc_check_name(ptr, type_name);
^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Tue, 17 Sep 2019 08:05:28 +0000 (08:05 +0000)]
s3/libads: clang: Fix 'Value stored during its initialization is never read'
Fixes:
source3/libads/ldap.c:370:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
source3/libads/ldap.c:417:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
source3/libads/ldap.c:1783:13: warning: Value stored to 'ret' during its initialization is never read <--[clang]
ADS_STATUS ret = ADS_ERROR(LDAP_SUCCESS);
^~~ ~~~~~~~~~~~~~~~~~~~~~~~
source3/libads/ldap.c:1862:13: warning: Value stored to 'ret' during its initialization is never read <--[clang]
ADS_STATUS ret = ADS_ERROR(LDAP_SUCCESS);
^~~ ~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Mon, 16 Sep 2019 10:43:54 +0000 (10:43 +0000)]
s3/lib/netapi: clang: Fix 'Value stored during initialization is never read'
Fixes:
source3/lib/netapi/getdc.c:173:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Mon, 16 Sep 2019 10:35:49 +0000 (10:35 +0000)]
s3/lib/netapi: clang: Fix 'Value stored during initialization is never read'
Fixes:
source3/lib/netapi/group.c:1383:11: warning: Value stored to '
status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
samba/source3/lib/netapi/group.c:1521:11: warning: Value stored to '
status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
samba/source3/lib/netapi/group.c:1718:11: warning: Value stored to '
status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
3 warnings generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Fri, 13 Sep 2019 13:57:16 +0000 (13:57 +0000)]
s3/auth: clang: Fix 'Value stored during its initialization is never read'
Fixes:
source3/auth/auth.c:38:35: warning: Value stored to 'entry' during its initialization is never read <--[clang]
struct auth_init_function_entry *entry = auth_backends;
^~~~~ ~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Fri, 13 Sep 2019 13:54:11 +0000 (13:54 +0000)]
s3/auth: clang: Fix 'Value stored during its initialization is never read'
Fixes:
source3/auth/auth_util.c:283:11: warning: Value stored to 'ret' during its initialization is never read <--[clang]
NTSTATUS ret = NT_STATUS_UNSUCCESSFUL;
^~~ ~~~~~~~~~~~~~~~~~~~~~~
source3/auth/auth_util.c:2005:11: warning: Value stored to 'nt_status' during its initialization is never read <--[clang]
NTSTATUS nt_status = NT_STATUS_OK;
^~~~~~~~~ ~~~~~~~~~~~~
2 warnings generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Fri, 6 Sep 2019 14:59:51 +0000 (14:59 +0000)]
s3/libsmb: clang: Fix 'Value stored during its initialization is never read'
Fixes:
source3/libsmb/dsgetdcname.c:1012:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source3/libsmb/dsgetdcname.c:1099:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Fri, 6 Sep 2019 14:50:37 +0000 (14:50 +0000)]
s3/libads: clang: Fix 'Value stored during initialization is never read'
Fixes:
source3/libads/ldap_utils.c:52:13: warning: Value stored to 'status' during its initialization is never read <--[clang]
ADS_STATUS status = ADS_SUCCESS;
^~~~~~ ~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Fri, 6 Sep 2019 13:00:05 +0000 (13:00 +0000)]
s3/libads: clang: Fix 'Value stored to 'nt_status' is never read'
Fixes:
source3/libads/sasl.c:219:2: warning: Value stored to 'nt_status' is never read <--[clang]
nt_status = NT_STATUS_MORE_PROCESSING_REQUIRED;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Thu, 5 Sep 2019 15:40:50 +0000 (15:40 +0000)]
s3/passed: clang: Fix 'Value stored during its initialization is never read'
Fixes:
source3/passdb/passdb.c:2502:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_INTERNAL_ERROR;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Thu, 5 Sep 2019 14:48:47 +0000 (14:48 +0000)]
s3/rpc_client: clang: 'Value stored during its initialization is never read'
Fixes:
source3/rpc_client/util_netlogon.c:71:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
source3/rpc_client/util_netlogon.c:199:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Thu, 5 Sep 2019 14:22:02 +0000 (14:22 +0000)]
s3/rpc_client: clang: Fix 'Value stored during initialization is never read'
Fixes:
source3/rpc_client/cli_lsarpc.c:182:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Thu, 5 Sep 2019 13:40:16 +0000 (13:40 +0000)]
s3/passdb: clang: Fix 'Value stored during its initialization is never read'
Fixes:
source3/passdb/lookup_sid.c:836:11: warning: Value stored to 'result' during its initialization is never read <--[clang]
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Thu, 5 Sep 2019 13:36:22 +0000 (13:36 +0000)]
s3/passdb: clang: Fix 'Value stored during initialization is never read'
Fixes:
source3/passdb/pdb_interface.c:65:34: warning: Value stored to 'entry' during its initialization is never read <--[clang]
struct pdb_init_function_entry *entry = backends;
^~~~~ ~~~~~~~~
/source3/passdb/pdb_interface.c:140:11: warning: Value stored to 'nt_status' during its initialization is never read <--[clang]
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
^~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Thu, 5 Sep 2019 13:34:05 +0000 (13:34 +0000)]
s3/passdb: clang: Fix 'Value stored during initialization is never read'
Fixes:
source3/passdb/pdb_tdb.c:718:18: warning: Value stored to 'nt_status' during its initialization is never read <--[clang]
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
^~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Thu, 15 Aug 2019 15:25:27 +0000 (16:25 +0100)]
s3/passdb: clang: Fix 'Value stored during its initialization is never read'
Fixes:
source3/passdb/pdb_util.c:41:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Thu, 15 Aug 2019 14:57:26 +0000 (15:57 +0100)]
s4/winbind: clang: Fixes 'Value stored during its initialization is never read'
Fixes:
source4/winbind/idmap.c:214:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_NONE_MAPPED;
source4/winbind/idmap.c:397:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_NONE_MAPPED;
^~~~~~ ~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Thu, 15 Aug 2019 14:32:13 +0000 (15:32 +0100)]
s3/rpc_client: clang: Fix 'Value stored during initialization is never read'
Fixes:
source3/rpc_client/cli_pipe.c:397:11: warning: Value stored to 'ret' during its initialization is never read <--[clang]
NTSTATUS ret = NT_STATUS_OK;
^~~ ~~~~~~~~~~~~
source3/rpc_client/cli_pipe.c:1234:11: warning: Value stored to 'ret' during its initialization is never read <--[clang]
NTSTATUS ret = NT_STATUS_OK;
^~~ ~~~~~~~~~~~~
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Thu, 15 Aug 2019 14:29:03 +0000 (15:29 +0100)]
s3/groupdb: clang: 'Value stored during its initialization is never read'
Fixes:
source3/groupdb/mapping_tdb.c:460:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Noel Power [Thu, 15 Aug 2019 13:16:52 +0000 (14:16 +0100)]
s3/groupdb: clang: Fix 'Value stored during its initialization is never read'
Fixes:
ource3/groupdb/mapping.c:648:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
NTSTATUS status = NT_STATUS_OK;
^~~~~~ ~~~~~~~~~~~~
1 warning generated.
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Jeremy Allison [Wed, 18 Sep 2019 17:04:03 +0000 (10:04 -0700)]
s3: VFS: Complete the replacement of SMB_VFS_UNLINK() -> SMB_VFS_UNLINKAT().
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): Thu Sep 26 18:40:53 UTC 2019 on sn-devel-184