mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-15 00:53:05 -06:00
[chore] update go-sqlite3 to v0.19.0 (#3406)
This commit is contained in:
parent
1e421cb912
commit
2c3f1f4ddb
31 changed files with 274 additions and 171 deletions
47
vendor/github.com/ncruces/go-sqlite3/vfs/os_std.go
generated
vendored
Normal file
47
vendor/github.com/ncruces/go-sqlite3/vfs/os_std.go
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
//go:build !unix || sqlite3_nosys
|
||||
|
||||
package vfs
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"os"
|
||||
)
|
||||
|
||||
const _O_NOFOLLOW = 0
|
||||
|
||||
func osAccess(path string, flags AccessFlag) error {
|
||||
fi, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if flags == ACCESS_EXISTS {
|
||||
return nil
|
||||
}
|
||||
|
||||
const (
|
||||
S_IREAD = 0400
|
||||
S_IWRITE = 0200
|
||||
S_IEXEC = 0100
|
||||
)
|
||||
|
||||
var want fs.FileMode = S_IREAD
|
||||
if flags == ACCESS_READWRITE {
|
||||
want |= S_IWRITE
|
||||
}
|
||||
if fi.IsDir() {
|
||||
want |= S_IEXEC
|
||||
}
|
||||
if fi.Mode()&want != want {
|
||||
return fs.ErrPermission
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func osSetMode(file *os.File, modeof string) error {
|
||||
fi, err := os.Stat(modeof)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
file.Chmod(fi.Mode())
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue