Commit 42ee1d06 authored by Geoff Simmons's avatar Geoff Simmons

Verify that the file may be a link, if it points to a regular file.

parent 1b12e9ec
......@@ -29,6 +29,28 @@ client c1 {
expect resp.http.Get == "foo bar baz quux"
} -run
shell {ln -s ${tmpdir}/file ${tmpdir}/link}
varnish v1 -vcl {
import ${vmod_file};
backend b { .host = "${bad_ip}"; }
sub vcl_init {
new rdr = file.reader("${tmpdir}/link");
}
sub vcl_recv {
return (synth(200));
}
sub vcl_synth {
set resp.http.Get = rdr.get();
return (deliver);
}
}
client c1 -run
varnish v1 -vcl {
import ${vmod_file};
backend b { .host = "${bad_ip}"; }
......@@ -137,6 +159,17 @@ varnish v1 -errvcl {not a regular file} {
}
}
shell {ln -s ${tmpdir} ${tmpdir}/dirlink}
varnish v1 -errvcl {not a regular file} {
import ${vmod_file};
backend b { .host = "${bad_ip}"; }
sub vcl_init {
new rdr = file.reader("${tmpdir}/dirlink");
}
}
varnish v1 -errvcl {vmod file failure: new rdr: name is empty} {
import ${vmod_file};
backend b { .host = "${bad_ip}"; }
......
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