Skip to content

Commit

Permalink
php is now allowed in docker (Submitty#3762)
Browse files Browse the repository at this point in the history
  • Loading branch information
emaicus authored and bmcutler committed May 31, 2019
1 parent 6133926 commit 858a557
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion grading/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ bool system_program(const std::string &program, std::string &full_path_executabl

if(running_in_docker){
allowed_system_programs.insert({"bash", "/bin/bash"});
allowed_system_programs.insert({"php", "/usr/bin/php"});
}
// find full path name
std::map<std::string,std::string>::const_iterator itr = allowed_system_programs.find(program);
Expand Down Expand Up @@ -225,7 +226,8 @@ std::string validate_program(const std::string &program, const nlohmann::json &w
std::cerr << message << std::endl;
exit(1);
} else {
bool running_in_docker = whole_config.value("docker_enabled", false);
std::string mode = whole_config.value("autograding_method", "");
bool running_in_docker = (mode == "docker") ? true : false;
if (system_program(program,full_path_executable,running_in_docker)) {
return full_path_executable;
}
Expand Down

0 comments on commit 858a557

Please sign in to comment.