samba.git
4 years agolib/replace: Remove libaio support
Volker Lendecke [Fri, 4 Oct 2019 08:40:18 +0000 (10:40 +0200)]
lib/replace: Remove libaio support

io_uring is the way to go these days, libaio was never really useful
for Samba

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct  4 18:18:41 UTC 2019 on sn-devel-184

4 years agontvfs: Remove pvfs_aio.c
Volker Lendecke [Fri, 4 Oct 2019 08:36:30 +0000 (10:36 +0200)]
ntvfs: Remove pvfs_aio.c

This uses the Linux libaio that does not meet Samba's needs. If
someone wanted to add async I/O to ntvfs, the io_uring API is the way
to go. Second option would be to use a pthreads-based API.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agoctdb-tests: Rename functions to test_header() and test_footer()
Martin Schwenke [Thu, 3 Oct 2019 07:25:10 +0000 (17:25 +1000)]
ctdb-tests: Rename functions to test_header() and test_footer()

That's all they do now.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Oct  4 10:58:10 UTC 2019 on sn-devel-184

4 years agoctdb-tests: Move test duration calculation to ctdb_test_run()
Martin Schwenke [Tue, 10 Sep 2019 00:51:31 +0000 (10:51 +1000)]
ctdb-tests: Move test duration calculation to ctdb_test_run()

It makes sense to do this in one place in case other headers/footers
are added.

Reindent ctdb_test_begin() while touching this function.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Add handling for skipped tests
Martin Schwenke [Wed, 18 Sep 2019 02:36:05 +0000 (12:36 +1000)]
ctdb-tests: Add handling for skipped tests

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Add a special failure code when a test error occurs
Martin Schwenke [Wed, 18 Sep 2019 02:31:10 +0000 (12:31 +1000)]
ctdb-tests: Add a special failure code when a test error occurs

Use it when a test is not executable.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Move test status interpretation to ctdb_test_run()
Martin Schwenke [Mon, 9 Sep 2019 10:57:42 +0000 (20:57 +1000)]
ctdb-tests: Move test status interpretation to ctdb_test_run()

It makes sense to do this in one place in case other headers/footers
are added.

Simplify ctdb_test_end() accordingly, reindenting because nearly all
lines are modified.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Move use of show_progress() into ctdb_test_run()
Martin Schwenke [Wed, 18 Sep 2019 02:25:06 +0000 (12:25 +1000)]
ctdb-tests: Move use of show_progress() into ctdb_test_run()

This allows more variables to be set in this function because they are
no longer in a sub-shell.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Simplify ctdb_test_run()
Martin Schwenke [Mon, 9 Sep 2019 10:51:51 +0000 (20:51 +1000)]
ctdb-tests: Simplify ctdb_test_run()

Only the test file name is ever passed.

Reindent while touching many existing lines.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Switch TEST_CLEANUP and TEST_TIMEOUT to script variables
Martin Schwenke [Mon, 9 Sep 2019 06:08:41 +0000 (16:08 +1000)]
ctdb-tests: Switch TEST_CLEANUP and TEST_TIMEOUT to script variables

These are not used outside this script so they do not need to be
environment variables.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Add new test functions for running commands on nodes
Martin Schwenke [Mon, 12 Aug 2019 11:01:20 +0000 (21:01 +1000)]
ctdb-tests: Add new test functions for running commands on nodes

* ctdb_onnode()
* testprog_onnode()
* function_onnode()

These encapsulate familiar patterns found when running
try_command_on_node().  The new function names are more concise and
encourage more readable tests.  Test writers can do less thinking
about the subtleties of running different types of commands on nodes.
For example, these functions ensure that $CTDB and $VALGRIND are used
in the correct contexts.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: try_command_on_node() should return status of command
Martin Schwenke [Tue, 13 Aug 2019 11:43:32 +0000 (21:43 +1000)]
ctdb-tests: try_command_on_node() should return status of command

There is no point folding this down to 1.  Tests should be able to see
the original value, if required.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Drop unused function ctdb_test_check_real_cluster()
Martin Schwenke [Thu, 12 Sep 2019 02:21:13 +0000 (12:21 +1000)]
ctdb-tests: Drop unused function ctdb_test_check_real_cluster()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Update preamble for CLUSTER tests
Martin Schwenke [Wed, 11 Sep 2019 06:07:49 +0000 (16:07 +1000)]
ctdb-tests: Update preamble for CLUSTER tests

