Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
add back the src_path filestat check before doing actual bind_mount
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Xiang committed Sep 12, 2013
1 parent eaeb910 commit ec6f157
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions warden/lib/warden/container/linux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ def write_bind_mount_commands(request)
src_path = bind_mount.src_path
dst_path = bind_mount.dst_path

# Check that the source path exists
stat = File.stat(src_path) rescue nil
raise WardenError.new("Source path for bind mount does not exist: #{src_path}") if stat.nil?

mode = case bind_mount.mode
when Protocol::CreateRequest::BindMount::Mode::RO
"ro"
Expand Down

0 comments on commit ec6f157

Please sign in to comment.