summaryrefslogtreecommitdiffstats
path: root/contrib/unbound
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2015-09-17 16:19:36 +0000
committerdes <des@FreeBSD.org>2015-09-17 16:19:36 +0000
commit870d2cd235fe7c0bcbd28fe6e14ebc607f25a127 (patch)
treedf47ee502390dc4971c150e3ef8858ace7f2bc16 /contrib/unbound
parentc5050a3b9f622f6308084b1e253919467f3c6ff0 (diff)
downloadFreeBSD-src-870d2cd235fe7c0bcbd28fe6e14ebc607f25a127.zip
FreeBSD-src-870d2cd235fe7c0bcbd28fe6e14ebc607f25a127.tar.gz
When chrooted, we need to strip the chroot directory from the front of
included paths. Don't forget to do it for globs as well.
Diffstat (limited to 'contrib/unbound')
-rw-r--r--contrib/unbound/util/configlexer.lex4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/unbound/util/configlexer.lex b/contrib/unbound/util/configlexer.lex
index 26974c6..c80fedf 100644
--- a/contrib/unbound/util/configlexer.lex
+++ b/contrib/unbound/util/configlexer.lex
@@ -128,6 +128,10 @@ static void config_start_include_glob(const char* filename)
#endif
;
memset(&g, 0, sizeof(g));
+ if(cfg_parser->chroot && strncmp(filename, cfg_parser->chroot,
+ strlen(cfg_parser->chroot)) == 0) {
+ filename += strlen(cfg_parser->chroot);
+ }
r = glob(filename, flags, NULL, &g);
if(r) {
/* some error */
OpenPOWER on IntegriCloud