<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/ctdb/common, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>ctdb-event: Fix the build on FreeBSD</title>
<updated>2026-03-18T11:20:37+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2026-03-13T04:53:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=68c6d09e6eb3840205a1db3b89d52af78f4456c9'/>
<id>68c6d09e6eb3840205a1db3b89d52af78f4456c9</id>
<content type='text'>
FreeBSD does not have ENODATA.  Sorry, I wasn't thinking about
portability when I made the changes that introduced the use of ENODATA
here.  :-(

Use ENOMSG instead, for lack of anything better, to indicate a script
slot containing no result.  ENOENT might seem more appropriate but it
is already involved in this code (where it is sometimes mapped to
ENOEXEC).  The choice of error number only needs to be consistent
within the event code.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Anoop C S &lt;anoopcs@samba.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
FreeBSD does not have ENODATA.  Sorry, I wasn't thinking about
portability when I made the changes that introduced the use of ENODATA
here.  :-(

Use ENOMSG instead, for lack of anything better, to indicate a script
slot containing no result.  ENOENT might seem more appropriate but it
is already involved in this code (where it is sometimes mapped to
ENOEXEC).  The choice of error number only needs to be consistent
within the event code.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Anoop C S &lt;anoopcs@samba.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-common: Remove unused function ctdb_set_helper()</title>
<updated>2026-02-25T12:33:39+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2025-11-08T10:33:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=c39f36335cf50fa8970521854657b0e6bda5e503'/>
<id>c39f36335cf50fa8970521854657b0e6bda5e503</id>
<content type='text'>
Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Anoop C S &lt;anoopcs@samba.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Anoop C S &lt;anoopcs@samba.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-common: Add path_helperdir() and path_helperdir_append()</title>
<updated>2026-02-25T12:33:39+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2025-10-27T04:47:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=83cd1a37853c11ef15886f71722bf537ca4bd641'/>
<id>83cd1a37853c11ef15886f71722bf537ca4bd641</id>
<content type='text'>
These can be used to locate helpers, either during in-tree
testing (using $CTDB_TEST_HELPER_BINDIR) or in their configured
installation location.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Anoop C S &lt;anoopcs@samba.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These can be used to locate helpers, either during in-tree
testing (using $CTDB_TEST_HELPER_BINDIR) or in their configured
installation location.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Anoop C S &lt;anoopcs@samba.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-common: Use if_nametoindex(3) to check if interface exists</title>
<updated>2026-02-09T11:17:41+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2026-01-12T07:05:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=d19ad0bec55dccfc1891c320a2fed41cc139927f'/>
<id>d19ad0bec55dccfc1891c320a2fed41cc139927f</id>
<content type='text'>
This is much simpler than looping through the array.  It will also
find an interface by altname, which could be very useful.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is much simpler than looping through the array.  It will also
find an interface by altname, which could be very useful.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-common: Align integer type</title>
<updated>2026-02-09T11:17:41+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2025-11-16T23:20:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=d2f93469d50916d355d718d48e83768af6997052'/>
<id>d2f93469d50916d355d718d48e83768af6997052</id>
<content type='text'>
[132/416] Compiling ctdb/common/run_event.c
../../common/run_event.c: In function ‘run_event_fail’:
../../common/run_event.c:806:50: warning: comparison of integer expressions of different signedness: ‘id_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
  806 |         if (script-&gt;summary == -ETIMEDOUT &amp;&amp; pid != -1) {
      |                                                  ^~

This is actually due to a typo in commit
20e9f203627752c4c1934e4bc0776e26c0dfb00e.  It should always have been
pid_t.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[132/416] Compiling ctdb/common/run_event.c
../../common/run_event.c: In function ‘run_event_fail’:
../../common/run_event.c:806:50: warning: comparison of integer expressions of different signedness: ‘id_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
  806 |         if (script-&gt;summary == -ETIMEDOUT &amp;&amp; pid != -1) {
      |                                                  ^~

This is actually due to a typo in commit
20e9f203627752c4c1934e4bc0776e26c0dfb00e.  It should always have been
pid_t.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-common: Make run_event return full script list</title>
<updated>2025-10-07T10:08:34+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2025-09-29T05:24:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=a05a2be09d71f49e06299dc79d36f5aa8dd8c212'/>
<id>a05a2be09d71f49e06299dc79d36f5aa8dd8c212</id>
<content type='text'>
run_event currently truncates the resulting script list after the
first failure.

Instead, return the full script list, with scripts that weren't run
flagged with ENODATA in their summary.  This structure is zeroed on
allocation, so this is the only field that needs to be set.

For now, have the event tool skip such scripts.  Do this in
print_status() instead of print_status_one(), since there will soon be
additional checks in print_status() and it makes sense to put them
together.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
run_event currently truncates the resulting script list after the
first failure.

Instead, return the full script list, with scripts that weren't run
flagged with ENODATA in their summary.  This structure is zeroed on
allocation, so this is the only field that needs to be set.

For now, have the event tool skip such scripts.  Do this in
print_status() instead of print_status_one(), since there will soon be
additional checks in print_status() and it makes sense to put them
together.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-common: Factor out new function run_event_fail()</title>
<updated>2025-10-07T10:08:34+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2025-09-29T04:58:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=20e9f203627752c4c1934e4bc0776e26c0dfb00e'/>
<id>20e9f203627752c4c1934e4bc0776e26c0dfb00e</id>
<content type='text'>
Mostly due to future indentation requirements.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mostly due to future indentation requirements.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Ralph Boehme &lt;slow@samba.org&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-common: Only respect CTDB_SOCKET in CTDB_TEST_MODE</title>
<updated>2025-09-25T09:02:06+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2025-08-15T05:01:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=7e2358fcf7be177d6e5de6e26f9d7c5af4acbb0c'/>
<id>7e2358fcf7be177d6e5de6e26f9d7c5af4acbb0c</id>
<content type='text'>
At the moment CTDB_SOCKET can be used outside of test mode even though
nobody should do this.  So, no longer allow this.

This means ensuring CTDB_TEST_MODE is set in the in the
"clusteredmember" selftest environment, so that CTDB_SOCKET is
respected there..

Details...

The associated use of chown(2) and chmod(2), used to secure the socket
in ctdb_daemon.c:ux_socket_bind(), potentially enables a symlink race
attack.  However, the chown(2) is currently not done in test mode, so
restricting the use of CTDB_SOCKET to test mode solves the potential
security issue.

Also, sprinkle warnings about use of CTDB_TEST_MODE in appropriate
places, just to attempt to limit unwanted behaviour.

An alternative could be to use the socket file descriptor with
fchown(2) and fchmod(2).  However, these system calls are not well
defined on sockets.  Still, this was previously done in CTDB's early
days (using the poorly documented method where they are allowed in
Linux (only?) before calling bind(2)).  It was removed (due to
portability issues, via commits
cf1056df94943ddcc3d547d4533b4bc04f57f265 and
2da3fe1b175a468fdff4aa4f65627facd2c28394) and replaced with the
current post-bind chown(2) and chmod(2).

I would like to remove the CTDB_SOCKET environment variable entirely,
since setting CTDB_TEST_MODE and CTDB_BASE covers all reasonable test
environments.  However, I have a feeling that people use it for
interactive testing, and that can still be done in CTDB_TEST_MODE.

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

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reported-by: *GUIAR OQBA * &lt;techokba@gmail.com&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;

Autobuild-User(master): Volker Lendecke &lt;vl@samba.org&gt;
Autobuild-Date(master): Thu Sep 25 09:02:06 UTC 2025 on atb-devel-224
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
At the moment CTDB_SOCKET can be used outside of test mode even though
nobody should do this.  So, no longer allow this.

This means ensuring CTDB_TEST_MODE is set in the in the
"clusteredmember" selftest environment, so that CTDB_SOCKET is
respected there..

Details...

The associated use of chown(2) and chmod(2), used to secure the socket
in ctdb_daemon.c:ux_socket_bind(), potentially enables a symlink race
attack.  However, the chown(2) is currently not done in test mode, so
restricting the use of CTDB_SOCKET to test mode solves the potential
security issue.

Also, sprinkle warnings about use of CTDB_TEST_MODE in appropriate
places, just to attempt to limit unwanted behaviour.

An alternative could be to use the socket file descriptor with
fchown(2) and fchmod(2).  However, these system calls are not well
defined on sockets.  Still, this was previously done in CTDB's early
days (using the poorly documented method where they are allowed in
Linux (only?) before calling bind(2)).  It was removed (due to
portability issues, via commits
cf1056df94943ddcc3d547d4533b4bc04f57f265 and
2da3fe1b175a468fdff4aa4f65627facd2c28394) and replaced with the
current post-bind chown(2) and chmod(2).

I would like to remove the CTDB_SOCKET environment variable entirely,
since setting CTDB_TEST_MODE and CTDB_BASE covers all reasonable test
environments.  However, I have a feeling that people use it for
interactive testing, and that can still be done in CTDB_TEST_MODE.

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

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reported-by: *GUIAR OQBA * &lt;techokba@gmail.com&gt;
Reviewed-by: Volker Lendecke &lt;vl@samba.org&gt;

Autobuild-User(master): Volker Lendecke &lt;vl@samba.org&gt;
Autobuild-Date(master): Thu Sep 25 09:02:06 UTC 2025 on atb-devel-224
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-common: Factor out checking of CTDB_TEST_MODE</title>
<updated>2025-09-25T07:57:42+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2025-08-15T04:59:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=4c12a36eb5b44fb08d0461e6fa77fcdb4a128433'/>
<id>4c12a36eb5b44fb08d0461e6fa77fcdb4a128433</id>
<content type='text'>
For use elsewhere.

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

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For use elsewhere.

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

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ctdb-common: Add tunable directory loading</title>
<updated>2025-07-22T23:02:34+00:00</updated>
<author>
<name>Martin Schwenke</name>
<email>mschwenke@ddn.com</email>
</author>
<published>2025-06-27T05:11:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=4f1e3844b432dc2b72e62bf17cb4dd36f28d6380'/>
<id>4f1e3844b432dc2b72e62bf17cb4dd36f28d6380</id>
<content type='text'>
This is simpler than include files and more general than just allowing
a 2nd file to be loaded.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is simpler than include files and more general than just allowing
a 2nd file to be loaded.

Signed-off-by: Martin Schwenke &lt;mschwenke@ddn.com&gt;
Reviewed-by: Amitay Isaacs &lt;amitay@gmail.com&gt;</pre>
</div>
</content>
</entry>
</feed>