The main change is to source cluster.bash instead of integration.bash.

While touching the preamble, the following additional changes are also
made:

* Drop test_info() definition and replace it with a comment

  The use of test_info() is pointless.

* Drop call to ctdb_test_check_real_cluster()

  cluster.bash now does this.

* Drop call to cluster_is_healthy()

  This is a holdover from when the previous test would restart daemons
  to get things ready for a test.  There was also a bug where going
  into recovery during the restart would sometimes cause the cluster
  to become unhealthy.  If we really need something like this then we
  can add it to ctdb_test_init().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Add cluster.bash include file
Martin Schwenke [Wed, 11 Sep 2019 05:44:20 +0000 (15:44 +1000)]
ctdb-tests: Add cluster.bash include file

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Add function ctdb_test_skip_on_cluster()
Martin Schwenke [Wed, 18 Sep 2019 01:43:53 +0000 (11:43 +1000)]
ctdb-tests: Add function ctdb_test_skip_on_cluster()

Use it in relevant tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Add function ctdb_test_on_cluster()
Martin Schwenke [Wed, 2 Oct 2019 05:08:18 +0000 (15:08 +1000)]
ctdb-tests: Add function ctdb_test_on_cluster()

This centralises this logic.  Use it in a subset of tests - there are
other cases but these will be cleaned up soon.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-tests: Add functions for terminating tests on failure, skip, error
Martin Schwenke [Tue, 17 Sep 2019 06:00:13 +0000 (16:00 +1000)]
ctdb-tests: Add functions for terminating tests on failure, skip, error

This allows standard exit codes for failed and skipped tests, and test
errors.

Skipped tests currently just succeed and a test error is the same as a
failure.  These can be easily changed later when run_tests.sh is ready
to handle them.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-common: Mark VacuumLimit tunable as obsolete
Martin Schwenke [Wed, 2 Oct 2019 07:52:31 +0000 (17:52 +1000)]
ctdb-common: Mark VacuumLimit tunable as obsolete

Use of this tunable was dropped over 5 years ago in commit
16837bc309aa9a86fc21d7f59a8fce0b947428a3.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Oct  4 07:07:21 UTC 2019 on sn-devel-184

4 years agoctdb-vacuum: Drop debug level of repacking message to NOTICE
Martin Schwenke [Wed, 2 Oct 2019 07:51:12 +0000 (17:51 +1000)]
ctdb-vacuum: Drop debug level of repacking message to NOTICE

This occurs rarely but can adversely impact performance, so it is
worth logging it more frequently.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-protocol: Initialise request->rdata.opcode where missing
Martin Schwenke [Mon, 23 Sep 2019 06:11:00 +0000 (16:11 +1000)]
ctdb-protocol: Initialise request->rdata.opcode where missing

Otherwise it is uninitialised, so...

==22889== Conditional jump or move depends on uninitialised value(s)
==22889==    at 0x12257B: ctdb_req_control_data_len (protocol_control.c:39)
==22889==    by 0x1228E9: ctdb_req_control_len (protocol_control.c:1786)
==22889==    by 0x12A51C: ctdb_client_control_send (client_control.c:101)
==22889==    by 0x138BE1: ctdb_tunnel_setup_send (client_tunnel.c:100)
==22889==    by 0x10EE4F: tunnel_test_send (tunnel_test.c:135)
==22889==    by 0x10EE4F: main (tunnel_test.c:463)

and similar.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
4 years agoctdb-vacuum: Process all records not deleted on a remote node
Amitay Isaacs [Mon, 30 Sep 2019 06:34:35 +0000 (16:34 +1000)]
ctdb-vacuum: Process all records not deleted on a remote node

This currently skips the last record.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14147
RN: Avoid potential data loss during recovery after vacuuming error

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
4 years agorpcclient: Remove unused global domain sid
Volker Lendecke [Sat, 28 Sep 2019 02:24:18 +0000 (19:24 -0700)]
rpcclient: Remove unused global domain sid

For the auth_log tests using rpcclient this means one message less

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct  3 17:59:13 UTC 2019 on sn-devel-184

