xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_enable_load_extension.3 (revision 82d56013d7b633d116a93943de88e08335357a7c)
1.Dd December 19, 2018
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.Ft int
9.Fo sqlite3_enable_load_extension
10.Fa "sqlite3 *db"
11.Fa "int onoff"
12.Fc
13.Sh DESCRIPTION
14So as not to open security holes in older applications that are unprepared
15to deal with extension loading, and as a means of
16disabling extension loading while evaluating user-entered
17SQL, the following API is provided to turn the sqlite3_load_extension()
18mechanism on and off.
19.Pp
20Extension loading is off by default.
21Call the sqlite3_enable_load_extension() routine with onoff==1 to turn
22extension loading on and call it with onoff==0 to turn it back off
23again.
24.Pp
25This interface enables or disables both the C-API sqlite3_load_extension()
26and the SQL function load_extension().
27Use sqlite3_db_config(db,SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION,..)
28to enable or disable only the C-API.
29.Pp
30\fBSecurity warning:\fP It is recommended that extension loading be disabled
31using the SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
32method rather than this interface, so the load_extension()
33SQL function remains disabled.
34This will prevent SQL injections from giving attackers access to extension
35loading capabilities.
36.Sh SEE ALSO
37.Xr sqlite3_db_config 3 ,
38.Xr sqlite3_load_extension 3 ,
39.Xr SQLITE_DBCONFIG_MAINDBNAME 3
40