Commit 896eeb5d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Properly quote the ban descriptions.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3516 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 7803d0e1
......@@ -215,6 +215,7 @@ ban_parse_test(struct cli *cli, struct ban *b, const char *a1, const char *a2, c
{
struct ban_test *bt;
char buf[512];
struct vsb *sb;
int i;
CHECK_OBJ_NOTNULL(b, BAN_MAGIC);
......@@ -253,8 +254,15 @@ ban_parse_test(struct cli *cli, struct ban *b, const char *a1, const char *a2, c
}
/* XXX: proper quoting */
asprintf(&bt->test, "%s %s \"%s\"", a1, a2, a3);
sb = vsb_newauto();
XXXAN(sb);
vsb_printf(sb, "%s %s ", a1, a2);
vsb_quote(sb, a3, 0);
vsb_finish(sb);
AZ(vsb_overflowed(sb));
bt->test = strdup(vsb_data(sb));
XXXAN(bt->test);
vsb_delete(sb);
return (0);
}
......
......@@ -28,8 +28,8 @@ varnish v1 -clierr 104 "purge foo bar"
varnish v1 -clierr 106 "purge a b c && a"
varnish v1 -clierr 106 "purge a b c && a b"
varnish v1 -clierr 106 "purge a b c || a b c"
varnish v1 -cli "purge req.url ~ foo"
# varnish v1 -cli "purge req.url ~ foo && req.url ~ bar"
varnish v1 -cliok "purge req.url ~ foo && req.url ~ \"[ o]\""
varnish v1 -cliok "purge.list"
client c1 {
txreq -url "/foo"
......
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