Skip to content

Commit

Permalink
only allow filters.shell if PDAL_ALLOW_SHELL environment variable is set
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Mar 31, 2019
1 parent 239480e commit 99b9e07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions filters/ShellFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ void ShellFilter::addArgs(ProgramArgs& args)

void ShellFilter::initialize()
{
std::string allowed;
int set = Utils::getenv("PDAL_ALLOW_SHELL", allowed);
if (set == -1)
throw pdal::pdal_error("PDAL_ALLOW_SHELL environment variable not set, shell access is not allowed");
}


Expand Down
2 changes: 1 addition & 1 deletion test/unit/filters/ShellFilterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ using namespace pdal;
TEST(ShellFilterTest, test_shell_filter)
{
PipelineManager mgr;

Utils::setenv("PDAL_ALLOW_SHELL", "1");
mgr.readPipeline(Support::configuredpath("pipeline/shell.json"));

mgr.execute();
Expand Down

0 comments on commit 99b9e07

Please sign in to comment.