diff options
author | Daniel Pinto <danielpinto52@gmail.com> | 2020-11-13 01:08:56 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-12-08 15:00:43 -0500 |
commit | bd0046c9ec5bf6556d4ecf6b111b0de4c0266ebd (patch) | |
tree | 0f4dbe1bae43e053e49c9cee5865bdaff20f0116 /src/lib/fs/conffile.c | |
parent | baef0843a424116026f3f97185dae89271903041 (diff) | |
download | tor-bd0046c9ec5bf6556d4ecf6b111b0de4c0266ebd.tar.gz tor-bd0046c9ec5bf6556d4ecf6b111b0de4c0266ebd.zip |
Avoid sandbox bug warning when unglobbing patterns #40094
Adds a more user-friendly error message when the configuration is
reloaded and a new %include is added that makes its unglobbing
access files/folders not allowed by the seccomp sandbox.
Diffstat (limited to 'src/lib/fs/conffile.c')
-rw-r--r-- | src/lib/fs/conffile.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/fs/conffile.c b/src/lib/fs/conffile.c index acd8dfb8cc..0d0bdf09a6 100644 --- a/src/lib/fs/conffile.c +++ b/src/lib/fs/conffile.c @@ -23,6 +23,7 @@ #include "lib/string/printf.h" #include <stdbool.h> +#include <errno.h> static smartlist_t *config_get_file_list(const char *path, smartlist_t *opened_files); @@ -68,6 +69,11 @@ expand_glob(const char *pattern, smartlist_t *opened_files) smartlist_t *matches = tor_glob(pattern); if (!matches) { + if (errno == EPERM) { + log_err(LD_CONFIG, "Sandbox is active, but the configuration pattern " + "\"%s\" listed with %%include would access files or folders not " + "allowed by it. Cannot proceed.", pattern); + } return NULL; } |