summaryrefslogtreecommitdiff
path: root/ctdb/common/run_event.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2017-10-12 14:42:59 +1100
committerMartin Schwenke <martins@samba.org>2017-10-18 06:20:18 +0200
commit7720ca0729b127a93d78401aaf1341d79f9603a4 (patch)
tree9ef99c60accf17e739ef08bfc183d2953166e62c /ctdb/common/run_event.c
parentf6d6af3b2d5efcd160c1e5e09778fb1129530be0 (diff)
downloadsamba-7720ca0729b127a93d78401aaf1341d79f9603a4.tar.gz
ctdb-common: Ignore event scripts with multiple '.'s
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13070 This avoids running event script copies left by a package manager. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/common/run_event.c')
-rw-r--r--ctdb/common/run_event.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ctdb/common/run_event.c b/ctdb/common/run_event.c
index e5d562c96b3..0961d657a74 100644
--- a/ctdb/common/run_event.c
+++ b/ctdb/common/run_event.c
@@ -60,6 +60,12 @@ static int script_filter(const struct dirent *de)
return 0;
}
+ /* Ignore filenames with multiple '.'s */
+ ptr = index(&de->d_name[3], '.');
+ if (ptr != NULL) {
+ return 0;
+ }
+
return 1;
}