sqlite3 icon indicating copy to clipboard operation
sqlite3 copied to clipboard

Permission denied when trying to only allow access to a certain ffi path

Open prescientmoon opened this issue 1 year ago • 1 comments

Hi!

I am trying to use this library by passing --allow-ffi=THING where THING is the value I am passing to DENO_SQLITE_PATH. The script fails with the following error

error: Uncaught (in promise) PermissionDenied: Requires ffi access, run again with the --allow-ffi flag
export const SQLITE_VERSION = readCstr(sqlite3_libversion()!);
                              ^
    at getCString (ext:deno_ffi/00_ffi.js:159:16)
    at https://deno.land/x/[email protected]/src/database.ts:103:31

I am running on nixos, and deno --version shows

deno 1.39.1 (release, x86_64-unknown-linux-gnu)
v8 12.0.267.8
typescript 5.3.3

prescientmoon avatar Jan 01 '24 21:01 prescientmoon

I think we're not allowed to use the UnsafePointer and related APIs when you pass a specific path for --allow-ffi - possibly something that needs fixing in Deno itself than deno_sqlite3.

DjDeveloperr avatar Jan 08 '24 20:01 DjDeveloperr

This issue is not something this library can fix, closing

DjDeveloperr avatar May 25 '25 21:05 DjDeveloperr