ddiss/samba-autobuild/.git
2 years agoctdb-recoverd: Drop calls to ctdb_ctrl_setrecmaster()
Martin Schwenke [Tue, 5 May 2020 13:26:41 +0000 (23:26 +1000)]
ctdb-recoverd: Drop calls to ctdb_ctrl_setrecmaster()

Nothing fetches this value anymore.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Drop recovery master verification
Martin Schwenke [Tue, 5 May 2020 13:25:34 +0000 (23:25 +1000)]
ctdb-recoverd: Drop recovery master verification

This doesn't make sense if leader broadcasts are used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tools: recovery master -> leader
Martin Schwenke [Mon, 10 Jan 2022 02:22:19 +0000 (13:22 +1100)]
ctdb-tools: recovery master -> leader

The following command names are changed:

  recmaster -> leader
  setrecmasterrole -> setleaderrole

Command output changed for the following commands:

  status
  getcapabilities

Documentation and tests are updated to reflect these changes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tools: Use leader broadcast in get_leader()
Martin Schwenke [Thu, 19 Mar 2020 06:14:10 +0000 (17:14 +1100)]
ctdb-tools: Use leader broadcast in get_leader()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tools: Factor out get_leader()
Martin Schwenke [Thu, 19 Mar 2020 06:30:24 +0000 (17:30 +1100)]
ctdb-tools: Factor out get_leader()

This seems pointless but it localises a subsequent change and also
starts a terminology change in the tool code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tools: Handle leader broadcasts in ctdb tool
Martin Schwenke [Mon, 4 May 2020 07:56:22 +0000 (17:56 +1000)]
ctdb-tools: Handle leader broadcasts in ctdb tool

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tools: Print "UNKNOWN" when leader PNN is unknown
Martin Schwenke [Wed, 18 Mar 2020 23:46:25 +0000 (10:46 +1100)]
ctdb-tools: Print "UNKNOWN" when leader PNN is unknown

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-client: Factor out function ctdb_client_wait_func_timeout()
Martin Schwenke [Mon, 4 May 2020 09:01:09 +0000 (19:01 +1000)]
ctdb-client: Factor out function ctdb_client_wait_func_timeout()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Factor out getting leader and waiting for leader change
Martin Schwenke [Fri, 14 Jan 2022 10:47:52 +0000 (21:47 +1100)]
ctdb-tests: Factor out getting leader and waiting for leader change

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Add leader broadcasts to fake_ctdbd
Martin Schwenke [Tue, 5 May 2020 13:02:03 +0000 (23:02 +1000)]
ctdb-tests: Add leader broadcasts to fake_ctdbd

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Implement srvid_handler for dispatching messages
Amitay Isaacs [Tue, 5 May 2020 06:53:39 +0000 (16:53 +1000)]
ctdb-tests: Implement srvid_handler for dispatching messages

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-recoverd: Simplify some stopped/banned checks to inactive checks
Martin Schwenke [Tue, 17 Mar 2020 06:10:20 +0000 (17:10 +1100)]
ctdb-recoverd: Simplify some stopped/banned checks to inactive checks

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: No longer take cluster lock during recovery
Martin Schwenke [Mon, 4 May 2020 07:45:51 +0000 (17:45 +1000)]
ctdb-recoverd: No longer take cluster lock during recovery

Confirm instead that it is already held.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Add and use function cluster_lock_enabled()
Martin Schwenke [Fri, 10 Dec 2021 00:43:10 +0000 (11:43 +1100)]
ctdb-recoverd: Add and use function cluster_lock_enabled()

Now all references to ctdb->recovery_lock are encapsulated in the
cluster lock code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Terminology change: recovery lock -> cluster lock
Martin Schwenke [Fri, 10 Dec 2021 00:29:06 +0000 (11:29 +1100)]
ctdb-recoverd: Terminology change: recovery lock -> cluster lock

No functional changes, just name changes for clarity.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Take cluster lock when election completes
Martin Schwenke [Thu, 20 Sep 2018 04:13:58 +0000 (14:13 +1000)]
ctdb-recoverd: Take cluster lock when election completes

It is no longer just a recovery lock but is always held by the cluster
leader.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Factor out function cluster_lock_take()
Martin Schwenke [Thu, 20 Sep 2018 02:30:58 +0000 (12:30 +1000)]
ctdb-recoverd: Factor out function cluster_lock_take()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Avoid a race
Martin Schwenke [Tue, 17 Mar 2020 06:58:02 +0000 (17:58 +1100)]
ctdb-tests: Avoid a race

See the comment in the code for details.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-tests: Setup cluster with expected arguments
Martin Schwenke [Tue, 7 Dec 2021 06:00:36 +0000 (17:00 +1100)]
ctdb-tests: Setup cluster with expected arguments

