go.mod: update osbuild/images to v0.74.0
This commit is contained in:
parent
3789ff4ce8
commit
c9972f7da8
327 changed files with 8341 additions and 12785 deletions
68
vendor/github.com/cyphar/filepath-securejoin/testing_mocks_linux.go
generated
vendored
Normal file
68
vendor/github.com/cyphar/filepath-securejoin/testing_mocks_linux.go
generated
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
//go:build linux
|
||||
|
||||
// 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 (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
type forceGetProcRootLevel int
|
||||
|
||||
const (
|
||||
forceGetProcRootDefault forceGetProcRootLevel = iota
|
||||
forceGetProcRootOpenTree // force open_tree()
|
||||
forceGetProcRootOpenTreeAtRecursive // force open_tree(AT_RECURSIVE)
|
||||
forceGetProcRootUnsafe // force open()
|
||||
)
|
||||
|
||||
var testingForceGetProcRoot *forceGetProcRootLevel
|
||||
|
||||
func testingCheckClose(check bool, f *os.File) bool {
|
||||
if check {
|
||||
if f != nil {
|
||||
_ = f.Close()
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func testingForcePrivateProcRootOpenTree(f *os.File) bool {
|
||||
return testing.Testing() && testingForceGetProcRoot != nil &&
|
||||
testingCheckClose(*testingForceGetProcRoot >= forceGetProcRootOpenTree, f)
|
||||
}
|
||||
|
||||
func testingForcePrivateProcRootOpenTreeAtRecursive(f *os.File) bool {
|
||||
return testing.Testing() && testingForceGetProcRoot != nil &&
|
||||
testingCheckClose(*testingForceGetProcRoot >= forceGetProcRootOpenTreeAtRecursive, f)
|
||||
}
|
||||
|
||||
func testingForceGetProcRootUnsafe() bool {
|
||||
return testing.Testing() && testingForceGetProcRoot != nil &&
|
||||
*testingForceGetProcRoot >= forceGetProcRootUnsafe
|
||||
}
|
||||
|
||||
type forceProcThreadSelfLevel int
|
||||
|
||||
const (
|
||||
forceProcThreadSelfDefault forceProcThreadSelfLevel = iota
|
||||
forceProcSelfTask
|
||||
forceProcSelf
|
||||
)
|
||||
|
||||
var testingForceProcThreadSelf *forceProcThreadSelfLevel
|
||||
|
||||
func testingForceProcSelfTask() bool {
|
||||
return testing.Testing() && testingForceProcThreadSelf != nil &&
|
||||
*testingForceProcThreadSelf >= forceProcSelfTask
|
||||
}
|
||||
|
||||
func testingForceProcSelf() bool {
|
||||
return testing.Testing() && testingForceProcThreadSelf != nil &&
|
||||
*testingForceProcThreadSelf >= forceProcSelf
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue