ctdb-common: Map ENOENT for a missing event script to ENOEXECmaster
commitfee31b6cb2b8f7dd111bdd9d2ff5479c31cbca37
authorMartin Schwenke <mschwenke@ddn.com>
Wed, 20 Nov 2024 03:37:09 +0000 (20 14:37 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 21 Nov 2024 01:42:09 +0000 (21 01:42 +0000)
treee791a36bcf3bd0d0afe5450e5733dea433869494
parentd9b02758d2e7f5f5bd4515071ba275062b0d7215
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

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
ctdb/common/run_event.c
ctdb/tests/UNIT/eventd/etc-ctdb/share/events/data/01.dummy.script
ctdb/tests/UNIT/eventd/eventd_009.sh