ctdb_test_init() doesn't actually pass arguments to local_daemons.sh.
This needs to be done using ctdb_nodes_start_custom().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Drop leader validation
Martin Schwenke [Fri, 17 Dec 2021 01:54:23 +0000 (12:54 +1100)]
ctdb-recoverd: Drop leader validation

The introduction of the leader broadcast timeout provides an
alternative to the current leader validation.  Using the leader
broadcast may not be as fast but it is more correct.

When the leader node is stopped or banned, the only way of triggering
an election is currently to fetch the leader's node map to check
whether the it is still active.  This is because the leader will no
longer push the node map to other nodes.  However, having all nodes
fetch the node map from an inactive leader may be unreliable.

Most of the other cases are also handled more reliably by the leader
broadcast timeout.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Drop special case for elected-before-connected
Martin Schwenke [Thu, 6 Jan 2022 03:47:45 +0000 (14:47 +1100)]
ctdb-recoverd: Drop special case for elected-before-connected

This no longer occurs at startup due to the leader broadcast timeout.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Handle leader broadcast timeout
Martin Schwenke [Fri, 17 Dec 2021 03:42:47 +0000 (14:42 +1100)]
ctdb-recoverd: Handle leader broadcast timeout

If no leader broadcasts have been received from the leader for more
than 5s then trigger an election.

Apart from being sane behaviour, this avoids elected-before-connected
bugs at startup, where a node elects itself leader before it is
connected to other nodes.

When a node processes a leader broadcast timeout it sends an unknown
leader broadcast to all nodes.  That causes cancellation of the leader
broadcast timeout across the cluster.  This is particular important at
startup, since nodes may be started in a staggered fashion.  Without
this cluster-wide cancellation, a node might notice the lack of
leader, win an election and complete a recovery before other nodes
notice the lack of leader.  When the leader broadcast timeout finally
occurs on the other nodes then they'll put the cluster back into an
unnecessary recovery.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Send leader broadcasts
Martin Schwenke [Mon, 16 Mar 2020 05:16:44 +0000 (16:16 +1100)]
ctdb-recoverd: Send leader broadcasts

These are triggered on 1 second timer, but are only sent if the node
is the current leader and there is no election underway.

If this node can not be the leader then ensure it releases the
recovery lock.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Process leader broadcasts
Martin Schwenke [Mon, 16 Mar 2020 05:07:26 +0000 (16:07 +1100)]
ctdb-recoverd: Process leader broadcasts

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-protocol: Add CTDB_SRVID_LEADER
Martin Schwenke [Mon, 16 Mar 2020 05:05:29 +0000 (16:05 +1100)]
ctdb-protocol: Add CTDB_SRVID_LEADER

CTDB_SRVID_LEADER will be regularly broadcast to all connected nodes
by the leader.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Add an explicit flag for election in progress
Martin Schwenke [Wed, 18 Mar 2020 09:27:10 +0000 (20:27 +1100)]
ctdb-recoverd: Add an explicit flag for election in progress

An alternate election method will be added that doesn't use the
election timeout, so this provides a common way for recognising when
an election is in progress.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Only start election if node can be leader
Martin Schwenke [Fri, 7 Jan 2022 00:27:06 +0000 (11:27 +1100)]
ctdb-recoverd: Only start election if node can be leader

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Add and use function this_node_can_be_leader()
Martin Schwenke [Mon, 13 Dec 2021 23:57:03 +0000 (10:57 +1100)]
ctdb-recoverd: Add and use function this_node_can_be_leader()

This makes the code self-documenting.

In ctdb_election_data() there is a slight behaviour change.  An
inactive node will now try to lose an election.  This case should not happen
because:

* An inactive node can't win an election round and then send a reply.

* Any inactive node should never start an election.  There are
  currently places where this happens and they will be fixed later.

There is an instance where this could be used in
validate_recovery_master() but this involves a more serious logic
change.  Overhaul this function later.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Logging/comments: recovery master -> leader
Martin Schwenke [Wed, 8 Dec 2021 00:07:25 +0000 (11:07 +1100)]
ctdb-recoverd: Logging/comments: recovery master -> leader

There are some remaining instances in this file but they will be
removed in subsequent commits.

Modernise debug macros as appropriate.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Rename recmaster field to leader
Martin Schwenke [Tue, 14 Jul 2020 05:22:33 +0000 (15:22 +1000)]
ctdb-recoverd: Rename recmaster field to leader

Recovery master is being renamed to leader.  This follows clustering
best practice (e.g. RAFT).

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Use rec->pnn everywhere
Martin Schwenke [Wed, 8 Dec 2021 09:25:46 +0000 (20:25 +1100)]
ctdb-recoverd: Use rec->pnn everywhere

