emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 3d38d1d: Add sqlite3 support to Emacs


From: Richard Stallman
Subject: Re: master 3d38d1d: Add sqlite3 support to Emacs
Date: Sun, 12 Dec 2021 22:44:14 -0500

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > No, I'm proposing to modify the free plug-ins to define this symbol, and
  > then to make Emacs to check for it before telling SQLite to load the
  > plugin.  It would work the same, and it'd also be much easier than
  > modifying SQLite and having to maintain the modified version, and so on
  > and so forth.

I don't think that is legally adequate.  I have an idea for a solution
to that problem, but I need to check it with a lawyer first.

For the mean time, Emacs _should not_ offer any interface to load
sqlite3 extensions.

But eliminating that is _not_ enough to solve the problem, because
sqlite3 offers another way to load one!  It defines an SQL function,
load_extension, to load an extension.  Whatever testing that Emacs
would try to do on an extension before loading it, load_extension
would bypass it.

Is there a way we can undefine that SQL function?  The equivalent of
fmakunbound in Lisp?

Is there a way Emacs can delete that function from the SQL function
table before the user can run any SQL code?

Does SQL have a way undefine a function?  If so, Emacs could run the
SQL to undefine that function, before it lets the user run any SQL
code.

Not as nice, because less modular: Emacs could patch the SQL function
table "by hand" to remove that definition.

We could patch the code in sqlite3 that loads extensions to make it
call a hook, and ask the developers to include it so that we can
use the standard version of sqlite3.  For the mean time, we would
need to use the patched version.

The clean way to do this is to add a C function to sqlite3 which you
call with a pointer to your hook function.  That would be an upward
compatible change to sqlite3, thus no trouble for upstream.

Since Emacs will call this C function, this will prevent simply
linking Emacs with the unmodified sqlite3.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]