The Samba-Bugzilla – Attachment 13708 Details for
Bug 13070
Avoid running RPM/DPKG-suffixed event scripts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patches for v4-6
BZ13070-v4-6.patch (text/plain), 1.72 KB, created by
Amitay Isaacs
on 2017-10-20 04:21:56 UTC
(
hide
)
Description:
Patches for v4-6
Filename:
MIME Type:
Creator:
Amitay Isaacs
Created:
2017-10-20 04:21:56 UTC
Size:
1.72 KB
patch
obsolete
>From f3b2e56d173cde3cdd158a8233c717cf21f4ef77 Mon Sep 17 00:00:00 2001 >From: Amitay Isaacs <amitay@gmail.com> >Date: Thu, 12 Oct 2017 14:42:59 +1100 >Subject: [PATCH] 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> >(cherry picked from commit 7720ca0729b127a93d78401aaf1341d79f9603a4) >--- > ctdb/config/events.d/README | 4 +++- > ctdb/server/ctdb_eventd.c | 6 ++++++ > 2 files changed, 9 insertions(+), 1 deletion(-) > >diff --git a/ctdb/config/events.d/README b/ctdb/config/events.d/README >index 11da7028be9..69f5904c3c2 100644 >--- a/ctdb/config/events.d/README >+++ b/ctdb/config/events.d/README >@@ -11,7 +11,9 @@ alphanumeric sort order. > > As a special case, any eventscript that ends with a '~' character will be > ignored since this is a common postfix that some editors will append to >-older versions of a file. >+older versions of a file. Similarly, any eventscript with multiple '.'s >+will be ignored as package managers can create copies with additional >+suffix starting with '.' (e.g. .rpmnew, .dpkg-dist). > > Only executable event scripts are run by CTDB. Any event script that > does not have execute permission is ignored. >diff --git a/ctdb/server/ctdb_eventd.c b/ctdb/server/ctdb_eventd.c >index 232711ce4e2..c9a9bf6fa0e 100644 >--- a/ctdb/server/ctdb_eventd.c >+++ b/ctdb/server/ctdb_eventd.c >@@ -425,6 +425,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; > } > >-- >2.13.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
martins
:
review+
Actions:
View
Attachments on
bug 13070
:
13707
| 13708