Skip to content

Commit

Permalink
path: dest paths inside container should always be treated as *nix type
Browse files Browse the repository at this point in the history
Destination path inside containers should be always validated  as
*nix absolute path. So its recommended to use path.IsAbs() instead of
filepath.IsAbs().

[NO TEST NEEDED]

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
  • Loading branch information
flouthoc committed Aug 16, 2021
1 parent 08da88d commit fc04865
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package parse

import (
"os"
"path"
"path/filepath"
"strings"

Expand Down Expand Up @@ -155,7 +156,7 @@ func ValidateVolumeCtrDir(ctrDir string) error {
if ctrDir == "" {
return errors.New("container directory cannot be empty")
}
if !filepath.IsAbs(ctrDir) {
if !path.IsAbs(ctrDir) {
return errors.Errorf("invalid container path %q, must be an absolute path", ctrDir)
}
return nil
Expand Down

0 comments on commit fc04865

Please sign in to comment.