diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-02-06 13:57:59 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-02-06 17:57:37 +0100 |
commit | 1e361f286bc2cd42c79a4c0ac40209d222e60b11 (patch) | |
tree | 93b0e3eb1b68d065965750e87e7299c841481194 /unittest | |
parent | 9e4e4121b8b441d3b5b56edece0a05bb16caac3c (diff) | |
download | mariadb-git-1e361f286bc2cd42c79a4c0ac40209d222e60b11.tar.gz |
MDEV-4664 mysql_upgrade crashes if root's password contains an apostrophe/single quotation mark
fix dynstr_append_os_quoted() to escape single quotes correctly
for a POSIX shell
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/mysys/dynstring-t.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/unittest/mysys/dynstring-t.c b/unittest/mysys/dynstring-t.c index ca78e45d30c..fed8488da2c 100644 --- a/unittest/mysys/dynstring-t.c +++ b/unittest/mysys/dynstring-t.c @@ -47,25 +47,25 @@ int main(void) check("'space inside'"); ok(dynstr_append_os_quoted(&str1, "single'quote", NULL) == 0, "append"); - check("'single\\'quote'"); + check("'single'\"'\"'quote'"); ok(dynstr_append_os_quoted(&str1, "many'single'quotes", NULL) == 0, "append"); - check("'many\\'single\\'quotes'"); + check("'many'\"'\"'single'\"'\"'quotes'"); ok(dynstr_append_os_quoted(&str1, "'single quoted'", NULL) == 0, "append"); - check("'\\'single quoted\\''"); + check("''\"'\"'single quoted'\"'\"''"); ok(dynstr_append_os_quoted(&str1, "double\"quote", NULL) == 0, "append"); check("'double\"quote'"); ok(dynstr_append_os_quoted(&str1, "mixed\"single'and\"double'quotes", NULL) == 0, "append"); - check("'mixed\"single\\'and\"double\\'quotes'"); + check("'mixed\"single'\"'\"'and\"double'\"'\"'quotes'"); ok(dynstr_append_os_quoted(&str1, "back\\space", NULL) == 0, "append"); check("'back\\space'"); ok(dynstr_append_os_quoted(&str1, "backspace\\'and\\\"quote", NULL) == 0, "append"); - check("'backspace\\\\'and\\\"quote'"); + check("'backspace\\'\"'\"'and\\\"quote'"); dynstr_free(&str1); |