Skip to content

Commit

Permalink
Do not allow actions to create dirs outside of build dir
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
  • Loading branch information
rgrinberg committed May 15, 2019
1 parent 12a7489 commit 698d7ea
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/action_exec.ml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,14 @@ let rec exec t ~ectx ~dir ~env ~stdout_to ~stderr_to =
Path.rm_rf path;
Fiber.return ()
| Mkdir path ->
Path.mkdir_p path;
begin
if Path.is_in_build_dir path then
Path.mkdir_p path
else if Path.exists path then
()
else
die "action attempted to create %a outside the build dir" Path.pp path
end;
Fiber.return ()
| Digest_files paths ->
let s =
Expand Down

0 comments on commit 698d7ea

Please sign in to comment.