Skip to content

Commit 8acbb27

Browse files
authored
Merge pull request from GHSA-crp2-qrr5-8pq7
Clean image volume path
2 parents 2a3f109 + fb0b8d6 commit 8acbb27

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/cri/opts/container.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ func WithVolumes(volumeMounts map[string]string) containerd.NewContainerOpts {
112112
// The volume may have been defined with a C: prefix, which we can't use here.
113113
volume = strings.TrimPrefix(volume, "C:")
114114
for _, mountPath := range mountPaths {
115-
src := filepath.Join(mountPath, volume)
115+
src, err := fs.RootPath(mountPath, volume)
116+
if err != nil {
117+
return fmt.Errorf("rootpath on mountPath %s, volume %s: %w", mountPath, volume, err)
118+
}
116119
if _, err := os.Stat(src); err != nil {
117120
if os.IsNotExist(err) {
118121
// Skip copying directory if it does not exist.

0 commit comments

Comments
 (0)