mirror of
https://github.com/containers/podman.git
synced 2025-11-29 17:48:05 +08:00
fix(deps): update module github.com/mattn/go-sqlite3 to v1.14.30
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
2
go.mod
2
go.mod
@@ -43,7 +43,7 @@ require (
|
|||||||
github.com/klauspost/pgzip v1.2.6
|
github.com/klauspost/pgzip v1.2.6
|
||||||
github.com/linuxkit/virtsock v0.0.0-20241009230534-cb6a20cc0422
|
github.com/linuxkit/virtsock v0.0.0-20241009230534-cb6a20cc0422
|
||||||
github.com/mattn/go-shellwords v1.0.12
|
github.com/mattn/go-shellwords v1.0.12
|
||||||
github.com/mattn/go-sqlite3 v1.14.29
|
github.com/mattn/go-sqlite3 v1.14.30
|
||||||
github.com/mdlayher/vsock v1.2.1
|
github.com/mdlayher/vsock v1.2.1
|
||||||
github.com/moby/docker-image-spec v1.3.1
|
github.com/moby/docker-image-spec v1.3.1
|
||||||
github.com/moby/sys/capability v0.4.0
|
github.com/moby/sys/capability v0.4.0
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -274,8 +274,8 @@ github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6T
|
|||||||
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||||
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
|
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
|
||||||
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
|
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
|
||||||
github.com/mattn/go-sqlite3 v1.14.29 h1:1O6nRLJKvsi1H2Sj0Hzdfojwt8GiGKm+LOfLaBFaouQ=
|
github.com/mattn/go-sqlite3 v1.14.30 h1:bVreufq3EAIG1Quvws73du3/QgdeZ3myglJlrzSYYCY=
|
||||||
github.com/mattn/go-sqlite3 v1.14.29/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
github.com/mattn/go-sqlite3 v1.14.30/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||||
github.com/mdlayher/packet v1.1.2 h1:3Up1NG6LZrsgDVn6X4L9Ge/iyRyxFEFD9o6Pr3Q1nQY=
|
github.com/mdlayher/packet v1.1.2 h1:3Up1NG6LZrsgDVn6X4L9Ge/iyRyxFEFD9o6Pr3Q1nQY=
|
||||||
github.com/mdlayher/packet v1.1.2/go.mod h1:GEu1+n9sG5VtiRE4SydOmX5GTwyyYlteZiFU+x0kew4=
|
github.com/mdlayher/packet v1.1.2/go.mod h1:GEu1+n9sG5VtiRE4SydOmX5GTwyyYlteZiFU+x0kew4=
|
||||||
github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos=
|
github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos=
|
||||||
|
|||||||
2
vendor/github.com/mattn/go-sqlite3/README.md
generated
vendored
2
vendor/github.com/mattn/go-sqlite3/README.md
generated
vendored
@@ -351,6 +351,8 @@ For example the TDM-GCC Toolchain can be found [here](https://jmeubank.github.io
|
|||||||
|
|
||||||
# User Authentication
|
# User Authentication
|
||||||
|
|
||||||
|
***This is deprecated***
|
||||||
|
|
||||||
This package supports the SQLite User Authentication module.
|
This package supports the SQLite User Authentication module.
|
||||||
|
|
||||||
## Compile
|
## Compile
|
||||||
|
|||||||
149
vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go
generated
vendored
149
vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go
generated
vendored
@@ -16,53 +16,10 @@ package sqlite3
|
|||||||
#else
|
#else
|
||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
#endif
|
#endif
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
static int
|
|
||||||
_sqlite3_user_authenticate(sqlite3* db, const char* zUsername, const char* aPW, int nPW)
|
|
||||||
{
|
|
||||||
return sqlite3_user_authenticate(db, zUsername, aPW, nPW);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
_sqlite3_user_add(sqlite3* db, const char* zUsername, const char* aPW, int nPW, int isAdmin)
|
|
||||||
{
|
|
||||||
return sqlite3_user_add(db, zUsername, aPW, nPW, isAdmin);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
_sqlite3_user_change(sqlite3* db, const char* zUsername, const char* aPW, int nPW, int isAdmin)
|
|
||||||
{
|
|
||||||
return sqlite3_user_change(db, zUsername, aPW, nPW, isAdmin);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
_sqlite3_user_delete(sqlite3* db, const char* zUsername)
|
|
||||||
{
|
|
||||||
return sqlite3_user_delete(db, zUsername);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
_sqlite3_auth_enabled(sqlite3* db)
|
|
||||||
{
|
|
||||||
int exists = -1;
|
|
||||||
|
|
||||||
sqlite3_stmt *stmt;
|
|
||||||
sqlite3_prepare_v2(db, "select count(type) from sqlite_master WHERE type='table' and name='sqlite_user';", -1, &stmt, NULL);
|
|
||||||
|
|
||||||
while ( sqlite3_step(stmt) == SQLITE_ROW) {
|
|
||||||
exists = sqlite3_column_int(stmt, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
sqlite3_finalize(stmt);
|
|
||||||
|
|
||||||
return exists;
|
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"unsafe"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -72,6 +29,7 @@ const (
|
|||||||
var (
|
var (
|
||||||
ErrUnauthorized = errors.New("SQLITE_AUTH: Unauthorized")
|
ErrUnauthorized = errors.New("SQLITE_AUTH: Unauthorized")
|
||||||
ErrAdminRequired = errors.New("SQLITE_AUTH: Unauthorized; Admin Privileges Required")
|
ErrAdminRequired = errors.New("SQLITE_AUTH: Unauthorized; Admin Privileges Required")
|
||||||
|
errUserAuthNoLongerSupported = errors.New("sqlite3: the sqlite_userauth tag is no longer supported as the userauth extension is no longer supported by the SQLite authors, see https://github.com/mattn/go-sqlite3/issues/1341").
|
||||||
)
|
)
|
||||||
|
|
||||||
// Authenticate will perform an authentication of the provided username
|
// Authenticate will perform an authentication of the provided username
|
||||||
@@ -88,15 +46,7 @@ var (
|
|||||||
// If the SQLITE_USER table is not present in the database file, then
|
// If the SQLITE_USER table is not present in the database file, then
|
||||||
// this interface is a harmless no-op returning SQLITE_OK.
|
// this interface is a harmless no-op returning SQLITE_OK.
|
||||||
func (c *SQLiteConn) Authenticate(username, password string) error {
|
func (c *SQLiteConn) Authenticate(username, password string) error {
|
||||||
rv := c.authenticate(username, password)
|
return errUserAuthNoLongerSupported
|
||||||
switch rv {
|
|
||||||
case C.SQLITE_ERROR, C.SQLITE_AUTH:
|
|
||||||
return ErrUnauthorized
|
|
||||||
case C.SQLITE_OK:
|
|
||||||
return nil
|
|
||||||
default:
|
|
||||||
return c.lastError()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// authenticate provides the actual authentication to SQLite.
|
// authenticate provides the actual authentication to SQLite.
|
||||||
@@ -109,17 +59,7 @@ func (c *SQLiteConn) Authenticate(username, password string) error {
|
|||||||
// C.SQLITE_ERROR (1)
|
// C.SQLITE_ERROR (1)
|
||||||
// C.SQLITE_AUTH (23)
|
// C.SQLITE_AUTH (23)
|
||||||
func (c *SQLiteConn) authenticate(username, password string) int {
|
func (c *SQLiteConn) authenticate(username, password string) int {
|
||||||
// Allocate C Variables
|
return 1
|
||||||
cuser := C.CString(username)
|
|
||||||
cpass := C.CString(password)
|
|
||||||
|
|
||||||
// Free C Variables
|
|
||||||
defer func() {
|
|
||||||
C.free(unsafe.Pointer(cuser))
|
|
||||||
C.free(unsafe.Pointer(cpass))
|
|
||||||
}()
|
|
||||||
|
|
||||||
return int(C._sqlite3_user_authenticate(c.db, cuser, cpass, C.int(len(password))))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuthUserAdd can be used (by an admin user only)
|
// AuthUserAdd can be used (by an admin user only)
|
||||||
@@ -131,20 +71,7 @@ func (c *SQLiteConn) authenticate(username, password string) int {
|
|||||||
// for any ATTACH-ed databases. Any call to AuthUserAdd by a
|
// for any ATTACH-ed databases. Any call to AuthUserAdd by a
|
||||||
// non-admin user results in an error.
|
// non-admin user results in an error.
|
||||||
func (c *SQLiteConn) AuthUserAdd(username, password string, admin bool) error {
|
func (c *SQLiteConn) AuthUserAdd(username, password string, admin bool) error {
|
||||||
isAdmin := 0
|
return errUserAuthNoLongerSupported
|
||||||
if admin {
|
|
||||||
isAdmin = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
rv := c.authUserAdd(username, password, isAdmin)
|
|
||||||
switch rv {
|
|
||||||
case C.SQLITE_ERROR, C.SQLITE_AUTH:
|
|
||||||
return ErrAdminRequired
|
|
||||||
case C.SQLITE_OK:
|
|
||||||
return nil
|
|
||||||
default:
|
|
||||||
return c.lastError()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// authUserAdd enables the User Authentication if not enabled.
|
// authUserAdd enables the User Authentication if not enabled.
|
||||||
@@ -162,17 +89,7 @@ func (c *SQLiteConn) AuthUserAdd(username, password string, admin bool) error {
|
|||||||
// C.SQLITE_ERROR (1)
|
// C.SQLITE_ERROR (1)
|
||||||
// C.SQLITE_AUTH (23)
|
// C.SQLITE_AUTH (23)
|
||||||
func (c *SQLiteConn) authUserAdd(username, password string, admin int) int {
|
func (c *SQLiteConn) authUserAdd(username, password string, admin int) int {
|
||||||
// Allocate C Variables
|
return 1
|
||||||
cuser := C.CString(username)
|
|
||||||
cpass := C.CString(password)
|
|
||||||
|
|
||||||
// Free C Variables
|
|
||||||
defer func() {
|
|
||||||
C.free(unsafe.Pointer(cuser))
|
|
||||||
C.free(unsafe.Pointer(cpass))
|
|
||||||
}()
|
|
||||||
|
|
||||||
return int(C._sqlite3_user_add(c.db, cuser, cpass, C.int(len(password)), C.int(admin)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuthUserChange can be used to change a users
|
// AuthUserChange can be used to change a users
|
||||||
@@ -181,20 +98,7 @@ func (c *SQLiteConn) authUserAdd(username, password string, admin int) int {
|
|||||||
// credentials or admin privilege setting. No user may change their own
|
// credentials or admin privilege setting. No user may change their own
|
||||||
// admin privilege setting.
|
// admin privilege setting.
|
||||||
func (c *SQLiteConn) AuthUserChange(username, password string, admin bool) error {
|
func (c *SQLiteConn) AuthUserChange(username, password string, admin bool) error {
|
||||||
isAdmin := 0
|
return errUserAuthNoLongerSupported
|
||||||
if admin {
|
|
||||||
isAdmin = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
rv := c.authUserChange(username, password, isAdmin)
|
|
||||||
switch rv {
|
|
||||||
case C.SQLITE_ERROR, C.SQLITE_AUTH:
|
|
||||||
return ErrAdminRequired
|
|
||||||
case C.SQLITE_OK:
|
|
||||||
return nil
|
|
||||||
default:
|
|
||||||
return c.lastError()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// authUserChange allows to modify a user.
|
// authUserChange allows to modify a user.
|
||||||
@@ -215,17 +119,7 @@ func (c *SQLiteConn) AuthUserChange(username, password string, admin bool) error
|
|||||||
// C.SQLITE_ERROR (1)
|
// C.SQLITE_ERROR (1)
|
||||||
// C.SQLITE_AUTH (23)
|
// C.SQLITE_AUTH (23)
|
||||||
func (c *SQLiteConn) authUserChange(username, password string, admin int) int {
|
func (c *SQLiteConn) authUserChange(username, password string, admin int) int {
|
||||||
// Allocate C Variables
|
return 1
|
||||||
cuser := C.CString(username)
|
|
||||||
cpass := C.CString(password)
|
|
||||||
|
|
||||||
// Free C Variables
|
|
||||||
defer func() {
|
|
||||||
C.free(unsafe.Pointer(cuser))
|
|
||||||
C.free(unsafe.Pointer(cpass))
|
|
||||||
}()
|
|
||||||
|
|
||||||
return int(C._sqlite3_user_change(c.db, cuser, cpass, C.int(len(password)), C.int(admin)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuthUserDelete can be used (by an admin user only)
|
// AuthUserDelete can be used (by an admin user only)
|
||||||
@@ -234,15 +128,7 @@ func (c *SQLiteConn) authUserChange(username, password string, admin int) int {
|
|||||||
// the database cannot be converted into a no-authentication-required
|
// the database cannot be converted into a no-authentication-required
|
||||||
// database.
|
// database.
|
||||||
func (c *SQLiteConn) AuthUserDelete(username string) error {
|
func (c *SQLiteConn) AuthUserDelete(username string) error {
|
||||||
rv := c.authUserDelete(username)
|
return errUserAuthNoLongerSupported
|
||||||
switch rv {
|
|
||||||
case C.SQLITE_ERROR, C.SQLITE_AUTH:
|
|
||||||
return ErrAdminRequired
|
|
||||||
case C.SQLITE_OK:
|
|
||||||
return nil
|
|
||||||
default:
|
|
||||||
return c.lastError()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// authUserDelete can be used to delete a user.
|
// authUserDelete can be used to delete a user.
|
||||||
@@ -258,25 +144,12 @@ func (c *SQLiteConn) AuthUserDelete(username string) error {
|
|||||||
// C.SQLITE_ERROR (1)
|
// C.SQLITE_ERROR (1)
|
||||||
// C.SQLITE_AUTH (23)
|
// C.SQLITE_AUTH (23)
|
||||||
func (c *SQLiteConn) authUserDelete(username string) int {
|
func (c *SQLiteConn) authUserDelete(username string) int {
|
||||||
// Allocate C Variables
|
return 1
|
||||||
cuser := C.CString(username)
|
|
||||||
|
|
||||||
// Free C Variables
|
|
||||||
defer func() {
|
|
||||||
C.free(unsafe.Pointer(cuser))
|
|
||||||
}()
|
|
||||||
|
|
||||||
return int(C._sqlite3_user_delete(c.db, cuser))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AuthEnabled checks if the database is protected by user authentication
|
// AuthEnabled checks if the database is protected by user authentication
|
||||||
func (c *SQLiteConn) AuthEnabled() (exists bool) {
|
func (c *SQLiteConn) AuthEnabled() (exists bool) {
|
||||||
rv := c.authEnabled()
|
return false
|
||||||
if rv == 1 {
|
|
||||||
exists = true
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// authEnabled perform the actual check for user authentication.
|
// authEnabled perform the actual check for user authentication.
|
||||||
@@ -289,7 +162,7 @@ func (c *SQLiteConn) AuthEnabled() (exists bool) {
|
|||||||
// 0 - Disabled
|
// 0 - Disabled
|
||||||
// 1 - Enabled
|
// 1 - Enabled
|
||||||
func (c *SQLiteConn) authEnabled() int {
|
func (c *SQLiteConn) authEnabled() int {
|
||||||
return int(C._sqlite3_auth_enabled(c.db))
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
|
|||||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -636,7 +636,7 @@ github.com/mattn/go-runewidth
|
|||||||
# github.com/mattn/go-shellwords v1.0.12
|
# github.com/mattn/go-shellwords v1.0.12
|
||||||
## explicit; go 1.13
|
## explicit; go 1.13
|
||||||
github.com/mattn/go-shellwords
|
github.com/mattn/go-shellwords
|
||||||
# github.com/mattn/go-sqlite3 v1.14.29
|
# github.com/mattn/go-sqlite3 v1.14.30
|
||||||
## explicit; go 1.19
|
## explicit; go 1.19
|
||||||
github.com/mattn/go-sqlite3
|
github.com/mattn/go-sqlite3
|
||||||
# github.com/mdlayher/socket v0.5.1
|
# github.com/mdlayher/socket v0.5.1
|
||||||
|
|||||||
Reference in New Issue
Block a user