mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 13:37:08 +08:00
vendor: update buildkit to master@31c870e82a48
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
25
vendor/github.com/in-toto/in-toto-golang/in_toto/util_windows.go
generated
vendored
Normal file
25
vendor/github.com/in-toto/in-toto-golang/in_toto/util_windows.go
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
package in_toto
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
)
|
||||
|
||||
func isWritable(path string) error {
|
||||
// get fileInfo
|
||||
info, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// check if path is a directory
|
||||
if !info.IsDir() {
|
||||
return errors.New("not a directory")
|
||||
}
|
||||
|
||||
// Check if the user bit is enabled in file permission
|
||||
if info.Mode().Perm()&(1<<(uint(7))) == 0 {
|
||||
return errors.New("not writable")
|
||||
}
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user