4 years agorpcclient: Remove domain sid check
Volker Lendecke [Sat, 28 Sep 2019 02:22:55 +0000 (19:22 -0700)]
rpcclient: Remove domain sid check

The samr calls can take care of this on their own

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpcclient: Make cmd_samr.c independent of global domain_sid
Volker Lendecke [Sat, 28 Sep 2019 02:20:17 +0000 (19:20 -0700)]
rpcclient: Make cmd_samr.c independent of global domain_sid

Pure SAMR allows us to figure out the domain sid, we don't need LSA
for this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpcclient: Fix a comment
Volker Lendecke [Sat, 28 Sep 2019 02:19:47 +0000 (19:19 -0700)]
rpcclient: Fix a comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpcclient: Move rpccli_try_samr_connects() to cmd_samr.c
Volker Lendecke [Sat, 28 Sep 2019 01:49:33 +0000 (18:49 -0700)]
rpcclient: Move rpccli_try_samr_connects() to cmd_samr.c

That's the only user, make it static to cmd_samr.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpcclient: Remove rpcclient_cli_state
Volker Lendecke [Sat, 28 Sep 2019 00:32:31 +0000 (17:32 -0700)]
rpcclient: Remove rpcclient_cli_state

An unneeded global

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agorpclient: Remove cmd_test
Volker Lendecke [Sat, 28 Sep 2019 00:25:55 +0000 (17:25 -0700)]
rpclient: Remove cmd_test

I can't even properly find why this went in. It's the only user of the
global rpcclient_cli_state, which can go if we remove this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: smbd: Fix the SMB2 server to pass SMB2-PATH-SLASH.
Jeremy Allison [Thu, 26 Sep 2019 19:37:15 +0000 (12:37 -0700)]
s3: smbd: Fix the SMB2 server to pass SMB2-PATH-SLASH.

[MS-FSA] 2.1.5.1 Server Requests an Open of a File

Windows pathname specific processing.

Always disallow trailing /, and also \\ on FILE_NON_DIRECTORY_FILE.

We need to check this before the generic pathname parser
as the generic pathname parser removes any trailing '/' and '\\'.

Currently this is SMB2 only, but we could also add this
check to the SMB1 NTCreateX calls if ultimately neded.

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): Wed Oct  2 09:31:40 UTC 2019 on sn-devel-184

4 years agos3: torture: Add MS-FSA style terminating '/' and '\\' test - SMB2-PATH-SLASH.
Jeremy Allison [Thu, 26 Sep 2019 19:36:18 +0000 (12:36 -0700)]
s3: torture: Add MS-FSA style terminating '/' and '\\' test - SMB2-PATH-SLASH.

[MS-FSA] 2.1.5.1 Server Requests an Open of a File.

Checks how to behave on both files and directories.

Tested against Windows 10 server - passes. Currently smbd fails this.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agodbwrap_watch: Don't alert ourselves, fix raw.oplock.batch26 race
Volker Lendecke [Mon, 30 Sep 2019 09:39:11 +0000 (11:39 +0200)]
dbwrap_watch: Don't alert ourselves, fix raw.oplock.batch26 race

