]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use correct escaping
authorAlan T. DeKok <aland@freeradius.org>
Sun, 17 Sep 2023 13:26:26 +0000 (09:26 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 17 Sep 2023 13:26:26 +0000 (09:26 -0400)
now that we've fixed fr_asprint() in commit b10640, and the
escaping in 41193841eb, this test also needs fixing.  In order to
pass \' to a shell which takes a string in ' quotes, the config
file string must use one layer of escaping for FR, and a second
layer of escaping for the shell.

this issue highlights the fact that we likely need a "q" operator
ala Perl.

src/tests/modules/exec/module.conf

index 27680b94511e403060bb0fbe5b03daa21b4d9e56..38ea3219246d8de9eca2e19e8358b85fca1eb9d5 100644 (file)
@@ -10,7 +10,7 @@ exec exec_async_mod {
        input_pairs = &request
        shell_escape = yes
        timeout = 10
-       program = "/bin/sh -c 'echo \'Tmp-String-0 = welcome\''"
+       program = "/bin/sh -c 'echo \\\'Tmp-String-0 = welcome\\\''"
 }
 
 exec exec_sync {
@@ -26,7 +26,7 @@ exec exec_sync_mod {
        output_pairs = &control
        shell_escape = yes
        timeout = 10
-       program = "/bin/sh -c 'echo \'Tmp-String-0 = welcome\''"
+       program = "/bin/sh -c 'echo \\\'Tmp-String-0 = welcome\\\''"
 }
 
 exec exec_sync_attrs {