This is currently referenced in a number of inconsistent
ways, including:

* pnn
* rec->ctdb->pnn
* ctdb->pnn
* ctdb_get_pnn(ctdb)
* ctdb_get_pnn(rec->ctdb)

The first of these always requires some thought about the context - is
this the node PNN or some other PNN (e.g. argument to function)?

rec->pnn is now always used when referring to the recovery daemon's
PNN.

Doing this also reduces reliance on struct ctdb_context internals.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Change argument to srvid_disable_and_reply()
Martin Schwenke [Wed, 8 Dec 2021 10:28:05 +0000 (21:28 +1100)]
ctdb-recoverd: Change argument to srvid_disable_and_reply()

Reduce dependency on struct ctdb_context internals, enable a
subsequent change.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Simplify arguments to ctdb_ban_node()
Martin Schwenke [Thu, 9 Dec 2021 23:31:56 +0000 (10:31 +1100)]
ctdb-recoverd: Simplify arguments to ctdb_ban_node()

ban_time argument is always ctdb->tunable.recovery_ban_period, so
build this in and make the calling code more readable.

ctdb_ban_node() already logs how long a node is banned for, so don't
repeatedly log this.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Simplify arguments to verify_local_ip_allocation()
Martin Schwenke [Sun, 12 Dec 2021 22:51:36 +0000 (09:51 +1100)]
ctdb-recoverd: Simplify arguments to verify_local_ip_allocation()

All other arguments are available via rec, so simplify.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Simplify arguments to do_recovery()
Martin Schwenke [Tue, 16 Jan 2018 05:20:05 +0000 (16:20 +1100)]
ctdb-recoverd: Simplify arguments to do_recovery()

pnn and nodemap are both available via the rec context, so simplify.
vnnmap is unused.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Simplify arguments to some election functions
Martin Schwenke [Wed, 8 Dec 2021 08:27:01 +0000 (19:27 +1100)]
ctdb-recoverd: Simplify arguments to some election functions

The pnn and nodemap arguments to force_election() and
send_election_request() are always effectively rec->pnn and
rec->nodemap, so simplify.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Add PNN to recovery daemon context
Martin Schwenke [Wed, 8 Dec 2021 23:33:17 +0000 (10:33 +1100)]
ctdb-recoverd: Add PNN to recovery daemon context

This is currently referenced in a number of inconsistent
ways, including:

* pnn
* rec->ctdb->pnn
* ctdb->pnn
* ctdb_get_pnn(ctdb)
* ctdb_get_pnn(rec->ctdb)

The first of these always requires some thought about the context - is
this the node PNN or some other PNN (e.g. argument to function)?

The intention is to always use rec->pnn when referring to the recovery
daemon's PNN.

Doing this also reduces reliance on struct ctdb_context internals.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Use this_node_is_leader() in an extra context
Martin Schwenke [Thu, 9 Dec 2021 00:47:54 +0000 (11:47 +1100)]
ctdb-recoverd: Use this_node_is_leader() in an extra context

This is arguably clearer.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Factor out and use function this_node_is_leader()
Martin Schwenke [Wed, 8 Dec 2021 08:37:39 +0000 (19:37 +1100)]
ctdb-recoverd: Factor out and use function this_node_is_leader()

Make the code self-documenting.

This preempts an upcoming change to terminology but doing it now saves
a lot of churn.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Pass SIGHUP to running helper
Martin Schwenke [Thu, 30 Sep 2021 11:16:44 +0000 (21:16 +1000)]
ctdb-recoverd: Pass SIGHUP to running helper

The recovery and takeover helpers can run for a while and generate
non-trivial logs, so have them reopen their logs to support log
rotation.

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): Mon Jan 17 04:36:30 UTC 2022 on sn-devel-184

2 years agoctdb-recoverd: Record helper PID in recovery daemon context
Martin Schwenke [Thu, 30 Sep 2021 11:15:56 +0000 (21:15 +1000)]
ctdb-recoverd: Record helper PID in recovery daemon context

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Add log reopening on SIGHUP to helpers
Martin Schwenke [Thu, 30 Sep 2021 11:14:14 +0000 (21:14 +1000)]
ctdb-recoverd: Add log reopening on SIGHUP to helpers

Recovery and takeover helpers can run for a while and generate
non-trivial logs.  They should support log reopening.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-daemon: Enable log reopening for event daemon
Martin Schwenke [Thu, 30 Sep 2021 11:10:33 +0000 (21:10 +1000)]
ctdb-daemon: Enable log reopening for event daemon