This fixes the following flaky test:

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:

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 20b5a3e294c..126c7fc021d 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1917,6 +1917,14 @@ NTSTATUS send_break_message(struct messaging_context *msg_ctx,
  DATA_BLOB blob;
  NTSTATUS status;

+ {
+ static bool sent = false;
+ if (sent) {
+ smb_msleep(500);
+ }
+ sent = true;
+ }
+
  if (DEBUGLVL(10)) {
  struct server_id_buf buf;
  DBG_DEBUG("Sending break message to %s\n",
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index b3da84b1269..d9c4dbb9487 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -858,6 +858,8 @@ static void process_oplock_break_message(struct messaging_context *msg_ctx,
  uint16_t break_to;
  bool break_needed = true;

+ smb_msleep(100);
+
  msg = talloc(talloc_tos(), struct oplock_break_message);
  if (msg == NULL) {
  DBG_WARNING("talloc failed\n");

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>
4 years agodbwrap_watch: Remove "addwatch" handling from dbwrap_watched_save()
Volker Lendecke [Mon, 30 Sep 2019 09:32:26 +0000 (11:32 +0200)]
dbwrap_watch: Remove "addwatch" handling from dbwrap_watched_save()

This has been moved to dbwrap_watched_watch_send()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agodbwrap_watch: Move reallocating watchers to dbwrap_watched_watch_send()
Volker Lendecke [Mon, 30 Sep 2019 09:25:59 +0000 (11:25 +0200)]
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>
4 years agodbwrap_watch: Slightly simplify dbwrap_watched_fetch_locked()
Volker Lendecke [Mon, 30 Sep 2019 05:48:34 +0000 (07:48 +0200)]
dbwrap_watch: Slightly simplify dbwrap_watched_fetch_locked()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agoepmapper: Fix printf specifiers
Volker Lendecke [Sat, 28 Sep 2019 00:20:26 +0000 (17:20 -0700)]
epmapper: Fix printf specifiers

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agotorture: Fix a comment
Volker Lendecke [Tue, 24 Sep 2019 18:53:31 +0000 (11:53 -0700)]
torture: Fix a comment

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolib: Fix a typo
Volker Lendecke [Tue, 24 Sep 2019 17:51:38 +0000 (10:51 -0700)]
lib: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agorpc_client: Don't pass a NULL string to talloc_asprintf
Volker Lendecke [Tue, 24 Sep 2019 17:29:07 +0000 (10:29 -0700)]
rpc_client: Don't pass a NULL string to talloc_asprintf

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agosmbd: Fix CID 1453984: Null pointer dereferences (REVERSE_INULL)
Volker Lendecke [Tue, 24 Sep 2019 16:51:08 +0000 (09:51 -0700)]
smbd: Fix CID 1453984: Null pointer dereferences (REVERSE_INULL)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolib: Fix CID 1453985: Null pointer dereferences (FORWARD_NULL)
Volker Lendecke [Tue, 24 Sep 2019 16:24:54 +0000 (09:24 -0700)]
lib: Fix CID 1453985: Null pointer dereferences (FORWARD_NULL)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agolib: Remove some unneeded #includes from tftw.c
Volker Lendecke [Tue, 24 Sep 2019 14:30:15 +0000 (07:30 -0700)]
lib: Remove some unneeded #includes from tftw.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3:smbd: use is_named_stream() in a a few places
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>
4 years agovfs_default: use is_named_stream() for stream check
Ralph Boehme [Thu, 26 Sep 2019 19:19:31 +0000 (12:19 -0700)]
vfs_default: use is_named_stream() for stream check

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:smbd: add a comment explaining the File-ID semantics when a file is created
Ralph Boehme [Thu, 26 Sep 2019 17:41:37 +0000 (10:41 -0700)]
s3:smbd: add a comment explaining the File-ID semantics when a file is created

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:smbd: ensure a created stream picks up the File-ID from the basefile
Ralph Boehme [Tue, 24 Sep 2019 19:49:38 +0000 (12:49 -0700)]
s3:smbd: ensure a created stream picks up the File-ID from the basefile

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:lib: add is_named_stream()
Ralph Boehme [Thu, 26 Sep 2019 17:05:40 +0000 (10:05 -0700)]
s3:lib: add is_named_stream()

Add a new utility functions that checks whether a struct smb_filename points to
a real named stream, excluding the default stream "::$DATA".

  foo           -> false
  foo::$DATA    -> false
  foo:bar       -> true
  foo:bar:$DATA -> true

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:lib: use strequal_m() in is_ntfs_default_stream_smb_fname()
Ralph Boehme [Wed, 25 Sep 2019 18:29:04 +0000 (11:29 -0700)]
s3:lib: use strequal_m() in is_ntfs_default_stream_smb_fname()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:lib: implement logic directly in is_ntfs_default_stream_smb_fname()
Ralph Boehme [Wed, 25 Sep 2019 18:19:26 +0000 (11:19 -0700)]
s3:lib: implement logic directly in is_ntfs_default_stream_smb_fname()

This allows changing the semantics of is_ntfs_stream_smb_fname() in the next
commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:lib: expand a comment with the function doc for is_ntfs_stream_smb_fname
Ralph Boehme [Thu, 26 Sep 2019 17:38:06 +0000 (10:38 -0700)]
s3:lib: expand a comment with the function doc for is_ntfs_stream_smb_fname

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:lib: factor out stream name asserts to helper function
Ralph Boehme [Wed, 25 Sep 2019 17:18:03 +0000 (10:18 -0700)]
s3:lib: factor out stream name asserts to helper function

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:lib: assert stream_name is NULL for POSIX paths
Ralph Boehme [Wed, 25 Sep 2019 17:15:27 +0000 (10:15 -0700)]
s3:lib: assert stream_name is NULL for POSIX paths

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:lib: rework a return expression into an if block
Ralph Boehme [Wed, 25 Sep 2019 15:53:29 +0000 (08:53 -0700)]
s3:lib: rework a return expression into an if block

Needed to add additional stuff after the if block in the next commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:smbd: when storing DOS attribute call dos_mode() beforehand
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.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3:smbd: change the place where we call dos_mode() when processing SMB2_CREATE
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.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agotorture:smb2: add a File-ID test on directories
Ralph Boehme [Tue, 24 Sep 2019 20:09:03 +0000 (13:09 -0700)]
torture:smb2: add a File-ID test on directories

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agotorture:smb2: extend test for File-IDs
Ralph Boehme [Mon, 23 Sep 2019 22:15:01 +0000 (15:15 -0700)]
torture:smb2: extend test for File-IDs

This now hopefully covers most possible combinations of creating and opening
files plus, checking the file's File-ID after every operation.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: passdb: ret doesn't seem to be needed at all
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

4 years agos3/libsmb: clang: Fix 'Value stored during its initialization is never read'
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>
4 years agowinbind: provide passwd struct for group sid with ID_TYPE_BOTH mapping (again)
Michael Adam [Fri, 11 Jan 2019 09:44:30 +0000 (10:44 +0100)]
winbind: provide passwd struct for group sid with ID_TYPE_BOTH mapping (again)

https://git.samba.org/?p=samba.git;a=commitdiff;h=394622ef8c916cf361f8596dba4664dc8d6bfc9e
originally introduced the above feature.

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.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14141

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

4 years agoselftest: Test ID_TYPE_BOTH with idmap_rid module
Christof Schmitt [Thu, 26 Sep 2019 00:19:27 +0000 (17:19 -0700)]
selftest: Test ID_TYPE_BOTH with idmap_rid module

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.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14141

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
4 years agos3/libsmb: clang: Fix 'warning: Value stored to 'p' is never read'
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

4 years agos3/passdb: clang: Value stored to 'c' is never read
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>
4 years agos3/libsmb: clang: value stored to 'idx_current' is never read
Noel Power [Thu, 5 Sep 2019 14:16:57 +0000 (14:16 +0000)]
s3/libsmb: clang: value stored to 'idx_current' is never read

Fixes:

source3/libsmb/trusts_util.c:602:2: warning: Value stored to 'idx_current' is never read <--[clang]
        idx_current = idx;
        ^             ~~~

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/passdb: clang: Fix warning: Value stored to 'acct_ctrl' is never read
Noel Power [Fri, 6 Sep 2019 13:46:40 +0000 (13:46 +0000)]
s3/passdb: clang: Fix warning: Value stored to 'acct_ctrl' is never read

Fixes:

source3/passdb/pdb_ldap.c:922:3: warning: Value stored to 'acct_ctrl' is never read <--[clang]
                acct_ctrl |= ACB_NORMAL;
                ^            ~~~~~~~~~~

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3/lib/netapi: clang: Fix 'Value stored during initialization is never read'
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>
4 years agos3/rpc_client: clang: Fix 'Value stored during initialization is never read'
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>
4 years agolib/talloc: clang: Fix 'Value stored during its initialization is never read'
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>
4 years agos3/libads: clang: Fix 'Value stored during its initialization is never read'
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>
4 years agos3/lib/netapi: clang: Fix 'Value stored during initialization is never read'
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>
4 years agos3/lib/netapi: clang: Fix 'Value stored during initialization is never read'
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>
4 years agos3/auth: clang: Fix 'Value stored during its initialization is never read'
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>
4 years agos3/auth: clang: Fix 'Value stored during its initialization is never read'
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>
4 years agos3/libsmb: clang: Fix 'Value stored during its initialization is never read'
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>
4 years agos3/libads: clang: Fix 'Value stored during initialization is never read'
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>
4 years agos3/libads: clang: Fix 'Value stored to 'nt_status' is never read'
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>
4 years agos3/passed: clang: Fix 'Value stored during its initialization is never read'
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>
4 years agos3/rpc_client: clang: 'Value stored during its initialization is never read'
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>
4 years agos3/rpc_client: clang: Fix 'Value stored during initialization is never read'
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>
4 years agos3/passdb: clang: Fix 'Value stored during its initialization is never read'
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>
4 years agos3/passdb: clang: Fix 'Value stored during initialization is never read'
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>
4 years agos3/passdb: clang: Fix 'Value stored during initialization is never read'
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>
4 years agos3/passdb: clang: Fix 'Value stored during its initialization is never read'
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>
4 years agos4/winbind: clang: Fixes 'Value stored during its initialization is never read'
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>
4 years agos3/rpc_client: clang: Fix 'Value stored during initialization is never read'
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>
4 years agos3/groupdb: clang: 'Value stored during its initialization is never read'
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>
4 years agos3/groupdb: clang: Fix 'Value stored during its initialization is never read'
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>
4 years agos4-torture: remove duplicate NDR_PRINT
Günther Deschner [Wed, 25 Sep 2019 04:53:34 +0000 (06:53 +0200)]
s4-torture: remove duplicate NDR_PRINT

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos4-torture: dump ndr packet in ndr tests with high log level
Günther Deschner [Tue, 30 Aug 2016 17:37:18 +0000 (19:37 +0200)]
s4-torture: dump ndr packet in ndr tests with high log level

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agolibrpc/ndr: add ndr_print_netlogon_samlogon_response()
Günther Deschner [Tue, 24 Sep 2019 21:10:50 +0000 (23:10 +0200)]
librpc/ndr: add ndr_print_netlogon_samlogon_response()

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
4 years agos3: VFS: Complete the replacement of SMB_VFS_UNLINK() -> SMB_VFS_UNLINKAT().
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

4 years agos3: VFS: vfs_full_audit: Remove unlink_fn. No longer used.
Jeremy Allison [Wed, 18 Sep 2019 16:23:04 +0000 (09:23 -0700)]
s3: VFS: vfs_full_audit: Remove unlink_fn. No longer used.

NB, this will now fail smb_vfs_assert_all_fns()
until we remove the unlink_fn() from the VFS definitions.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_acl_tdb: Remove unlink_fn. No longer used.
Jeremy Allison [Wed, 18 Sep 2019 17:02:16 +0000 (10:02 -0700)]
s3: VFS: vfs_acl_tdb: Remove unlink_fn. No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_acl_xattr: Remove unlink_fn. No longer used.
Jeremy Allison [Wed, 18 Sep 2019 17:01:32 +0000 (10:01 -0700)]
s3: VFS: vfs_acl_xattr: Remove unlink_fn. No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_posix_eadb: Remove unlink_fn. No longer used.
Jeremy Allison [Wed, 18 Sep 2019 17:00:43 +0000 (10:00 -0700)]
s3: VFS: vfs_posix_eadb: Remove unlink_fn. No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_ceph: Remove unlink_fn. No longer used.
Jeremy Allison [Wed, 18 Sep 2019 16:59:54 +0000 (09:59 -0700)]
s3: VFS: vfs_ceph: Remove unlink_fn. No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_glusterfs: Remove unlink_fn. No longer used.
Jeremy Allison [Wed, 18 Sep 2019 16:59:03 +0000 (09:59 -0700)]
s3: VFS: vfs_glusterfs: Remove unlink_fn. No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_streams_depot: Remove unlink_fn. No longer used.
Jeremy Allison [Wed, 18 Sep 2019 16:57:59 +0000 (09:57 -0700)]
s3: VFS: vfs_streams_depot: Remove unlink_fn. No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_syncops: Remove unlink_fn. No longer used.
Jeremy Allison [Wed, 18 Sep 2019 16:56:53 +0000 (09:56 -0700)]
s3: VFS: vfs_syncops: Remove unlink_fn. No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
4 years agos3: VFS: vfs_fruit: Remove unlink_fn. No longer used.
Jeremy Allison [Wed, 18 Sep 2019 16:54:10 +0000 (09:54 -0700)]
s3: VFS: vfs_fruit: Remove unlink_fn. No longer used.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>