Replace uses of blacklist/whitelist
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
d78b22cdf5
commit
3895dd585f
3 changed files with 7 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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{
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue