mirror of
https://github.com/sqlite/sqlite.git
synced 2025-10-22 22:13:04 +03:00
<b>API Change:</b> Modify sqlite3_enable_load_extension() so that it only
enables/disables the load_extension() SQL function, and leaves the C-APIs enabled at all times. In this way, applications can enable extension loading for the C interface without having to expose that capability to the SQL. FossilOrigin-Name: edb454e45ae008e051e2f48d704a855b0c3e4be9
This commit is contained in:
@@ -1386,6 +1386,14 @@ static void loadExt(sqlite3_context *context, int argc, sqlite3_value **argv){
|
||||
sqlite3 *db = sqlite3_context_db_handle(context);
|
||||
char *zErrMsg = 0;
|
||||
|
||||
/* Disallow the load_extension function unless the SQLITE_LoadExtension
|
||||
** flag is set. See the sqlite3_enable_load_extension() API.
|
||||
*/
|
||||
if( (db->flags & SQLITE_LoadExtension)==0 ){
|
||||
sqlite3_result_error(context, "not authorized", -1);
|
||||
return;
|
||||
}
|
||||
|
||||
if( argc==2 ){
|
||||
zProc = (const char *)sqlite3_value_text(argv[1]);
|
||||
}else{
|
||||
|
Reference in New Issue
Block a user