From e98ad5751d12b6ef052803b30fd397101952294e Mon Sep 17 00:00:00 2001 From: umohnani8 Date: Tue, 1 May 2018 13:25:30 -0400 Subject: Vendor in latest buildah Adds in --iidfile flag to podman build. Signed-off-by: umohnani8 Closes: #707 Approved by: mheon --- vendor/github.com/projectatomic/buildah/pkg/parse/parse.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'vendor/github.com/projectatomic/buildah/pkg/parse/parse.go') diff --git a/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go b/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go index f2159d930..505601f25 100644 --- a/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go +++ b/vendor/github.com/projectatomic/buildah/pkg/parse/parse.go @@ -8,6 +8,7 @@ import ( "fmt" "net" "os" + "path/filepath" "reflect" "regexp" "strings" @@ -56,7 +57,7 @@ func ParseCommonBuildOptions(c *cli.Context) (*buildah.CommonBuildOptions, error if _, err := units.FromHumanSize(c.String("shm-size")); err != nil { return nil, errors.Wrapf(err, "invalid --shm-size") } - if err := parseVolumes(c.StringSlice("volume")); err != nil { + if err := ParseVolumes(c.StringSlice("volume")); err != nil { return nil, err } @@ -122,7 +123,8 @@ func parseSecurityOpts(securityOpts []string, commonOpts *buildah.CommonBuildOpt return nil } -func parseVolumes(volumes []string) error { +// ParseVolumes validates the host and container paths passed in to the --volume flag +func ParseVolumes(volumes []string) error { if len(volumes) == 0 { return nil } @@ -147,6 +149,9 @@ func parseVolumes(volumes []string) error { } func validateVolumeHostDir(hostDir string) error { + if !filepath.IsAbs(hostDir) { + return errors.Errorf("invalid host path, must be an absolute path %q", hostDir) + } if _, err := os.Stat(hostDir); err != nil { return errors.Wrapf(err, "error checking path %q", hostDir) } @@ -154,8 +159,8 @@ func validateVolumeHostDir(hostDir string) error { } func validateVolumeCtrDir(ctrDir string) error { - if ctrDir[0] != '/' { - return errors.Errorf("invalid container directory path %q", ctrDir) + if !filepath.IsAbs(ctrDir) { + return errors.Errorf("invalid container path, must be an absolute path %q", ctrDir) } return nil } -- cgit v1.2.3-54-g00ecf