Add and call hook to pass on SIGHUP to eventd.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-event: Reopen logs on SIGHUP
Martin Schwenke [Thu, 30 Sep 2021 11:11:44 +0000 (21:11 +1000)]
ctdb-event: Reopen logs on SIGHUP

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-daemon: Enable log reopening for recovery daemon
Martin Schwenke [Thu, 30 Sep 2021 11:08:25 +0000 (21:08 +1000)]
ctdb-daemon: Enable log reopening for recovery daemon

Pass on a SIGHUP to the recovery daemon, which will then reopen its
logs.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-recoverd: Add basic log reopening
Martin Schwenke [Thu, 30 Sep 2021 11:03:15 +0000 (21:03 +1000)]
ctdb-recoverd: Add basic log reopening

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-daemon: Add basic top-level log reopening
Martin Schwenke [Thu, 30 Sep 2021 11:06:16 +0000 (21:06 +1000)]
ctdb-daemon: Add basic top-level log reopening

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-common: Add support for reopening logs
Martin Schwenke [Thu, 30 Sep 2021 10:55:27 +0000 (20:55 +1000)]
ctdb-common: Add support for reopening logs

Now that CTDB uses Samba's file logging it is possible to reopen the
logs, so that log rotation can be supported.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-common: Separate sock_daemon's SIGHUP and SIGUSR1 handling
Martin Schwenke [Thu, 18 Nov 2021 10:17:39 +0000 (21:17 +1100)]
ctdb-common: Separate sock_daemon's SIGHUP and SIGUSR1 handling

SIGHUP is for reopening logs, SIGUSR1 is for reconfigure.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-common: Use Samba's DEBUG_FILE logging
Martin Schwenke [Thu, 23 Sep 2021 08:37:57 +0000 (18:37 +1000)]
ctdb-common: Use Samba's DEBUG_FILE logging

This has support for log rotation (or re-opening).

The log format is updated to use an RFC5424 timestamp and to include a
hostname.  The addition of the hostname allows trivial merging of log
files from multiple cluster nodes.

The hostname is faked from the CTDB_BASE environment variable during
testing, as per the comment in the code.  It is currently faked in a
similar manner in local_daemons.sh when printing logs, so drop this.

Unit tests need updating because stderr logging no longer produces a
"PROGNAME[PID]: " header.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agoctdb-common: Switch initial debug type to DEBUG_DEFAULT_STDERR
Martin Schwenke [Fri, 24 Sep 2021 12:17:53 +0000 (22:17 +1000)]
ctdb-common: Switch initial debug type to DEBUG_DEFAULT_STDERR

This can be overridden by DEBUG_FILE, whereas DEBUG_STDERR can not.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 years agos3: smbd: Add missing pop_sec_ctx() in error code path of close_directory()
Jeremy Allison [Wed, 12 Jan 2022 18:42:48 +0000 (10:42 -0800)]
s3: smbd: Add missing pop_sec_ctx() in error code path of close_directory()

If delete_all_streams() fails.

Found by Andrew Walker <awalker@ixsystems.com>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan 14 03:34:47 UTC 2022 on sn-devel-184

2 years agoctdb-protocol: Print IPv6 sockets with RFC5952 "[2001:db8::1]:80" notation
Martin Schwenke [Thu, 30 Dec 2021 01:29:58 +0000 (12:29 +1100)]
ctdb-protocol: Print IPv6 sockets with RFC5952 "[2001:db8::1]:80" notation

RFC5952 says the existing style is not recommended and the [] style
should be employed.

There are more optimised ways of adding the square brackets but they
tend to be uglier.

Parsing IPv6 sockets without [] is now tested indirectly by parsing
examples in both styles and comparing the results.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Jan 13 17:02:21 UTC 2022 on sn-devel-184

2 years agoctdb-tests: Add extra IPv6 socket parsing tests
Martin Schwenke [Wed, 5 Jan 2022 01:09:45 +0000 (12:09 +1100)]
ctdb-tests: Add extra IPv6 socket parsing tests

Add tests to confirm that square brackets are handled and that
IPv4-mapped IPv6 addresses are parsed as expected.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2 years agoctdb-protocol: Allow rfc5952 "[2001:db8::1]:80" ipv6 notation
Volker Lendecke [Thu, 23 Dec 2021 10:52:38 +0000 (11:52 +0100)]
ctdb-protocol: Allow rfc5952 "[2001:db8::1]:80" ipv6 notation

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14934
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-protocol: Save 50 bytes .text segment
Volker Lendecke [Wed, 29 Dec 2021 13:46:14 +0000 (14:46 +0100)]
ctdb-protocol: Save 50 bytes .text segment

