Feature Request: Exposing C function sqlite3_load_extension to Java

Aperta
#317 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java, sqlite
Ambito
database

Direzione di ricerca

Start by reading the SQLite C API documentation linked in the issue and tracing how sqlite-jdbc exposes native SQLite functions to Java. The issue proposes a Java-accessible way to load extensions while keeping SQL load_extension disabled; determine the appropriate API and how it should be exposed. Done means extensions can be loaded through Java without enabling the SQL function.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement:SQLite help wanted impacts:JNI

I need to load a SQLite extension.
With sqlite-jdbc, I can enable the SQL function load_extension to achieve this. However, this is not recommended as it increases the attack surface when a SQL injection is possible.
(SQL injections should be avoided anyway but humans make mistakes ...)

SQLite provides the C function
int sqlite3_load_extension(sqlite3 *db, const char *zFile, const char *zProc, char **pzErrMsg);
https://sqlite.org/c3ref/load_extension.html
to load extensions. This could be used to load extensions from Java but not from a SQL statement.

Loading of extensions can be enabled by C API and at the same time disabled by SQL queries.
https://www.sqlite.org/c3ref/enable_load_extension.html
https://www.sqlite.org/c3ref/c_dbconfig_enable_fkey.html (SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION)

Lingua principale
Java
Stelle
3.3k
Fork
676
Merge medio
1g 15h
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di xerial/sqlite-jdbc

Tutte le issue di xerial/sqlite-jdbc

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.