From e4c53d3bf00a63680bb8b56c8118e8401436ad0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Thu, 17 Sep 2015 16:19:36 +0000 Subject: [PATCH] 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. --- contrib/unbound/util/configlexer.lex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/unbound/util/configlexer.lex b/contrib/unbound/util/configlexer.lex index 26974c69a094..c80fedfbd5a0 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 */