Skip to content

Commit a9775d4

Browse files
committed
return error
1 parent c857a95 commit a9775d4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sqlite3_opt_userauth.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const (
2929
var (
3030
ErrUnauthorized = errors.New("SQLITE_AUTH: Unauthorized")
3131
ErrAdminRequired = errors.New("SQLITE_AUTH: Unauthorized; Admin Privileges Required")
32+
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").
3233
)
3334

3435
// Authenticate will perform an authentication of the provided username
@@ -45,7 +46,7 @@ var (
4546
// If the SQLITE_USER table is not present in the database file, then
4647
// this interface is a harmless no-op returning SQLITE_OK.
4748
func (c *SQLiteConn) Authenticate(username, password string) error {
48-
return ErrUnauthorized
49+
return errUserAuthNoLongerSupported
4950
}
5051

5152
// authenticate provides the actual authentication to SQLite.
@@ -70,7 +71,7 @@ func (c *SQLiteConn) authenticate(username, password string) int {
7071
// for any ATTACH-ed databases. Any call to AuthUserAdd by a
7172
// non-admin user results in an error.
7273
func (c *SQLiteConn) AuthUserAdd(username, password string, admin bool) error {
73-
return ErrUnauthorized
74+
return errUserAuthNoLongerSupported
7475
}
7576

7677
// authUserAdd enables the User Authentication if not enabled.
@@ -97,7 +98,7 @@ func (c *SQLiteConn) authUserAdd(username, password string, admin int) int {
9798
// credentials or admin privilege setting. No user may change their own
9899
// admin privilege setting.
99100
func (c *SQLiteConn) AuthUserChange(username, password string, admin bool) error {
100-
return ErrUnauthorized
101+
return errUserAuthNoLongerSupported
101102
}
102103

103104
// authUserChange allows to modify a user.
@@ -127,7 +128,7 @@ func (c *SQLiteConn) authUserChange(username, password string, admin int) int {
127128
// the database cannot be converted into a no-authentication-required
128129
// database.
129130
func (c *SQLiteConn) AuthUserDelete(username string) error {
130-
return ErrUnauthorized
131+
return errUserAuthNoLongerSupported
131132
}
132133

133134
// authUserDelete can be used to delete a user.

0 commit comments

Comments
 (0)