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"
)
var pathBlacklist = map[string]bool{
var pathDenyList = map[string]bool{
"c:\\": true,
"c:\\windows": true,
}
@ -98,7 +98,7 @@ func validateCopySourcePath(imageSource *imageMount, origPath, platform string)
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 nil

View file

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