mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
Changes in runc code are not impacting code we use; - libcontainer/utils.MkdirAllInRootOpen is not used - libcontainer/utils.MkdirAllInRoot is not used Similarly, while filepath-securejoin is imported, the functions using it in runc (cgroups.FindCgroupMountpoint, are not used in our codebase, so these changes don't affect our code; `tryDefaultPath` uses securejoin, which is used by `FindCgroupMountpoint`, but not used in our codebase. diffs: - https://github.com/opencontainers/runc/compare/v1.2.4...v1.2.5 - https://github.com/cyphar/filepath-securejoin/compare/v0.3.5...v0.4.1 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
33 lines
710 B
Go
33 lines
710 B
Go
//go:build linux && go1.21
|
|
|
|
// Copyright (C) 2024 SUSE LLC. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package securejoin
|
|
|
|
import (
|
|
"slices"
|
|
"sync"
|
|
)
|
|
|
|
func slices_DeleteFunc[S ~[]E, E any](slice S, delFn func(E) bool) S {
|
|
return slices.DeleteFunc(slice, delFn)
|
|
}
|
|
|
|
func slices_Contains[S ~[]E, E comparable](slice S, val E) bool {
|
|
return slices.Contains(slice, val)
|
|
}
|
|
|
|
func slices_Clone[S ~[]E, E any](slice S) S {
|
|
return slices.Clone(slice)
|
|
}
|
|
|
|
func sync_OnceValue[T any](f func() T) func() T {
|
|
return sync.OnceValue(f)
|
|
}
|
|
|
|
func sync_OnceValues[T1, T2 any](f func() (T1, T2)) func() (T1, T2) {
|
|
return sync.OnceValues(f)
|
|
}
|