Commit d53eae77 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Don't explode in vcl.show if VCL code contains a '%' sign.

Fixes: 742



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5073 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 8385a88f
......@@ -671,6 +671,8 @@ mcf_config_list(struct cli *cli, const char * const *av, void *priv)
/*
* XXX: This should take an option argument to show all (include) files
* XXX: This violates the principle of not loading VCL's in the master
* XXX: process.
*/
void
mcf_config_show(struct cli *cli, const char * const *av, void *priv)
......@@ -692,7 +694,7 @@ mcf_config_show(struct cli *cli, const char * const *av, void *priv)
AZ(dlclose(dlh));
} else {
src = sym;
cli_out(cli, src[0]);
cli_out(cli, "%s", src[0]);
/* cli_out(cli, src[1]); */
AZ(dlclose(dlh));
}
......
......@@ -493,6 +493,7 @@ main(int argc, char * const *argv)
MCF_ParamSet(cli, "user", optarg);
break;
case 'V':
/* XXX: we should print the ident here */
varnish_version("varnishd");
exit(0);
case 'x':
......
# $Id#
test "% escapes in VCL source and vcl.show"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
C{
void foo(void)
{
printf("%s %s %s", "foo", "bar", "barf");
}
}C
} -start
client c1 {
txreq
rxresp
} -run
varnish v1 -cliok "vcl.show vcl1"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment