1.Dd January 24, 2024 2.Dt SQLITE3_ENABLE_LOAD_EXTENSION 3 3.Os 4.Sh NAME 5.Nm sqlite3_enable_load_extension 6.Nd enable or disable extension loading 7.Sh SYNOPSIS 8.In sqlite3.h 9.Ft int 10.Fo sqlite3_enable_load_extension 11.Fa "sqlite3 *db" 12.Fa "int onoff" 13.Fc 14.Sh DESCRIPTION 15So as not to open security holes in older applications that are unprepared 16to deal with extension loading, and as a means of 17disabling extension loading while evaluating user-entered 18SQL, the following API is provided to turn the 19.Fn sqlite3_load_extension 20mechanism on and off. 21.Pp 22Extension loading is off by default. 23Call the sqlite3_enable_load_extension() routine with onoff==1 to turn 24extension loading on and call it with onoff==0 to turn it back off 25again. 26.Pp 27This interface enables or disables both the C-API 28.Fn sqlite3_load_extension 29and the SQL function 30.Fn load_extension . 31Use sqlite3_db_config(db,SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION,..) 32to enable or disable only the C-API. 33.Pp 34\fBSecurity warning:\fP It is recommended that extension loading be enabled 35using the SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION 36method rather than this interface, so the 37.Fn load_extension 38SQL function remains disabled. 39This will prevent SQL injections from giving attackers access to extension 40loading capabilities. 41.Sh IMPLEMENTATION NOTES 42These declarations were extracted from the 43interface documentation at line 7180. 44.Bd -literal 45SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff); 46.Ed 47.Sh SEE ALSO 48.Xr sqlite3_db_config 3 , 49.Xr sqlite3_load_extension 3 , 50.Xr SQLITE_DBCONFIG_MAINDBNAME 3 51