| index 01c8ec9..624c641 100644 | | index 01c8ec9..624c641 100644 |
| --- a/src/plugin_sqlite.c | | --- a/src/plugin_sqlite.c |
| +++ b/src/plugin_sqlite.c | | +++ b/src/plugin_sqlite.c |
| @@ -65,7 +65,9 @@ | | @@ -65,7 +65,9 @@ |
| 65 | # define SX_ISDIR(m) S_ISDIR(m) | 65 | # define SX_ISDIR(m) S_ISDIR(m) |
| 66 | #endif | 66 | #endif |
| 67 | | 67 | |
| 68 | -#include "sqlite3.h" | 68 | +/* Relative include so the tree also builds without -I flags (the marketplace |
| | 69 | + * release CLI compiles every src and vendor C file in one command). */ |
| | 70 | +#include "../vendor/sqlite3.h" |
| 69 | | 71 | |
| 70 | #define PLUGIN_SLUG "sqlite" | 72 | #define PLUGIN_SLUG "sqlite" |
| 71 | #define PLUGIN_ID "plugin_sqlite" | 73 | #define PLUGIN_ID "plugin_sqlite" |
| @@ -507,6 +509,11 @@ static int authorizer_cb(void *ud, int action, const char *a1, const char *a2, | | @@ -507,6 +509,11 @@ static int authorizer_cb(void *ud, int action, const char *a1, const char *a2, |
| 507 | case SQLITE_RECURSIVE: | 509 | case SQLITE_RECURSIVE: |
| 508 | return SQLITE_OK; | 510 | return SQLITE_OK; |
| 509 | case SQLITE_FUNCTION: | 511 | case SQLITE_FUNCTION: |
| | 512 | + /* Extension loading is off by default and we never enable it, but a |
| | 513 | + * binary built without -DSQLITE_OMIT_LOAD_EXTENSION could still reach |
| | 514 | + * the function entry point. Name it and refuse it. */ |
| | 515 | + if (a2 && ci_prefix(a2, "load_extension") && !a2[14]) |
| | 516 | + return SQLITE_DENY; |
| 510 | return SQLITE_OK; | 517 | return SQLITE_OK; |
| 511 | case SQLITE_PRAGMA: | 518 | case SQLITE_PRAGMA: |
| 512 | return pragma_allowed(a1) ? SQLITE_OK : SQLITE_DENY; | 519 | return pragma_allowed(a1) ? SQLITE_OK : SQLITE_DENY; |
| 513 | | 520 | |