Having this as a small static .text is simpler than having to create
this on the stack.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agoctdb-protocol: rindex->strrchr
Volker Lendecke [Wed, 29 Dec 2021 14:10:28 +0000 (15:10 +0100)]
ctdb-protocol: rindex->strrchr

According to "man rindex" on debian bullseye rindex() was deprecated
in Posix.1-2001 and removed from Posix.1-2008.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2 years agodsdb/schema: let dsdb_syntax_DN_BINARY_drsuapi_to_ldb return WERR_DS_INVALID_ATTRIBUT...
Stefan Metzmacher [Mon, 20 Dec 2021 16:48:44 +0000 (17:48 +0100)]
dsdb/schema: let dsdb_syntax_DN_BINARY_drsuapi_to_ldb return WERR_DS_INVALID_ATTRIBUTE_SYNTAX

When Object(OR-Name) uses dsdb_syntax_DN_BINARY_drsuapi_to_ldb() it
should genrate WERR_DS_INVALID_ATTRIBUTE_SYNTAX if the binary part
is not empty.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jan 12 03:09:52 UTC 2022 on sn-devel-184

2 years agodsdb/schema: add no memory checks for {ldb,dsdb}_dn_get_extended_linearized()
Stefan Metzmacher [Mon, 20 Dec 2021 16:46:47 +0000 (17:46 +0100)]
dsdb/schema: add no memory checks for {ldb,dsdb}_dn_get_extended_linearized()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agodsdb/common: dsdb_dn_construct_internal() more strict checking
Stefan Metzmacher [Sat, 5 Jun 2021 21:12:50 +0000 (23:12 +0200)]
dsdb/common: dsdb_dn_construct_internal() more strict checking

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agodsdb/schema: fix Object(OR-Name) syntax definition
Stefan Metzmacher [Mon, 20 Dec 2021 16:50:07 +0000 (17:50 +0100)]
dsdb/schema: fix Object(OR-Name) syntax definition

This is a strange one, it uses DN_BINARY in the drsuapi
representation, while the binary part must be 0 bytes.
and the LDAP/ldb representation is a plain DN (without 'B:').

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agodsdb/schema/tests: let samba4.local.dsdb.syntax call the validate_dn() hook
Stefan Metzmacher [Sat, 5 Jun 2021 21:12:20 +0000 (23:12 +0200)]
dsdb/schema/tests: let samba4.local.dsdb.syntax call the validate_dn() hook

This demonstrates that our OR-Name syntax is wrong,
which wasn't noticed yet as it's not used in the AD-Schema.

I noticed it by installing the Exchange-Schema on a Samba DC.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos4:rpc_server/netlogon: let CSDVersion="" wipe operatingSystemServicePack
Stefan Metzmacher [Tue, 21 Dec 2021 13:00:34 +0000 (14:00 +0100)]
s4:rpc_server/netlogon: let CSDVersion="" wipe operatingSystemServicePack

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan 11 22:03:03 UTC 2022 on sn-devel-184

2 years agos4:torture/rpc: test how CSDVersion="" wipes operatingSystemServicePack
Stefan Metzmacher [Tue, 21 Dec 2021 12:58:07 +0000 (13:58 +0100)]
s4:torture/rpc: test how CSDVersion="" wipes operatingSystemServicePack

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agolib: util: Make nt_time_to_full_timespec() call nt_time_to_unix_timespec_raw() for...
Jeremy Allison [Fri, 7 Jan 2022 19:27:16 +0000 (11:27 -0800)]
lib: util: Make nt_time_to_full_timespec() call nt_time_to_unix_timespec_raw() for the conversion.

Cleanup to eliminate duplicate code.

The high check is now done against ret.tv_sec,
not 'd', as after calling nt_time_to_unix_timespec_raw()
this is identical to the previous intermediate 'd'
variable.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan 11 01:36:51 UTC 2022 on sn-devel-184

2 years agolib: util: Make nt_time_to_unix_timespec() call nt_time_to_unix_timespec_raw() for...
Jeremy Allison [Fri, 7 Jan 2022 19:22:03 +0000 (11:22 -0800)]
lib: util: Make nt_time_to_unix_timespec() call nt_time_to_unix_timespec_raw() for the conversion.

Cleanup to eliminate duplicate code.

The low/high checks are now done against ret.tv_sec,
not 'd', as after calling nt_time_to_unix_timespec_raw()
this is identical to the previous intermediate 'd'
variable.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 years agos3:modules: Fix possible dereference of NULL for fio
Pavel Filipenský [Mon, 10 Jan 2022 12:26:25 +0000 (13:26 +0100)]
s3:modules: Fix possible dereference of NULL for fio

We do not check consistently for fio being NULL in this file.

