summaryrefslogtreecommitdiff
path: root/sql/wsrep_sst.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2021-02-23 00:56:14 +0100
committerSergei Golubchik <serg@mariadb.org>2021-02-23 09:25:57 +0100
commite841957416e9287d1e9b2e32c952d6d0c1a2e2ed (patch)
tree7363161fe48edbecbd562f36280ce3980835f9c2 /sql/wsrep_sst.cc
parent34fcd726a6d5ee6e41b48b5946df801cb079afc1 (diff)
parent640f42311a72fa82bf7117c2791fc47ceb420361 (diff)
downloadmariadb-git-e841957416e9287d1e9b2e32c952d6d0c1a2e2ed.tar.gz
Merge branch '10.3' into 10.4
Diffstat (limited to 'sql/wsrep_sst.cc')
-rw-r--r--sql/wsrep_sst.cc62
1 files changed, 52 insertions, 10 deletions
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc
index 23de4d7f7c1..d2a3369be72 100644
--- a/sql/wsrep_sst.cc
+++ b/sql/wsrep_sst.cc
@@ -770,8 +770,20 @@ static size_t estimate_cmd_len (bool* extra_args)
char c;
while ((c = *arg++) != 0)
{
- /* A whitespace or a single quote requires double quotation marks: */
- if (isspace(c) || c == '\'')
+ /*
+ Space, single quote, ampersand, and I/O redirection characters
+ require text to be enclosed in double quotes:
+ */
+ if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
+#ifdef __WIN__
+ c == '>' || c == '<')
+#else
+ /*
+ The semicolon is used to separate shell commands, so it must be
+ enclosed in double quotes as well:
+ */
+ c == '>' || c == '<' || c == ';')
+#endif
{
quotation= true;
}
@@ -794,10 +806,19 @@ static size_t estimate_cmd_len (bool* extra_args)
while ((c = *arg++) != 0)
{
/*
- A whitespace or a single quote requires double
- quotation marks:
+ Space, single quote, ampersand, and I/O redirection characters
+ require text to be enclosed in double quotes:
+ */
+ if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
+#ifdef __WIN__
+ c == '>' || c == '<')
+#else
+ /*
+ The semicolon is used to separate shell commands, so it must be
+ enclosed in double quotes as well:
*/
- if (isspace(c) || c == '\'')
+ c == '>' || c == '<' || c == ';')
+#endif
{
quotation= true;
}
@@ -878,8 +899,20 @@ static void copy_orig_argv (char* cmd_str)
char c;
while ((c = *arg_scan++) != 0)
{
- /* A whitespace or a single quote requires double quotation marks: */
- if (isspace(c) || c == '\'')
+ /*
+ Space, single quote, ampersand, and I/O redirection characters
+ require text to be enclosed in double quotes:
+ */
+ if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
+#ifdef __WIN__
+ c == '>' || c == '<')
+#else
+ /*
+ The semicolon is used to separate shell commands, so it must be
+ enclosed in double quotes as well:
+ */
+ c == '>' || c == '<' || c == ';')
+#endif
{
quotation= true;
}
@@ -953,10 +986,19 @@ static void copy_orig_argv (char* cmd_str)
while ((c = *arg_scan++) != 0)
{
/*
- A whitespace or a single quote requires double
- quotation marks:
+ Space, single quote, ampersand, and I/O redirection characters
+ require text to be enclosed in double quotes:
+ */
+ if (isspace(c) || c == '\'' || c == '&' || c == '|' ||
+#ifdef __WIN__
+ c == '>' || c == '<')
+#else
+ /*
+ The semicolon is used to separate shell commands, so it must be
+ enclosed in double quotes as well:
*/
- if (isspace(c) || c == '\'')
+ c == '>' || c == '<' || c == ';')
+#endif
{
quotation= true;
}