Skip to content

Commit

Permalink
libcontainer.createLibcontainerMount(): use filepath.Abs()
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Jun 7, 2021
1 parent 1ed4336 commit dbcf967
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libcontainer/specconv/spec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ func createLibcontainerMount(cwd string, m specs.Mount) (*configs.Mount, error)
destination := m.Destination
if !filepath.IsAbs(m.Destination) {
// Relax validation for backward compatibility
destination = filepath.Join("/", m.Destination)
destination, err := filepath.Abs(m.Destination)
if err != nil {
return nil, err
}
logrus.Warnf("mount destination %s not absolute, using %s instead", m.Destination, destination)
}
flags, pgflags, data, ext := parseMountOptions(m.Options)
Expand Down

0 comments on commit dbcf967

Please sign in to comment.