Found by covescan.

Pair-Programmed-With: Andreas Schneider <asn@samba.org>

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan 11 00:22:09 UTC 2022 on sn-devel-184

2 years agos3:libnet: Fix dereference of NULL win7
Pavel Filipenský [Mon, 10 Jan 2022 12:24:22 +0000 (13:24 +0100)]
s3:libnet: Fix dereference of NULL win7

Found by covscan.

Pair-Programmed-With: Andreas Schneider <asn@samba.org>

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:libnet: Fix dead code in libnet_join.c
Pavel Filipenský [Fri, 7 Jan 2022 13:11:53 +0000 (14:11 +0100)]
s3:libnet: Fix dead code in libnet_join.c

Found by covscan.

Pair-programmed-with: Andreas Schneider <asn@samba.org>

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agoctdb:utils: Improve error handling of hex_decode()
Pavel Filipenský [Fri, 7 Jan 2022 10:57:08 +0000 (11:57 +0100)]
ctdb:utils: Improve error handling of hex_decode()

This has been found by covscan and make analyzers happy.

Pair-programmed-with: Andreas Schneider <asn@samba.org>

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:rpc_server: Fix possible NULL dereference
Pavel Filipenský [Fri, 7 Jan 2022 10:50:16 +0000 (11:50 +0100)]
s3:rpc_server: Fix possible NULL dereference

Found by covscan.

Pair-Programmed-With: Andreas Schneider <asn@samba.org>

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:smbd: Fix dereferencing null pointer "fsp"
Pavel Filipenský [Fri, 7 Jan 2022 20:18:59 +0000 (21:18 +0100)]
s3:smbd: Fix dereferencing null pointer "fsp"

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

Remove fsp which is always NULL and replace it with smb_fname->fsp.

Found by covscan.

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:smbd: Fix trailing whitespaces in dosmode.c
Pavel Filipenský [Fri, 7 Jan 2022 20:18:59 +0000 (21:18 +0100)]
s3:smbd: Fix trailing whitespaces in dosmode.c

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:modules: Fix the horrible vfs_crossrename module
Pavel Filipenský [Fri, 7 Jan 2022 12:16:26 +0000 (13:16 +0100)]
s3:modules: Fix the horrible vfs_crossrename module

It really has to be removed! ;-)

Found by covscan. The code always leaves here as the dst variable

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

Pair-programmed-with: Andreas Schneider <asn@samba.org>

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3:modules: VFS CAP symlinkat always fails
Pavel Filipenský [Fri, 7 Jan 2022 12:55:38 +0000 (13:55 +0100)]
s3:modules: VFS CAP symlinkat always fails

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

Found by covscan.

Since capnew is initialized by NULL, checking it too early makes the
rest of the function a dead code.

Pair-programmed-with: Andreas Schneider <asn@samba.org>

Signed-off-by: Pavel Filipenský <pfilipen@redhat.com>
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agos3: includes: Make the comments describing itime consistent. Always use "invented...
Jones Syue [Mon, 10 Jan 2022 17:29:44 +0000 (09:29 -0800)]
s3: includes: Make the comments describing itime consistent. Always use "invented" time.

It gets confusing if we call it "imaginary" or "instantiation"
in different places.

Signed-off-by: Jones Syue <jonessyue@qnap.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Jan 10 18:42:02 UTC 2022 on sn-devel-184

2 years agos3: lib: In create_clock_itime(), use timespec_current() -> clock_gettime(CLOCK_REALT...
Jeremy Allison [Mon, 10 Jan 2022 17:01:09 +0000 (09:01 -0800)]
s3: lib: In create_clock_itime(), use timespec_current() -> clock_gettime(CLOCK_REALTIME..).

CLOCK_MONOTONIC (which we previously used) is reset
when the system is rebooted.

CLOCK_REALTIME is a "wall clock" time. It's still affected by NTP
changes (for Linux we should probably use CLOCK_TAI instead
but that is Linux-specific). For most systems CLOCK_REALTIME
will be good enough.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 years agorpcclient: Fix ncacn_ip_tcp:<ip-address>
Volker Lendecke [Sun, 9 Jan 2022 12:38:37 +0000 (13:38 +0100)]
rpcclient: Fix ncacn_ip_tcp:<ip-address>

inet_pton expects "struct in_addr" or "struct in6_addr" as destination
pointer. It does not fill in a struct
sockaddr_storage. interpret_string_addr() takes care of this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Jan 10 11:47:34 UTC 2022 on sn-devel-184

2 years agotest: Test rpcclient ncacn_ip_tcp:<ip-address>
Volker Lendecke [Sun, 9 Jan 2022 12:39:12 +0000 (13:39 +0100)]
test: Test rpcclient ncacn_ip_tcp:<ip-address>

Right now connecting to an IP address is broken.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2 years agos3: smbd: Create and use a common function for generating a fileid - create_clock_iti...
Jeremy Allison [Wed, 5 Jan 2022 19:40:46 +0000 (11:40 -0800)]
s3: smbd: Create and use a common function for generating a fileid - create_clock_itime().

This first gets the clock_gettime_mono() value, converts to an NTTIME (as
this is what is stored in the dos attribute EA), then mixes in 8 bits of
randomness shifted up by 55 bits to cope with poor resolution clocks to
avoid duplicate inodes.

Using 8 bits of randomness on top of an NTTIME gives us around 114
years headroom. We can now guarentee returning a itime-based
fileid in a normal share (storing dos attributes in an EA).

Remove knownfail.d/fileid-unique

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jan  8 06:35:22 UTC 2022 on sn-devel-184

2 years agolib: util: Add a function nt_time_to_unix_timespec_raw().
Jeremy Allison [Thu, 6 Jan 2022 21:58:20 +0000 (13:58 -0800)]
lib: util: Add a function nt_time_to_unix_timespec_raw().

Not yet used. Does no checks on the converted values.

A later cleanup will allow us to move nt_time_to_unix_timespec()
and nt_time_to_full_timespec() to use common code.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 years agotests: Add 2 tests for unique fileid's with top bit set (generated from itime) for...
Jeremy Allison [Thu, 6 Jan 2022 23:11:20 +0000 (15:11 -0800)]
tests: Add 2 tests for unique fileid's with top bit set (generated from itime) for files and directories.

smb2.fileid_unique.fileid_unique
smb2.fileid_unique.fileid_unique-dir

Create 100 files or directories as fast as we can
against a "normal" share, then read info on them
and ensure (a) top bit is set (generated from itime)
and (b) uniqueness across all generated objects
(checks poor timestamp resolution doesn't create
duplicate fileids).

This shows that even on ext4, this is enough to
cause duplicate fileids to be returned.

Add knownfail.d/fileid-unique

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 years agos3: smbd: Remove now redundent lock_flav parameter from smbd_do_unlocking().
Jeremy Allison [Wed, 17 Nov 2021 01:04:02 +0000 (17:04 -0800)]
s3: smbd: Remove now redundent lock_flav parameter from smbd_do_unlocking().

We already stored this in struct smbd_lock_element.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Thu Jan  6 16:03:28 UTC 2022 on sn-devel-184

2 years agos3: smbd: Remove lock_flav argument from smbd_smb1_brl_finish_by_lock().
Jeremy Allison [Wed, 17 Nov 2021 00:56:02 +0000 (16:56 -0800)]
s3: smbd: Remove lock_flav argument from smbd_smb1_brl_finish_by_lock().

We lookup the lock array from the state stored in the passed-in req
and all the locks in an array are always the same flavour, so this
isn't needed.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2 years agos3: smbd: Remove lock_flav argument from internal function smbd_smb1_do_locks_check()
Jeremy Allison [Wed, 17 Nov 2021 00:48:58 +0000 (16:48 -0800)]
s3: smbd: Remove lock_flav argument from internal function smbd_smb1_do_locks_check()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2 years agos3: smbd: Remove lock_flav argument from smbd_smb1_do_locks_send().
Jeremy Allison [Wed, 17 Nov 2021 00:41:09 +0000 (16:41 -0800)]
s3: smbd: Remove lock_flav argument from smbd_smb1_do_locks_send().

And also inside struct smbd_smb1_do_locks_state.
All calls to this always (a) have one or more locks of the same type.
(the setup for smbd_smb1_do_locks_send() ensures there is always
at least one lock) and (b) always set locks[0].lock_flav correctly before calling.

lock_flav is thus a redundent argument. Removing it means
we can never drift out of sync with the lock_flav element
in the passed in locks array.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2 years agos3: smbd: In smbd_smb1_do_locks_send() move access of lock_flav until after we know...
Jeremy Allison [Wed, 17 Nov 2021 00:15:54 +0000 (16:15 -0800)]
s3: smbd: In smbd_smb1_do_locks_send() move access of lock_flav until after we know we have locks in the array.

When we remove the lock_flav parameter this will need to look into the array itself.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2 years agos3: smbd: Remove lock_flav parameter from smbd_do_locks_try().
Jeremy Allison [Tue, 16 Nov 2021 23:06:59 +0000 (15:06 -0800)]
s3: smbd: Remove lock_flav parameter from smbd_do_locks_try().

This is now contained in the struct smbd_lock_element for
each lock.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2 years agos3: smbd: Move implicit call to lp_posix_cifsu_locktype() out of init_strict_lock_str...
Jeremy Allison [Tue, 16 Nov 2021 23:00:03 +0000 (15:00 -0800)]
s3: smbd: Move implicit call to lp_posix_cifsu_locktype() out of init_strict_lock_struct().

Make it explicit. When we add POSIX handles to SMB2 we will only
look at the handle type. lp_posix_cifsu_locktype() already does this,
but hidden inside init_strict_lock_struct() makes it hard to see.

No logic change.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2 years agos3: smbd: Add "enum brl_flavour" to struct smbd_lock_element.
Jeremy Allison [Tue, 16 Nov 2021 22:26:44 +0000 (14:26 -0800)]
s3: smbd: Add "enum brl_flavour" to struct smbd_lock_element.

Initialized correctly but not yet used.
Will allow 'brl_flavour' to be removed from lock calls.
This will allow SMB2 POSIX handles to call with POSIX_LOCK
flavour instead of always using WINDOWS_LOCK (as now).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2 years agos3: smbclient: In do_host_query(), if we need SMB1, ensure we select NT1 as the clien...
Jeremy Allison [Tue, 4 Jan 2022 00:52:25 +0000 (16:52 -0800)]
s3: smbclient: In do_host_query(), if we need SMB1, ensure we select NT1 as the client max protocol" before continuing.

Remove knownfail: selftest/knownfail.d/list_servers

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Thu Jan  6 11:50:32 UTC 2022 on sn-devel-184

2 years agos3: selftest: Add two tests that show we try and send an SMB1 request over an SMB2...
Jeremy Allison [Tue, 4 Jan 2022 00:48:17 +0000 (16:48 -0800)]
s3: selftest: Add two tests that show we try and send an SMB1 request over an SMB2 connection to list servers if "-mSMB3" is selected.

Add knownfail: knownfail.d/list_servers

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
2 years agolib: Fix a typo
Volker Lendecke [Thu, 23 Dec 2021 12:24:27 +0000 (13:24 +0100)]
lib: Fix a typo

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): Wed Jan  5 01:02:38 UTC 2022 on sn-devel-184

