path: dest paths inside container should always be treated as *nix type
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>
This commit is contained in:
parent
a608c93598
commit
e278dcf7ef
|
|
@ -5,6 +5,7 @@ package parse
|
|||
|
||||
import (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue