]> git.ipfire.org Git - thirdparty/samba.git/commit
ctdb-common: Map ENOENT for a missing event script to ENOEXEC
authorMartin Schwenke <mschwenke@ddn.com>
Wed, 20 Nov 2024 03:37:09 +0000 (14:37 +1100)
committerJule Anger <janger@samba.org>
Fri, 6 Dec 2024 15:19:41 +0000 (15:19 +0000)
commit622bcc55181d4a57266aa659c479ae2e494d6a93
tree75dd27789e2f50aa89b2f913d99a993b0258f79b
parent1531eb538830fbb005f5e4794eadd506d4af0077
ctdb-common: Map ENOENT for a missing event script to ENOEXEC

This handles the case where an event script is disabled by unlinking,
while an event is being run, after the script list has been created.
Without this change the script will fail.  With this change the script
will be marked as DISABLED.  See the comment added by this commit for
more details.

Add a testcase to simulate the race, using an event script to disable
subsequent ones.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15755
RN: Avoid event failure race when disabling an event script

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Nov 21 01:42:09 UTC 2024 on atb-devel-224

(cherry picked from commit fee31b6cb2b8f7dd111bdd9d2ff5479c31cbca37)

Autobuild-User(v4-20-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-20-test): Fri Dec  6 15:19:41 UTC 2024 on atb-devel-224
ctdb/common/run_event.c
ctdb/tests/UNIT/eventd/etc-ctdb/share/events/data/01.dummy.script
ctdb/tests/UNIT/eventd/eventd_009.sh