mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 13:11:30 +00:00
Allow libcontainer to eval symlink destination
Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Add tests for mounting into /proc and /sys These two locations should be prohibited from mounting volumes into those destinations. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -3487,3 +3487,21 @@ func TestRunReadProcLatency(t *testing.T) {
|
||||
}
|
||||
logDone("run - read /proc/latency_stats")
|
||||
}
|
||||
|
||||
func TestMountIntoProc(t *testing.T) {
|
||||
defer deleteAllContainers()
|
||||
code, err := runCommand(exec.Command(dockerBinary, "run", "-v", "/proc//sys", "busybox", "true"))
|
||||
if err == nil || code == 0 {
|
||||
t.Fatal("container should not be able to mount into /proc")
|
||||
}
|
||||
logDone("run - mount into proc")
|
||||
}
|
||||
|
||||
func TestMountIntoSys(t *testing.T) {
|
||||
defer deleteAllContainers()
|
||||
code, err := runCommand(exec.Command(dockerBinary, "run", "-v", "/sys/", "busybox", "true"))
|
||||
if err == nil || code == 0 {
|
||||
t.Fatal("container should not be able to mount into /sys")
|
||||
}
|
||||
logDone("run - mount into sys")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user