2 years agovfs: Modernize a DEBUG statement
Volker Lendecke [Tue, 21 Dec 2021 11:54:56 +0000 (12:54 +0100)]
vfs: Modernize a DEBUG statement

Fix the function name printed

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agosmbd: Modernize a DEBUG statement
Volker Lendecke [Sun, 19 Dec 2021 10:02:46 +0000 (11:02 +0100)]
smbd: Modernize a DEBUG statement

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agorpc_server3: Inline single-use rpcint_binding_handle_ex()
Volker Lendecke [Thu, 7 Oct 2021 12:52:47 +0000 (14:52 +0200)]
rpc_server3: Inline single-use rpcint_binding_handle_ex()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agorpc_server3: Inline pipes_struct into dcerpc_ncacn_conn
Volker Lendecke [Wed, 6 Oct 2021 10:20:17 +0000 (12:20 +0200)]
rpc_server3: Inline pipes_struct into dcerpc_ncacn_conn

This makes it clear that our internal representation of a rpc client
connection in the source3/ server is struct dcerpc_ncacn_conn and that
struct pipes_struct is only around for API compatibility with the
existing server stubs.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agorpc_server3: Remove dcerpc_ncacn_conn->session_info
Volker Lendecke [Wed, 6 Oct 2021 09:16:21 +0000 (11:16 +0200)]
rpc_server3: Remove dcerpc_ncacn_conn->session_info

This was only used inside rpc_worker_new_client(), a leftover from
times where accepting a client was an async process waiting for the
struct named_pipe_auth_req_info4.

The talloc hierarchy is correctly maintained, dcesrv_endpoint_connect() takes a
talloc_reference() of session_info.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agorpc_server3: Remove dcerpc_ncacn_conn->local_server_addr
Volker Lendecke [Wed, 6 Oct 2021 09:16:21 +0000 (11:16 +0200)]
rpc_server3: Remove dcerpc_ncacn_conn->local_server_addr

This was only used inside rpc_worker_new_client(), a leftover from
times where accepting a client was an async process waiting for the
struct named_pipe_auth_req_info4.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 years agorpc_server3: Remove dcerpc_ncacn_conn->remote_client_addr
Volker Lendecke [Wed, 6 Oct 2021 09:16:21 +0000 (11:16 +0200)]
rpc_server3: Remove dcerpc_ncacn_conn->remote_client_addr

This was only used inside rpc_worker_new_client(), a leftover from
times where accepting a client was an async process waiting for the
struct named_pipe_auth_req_info4.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>