From 89a775d2dc596b9ac86873edf447fff2f7012ef3 Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Tue, 22 Dec 2015 13:59:28 -0500 Subject: [PATCH] No options to tmpfs is valid If you run a docker run command with --tmpfs /mountpoint:noexec Or certain options that get translated into mount options, the mount command can get passed "" for mount data. So this should be valid. Signed-off-by: Dan Walsh --- integration-cli/docker_cli_run_unix_test.go | 3 +++ pkg/mount/flags.go | 1 + 2 files changed, 4 insertions(+) diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go index b613d1490f..16607bd8ce 100644 --- a/integration-cli/docker_cli_run_unix_test.go +++ b/integration-cli/docker_cli_run_unix_test.go @@ -479,6 +479,9 @@ func (s *DockerSuite) TestRunTmpfsMounts(c *check.C) { if out, _, err := dockerCmdWithError("run", "--tmpfs", "/run", "busybox", "touch", "/run/somefile"); err != nil { c.Fatalf("/run directory not mounted on tmpfs %q %s", err, out) } + if out, _, err := dockerCmdWithError("run", "--tmpfs", "/run:noexec", "busybox", "touch", "/run/somefile"); err != nil { + c.Fatalf("/run directory not mounted on tmpfs %q %s", err, out) + } if out, _, err := dockerCmdWithError("run", "--tmpfs", "/run:noexec,nosuid,rw,size=5k,mode=700", "busybox", "touch", "/run/somefile"); err != nil { c.Fatalf("/run failed to mount on tmpfs with valid options %q %s", err, out) } diff --git a/pkg/mount/flags.go b/pkg/mount/flags.go index 4305d15561..d2fb1fb4d0 100644 --- a/pkg/mount/flags.go +++ b/pkg/mount/flags.go @@ -73,6 +73,7 @@ func parseOptions(options string) (int, string) { func ParseTmpfsOptions(options string) (int, string, error) { flags, data := parseOptions(options) validFlags := map[string]bool{ + "": true, "size": true, "mode": true, "uid": true,