From 433726e9912efc79db589807deb4a8d5dc13fcde Mon Sep 17 00:00:00 2001 From: tfheen Date: Mon, 10 Nov 2008 11:55:17 +0000 Subject: [PATCH] Make sure the VCL we try to load is a regular file Fixes #368 git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3378 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/lib/libvcl/vcc_compile.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/varnish-cache/lib/libvcl/vcc_compile.c b/varnish-cache/lib/libvcl/vcc_compile.c index 34acee4a..0db0c569 100644 --- a/varnish-cache/lib/libvcl/vcc_compile.c +++ b/varnish-cache/lib/libvcl/vcc_compile.c @@ -415,6 +415,11 @@ vcc_file_source(struct vsb *sb, const char *fn, int fd) } } assert(0 == fstat(fd, &st)); + if (! S_ISREG(st.st_mode)) { + vsb_printf(sb, "File '%s' is not a regular file\n", fn); + AZ(close(fd)); + return (NULL); + } f = malloc(st.st_size + 1); assert(f != NULL); i = read(fd, f, st.st_size); -- 2.39.5