1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Replace uses of blacklist/whitelist

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-07-14 10:41:34 +02:00
parent d78b22cdf5
commit 3895dd585f
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
3 changed files with 7 additions and 7 deletions

View file

@ -14,7 +14,7 @@ import (
"golang.org/x/sys/windows" "golang.org/x/sys/windows"
) )
var pathBlacklist = map[string]bool{ var pathDenyList = map[string]bool{
"c:\\": true, "c:\\": true,
"c:\\windows": true, "c:\\windows": true,
} }
@ -98,7 +98,7 @@ func validateCopySourcePath(imageSource *imageMount, origPath, platform string)
p = filepath.Join("c:\\", p) p = filepath.Join("c:\\", p)
} }
} }
if _, blacklisted := pathBlacklist[p]; blacklisted { if _, ok := pathDenyList[p]; ok {
return errors.New("copy from c:\\ or c:\\windows is not allowed on windows") return errors.New("copy from c:\\ or c:\\windows is not allowed on windows")
} }
return nil return nil

View file

@ -298,17 +298,17 @@ func (pm *Manager) GC() {
pm.muGC.Lock() pm.muGC.Lock()
defer pm.muGC.Unlock() defer pm.muGC.Unlock()
whitelist := make(map[digest.Digest]struct{}) used := make(map[digest.Digest]struct{})
for _, p := range pm.config.Store.GetAll() { for _, p := range pm.config.Store.GetAll() {
whitelist[p.Config] = struct{}{} used[p.Config] = struct{}{}
for _, b := range p.Blobsums { for _, b := range p.Blobsums {
whitelist[b] = struct{}{} used[b] = struct{}{}
} }
} }
ctx := context.TODO() ctx := context.TODO()
pm.blobStore.Walk(ctx, func(info content.Info) error { pm.blobStore.Walk(ctx, func(info content.Info) error {
_, ok := whitelist[info.Digest] _, ok := used[info.Digest]
if ok { if ok {
return nil return nil
} }

View file

@ -40,7 +40,7 @@ func arches() []types.Architecture {
} }
} }
// DefaultProfile defines the whitelist for the default seccomp profile. // DefaultProfile defines the allowed syscalls for the default seccomp profile.
func DefaultProfile() *types.Seccomp { func DefaultProfile() *types.Seccomp {
syscalls := []*types.Syscall{ syscalls := []*types.Syscall{
{ {