Browse code

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 <dwalsh@redhat.com>

Dan Walsh authored on 2015/12/23 03:59:28
Showing 2 changed files
... ...
@@ -479,6 +479,9 @@ func (s *DockerSuite) TestRunTmpfsMounts(c *check.C) {
479 479
 	if out, _, err := dockerCmdWithError("run", "--tmpfs", "/run", "busybox", "touch", "/run/somefile"); err != nil {
480 480
 		c.Fatalf("/run directory not mounted on tmpfs %q %s", err, out)
481 481
 	}
482
+	if out, _, err := dockerCmdWithError("run", "--tmpfs", "/run:noexec", "busybox", "touch", "/run/somefile"); err != nil {
483
+		c.Fatalf("/run directory not mounted on tmpfs %q %s", err, out)
484
+	}
482 485
 	if out, _, err := dockerCmdWithError("run", "--tmpfs", "/run:noexec,nosuid,rw,size=5k,mode=700", "busybox", "touch", "/run/somefile"); err != nil {
483 486
 		c.Fatalf("/run failed to mount on tmpfs with valid options %q %s", err, out)
484 487
 	}
... ...
@@ -73,6 +73,7 @@ func parseOptions(options string) (int, string) {
73 73
 func ParseTmpfsOptions(options string) (int, string, error) {
74 74
 	flags, data := parseOptions(options)
75 75
 	validFlags := map[string]bool{
76
+		"":          true,
76 77
 		"size":      true,
77 78
 		"mode":      true,
78 79
 		"uid":       true,