From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: master 3d38d1d: Add sqlite3 support to Emacs Date: Sun, 12 Dec 2021 22:44:14 -0500 Message-ID: References: <20211211035614.15517.53830@vcs0.savannah.gnu.org> <20211211035616.984DD20A0A@vcs0.savannah.gnu.org> <87ee6j4ty4.fsf@yahoo.com> <8735mz4o70.fsf@yahoo.com> <83k0gbr0dm.fsf@gnu.org> <87y24r33bn.fsf@yahoo.com> <87ilvu1ldh.fsf@yahoo.com> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15750"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, stefankangas@gmail.com, larsi@gnus.org, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 13 04:45:47 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mwcHa-0003vQ-KB for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Dec 2021 04:45:46 +0100 Original-Received: from localhost ([::1]:54622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mwcHZ-0006mo-92 for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Dec 2021 22:45:45 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwcG7-00043n-7U for emacs-devel@gnu.org; Sun, 12 Dec 2021 22:44:15 -0500 Original-Received: from [2001:470:142:3::e] (port=46410 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mwcG6-0006Rm-SW; Sun, 12 Dec 2021 22:44:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=jXGYLJPUFNWhvG+t6rEeeLoZrDMF5JVWm5fbm9fLRmg=; b=VUGwLQHHwF/j /VSZqDQHFXtoQ2bDdAwI9zqb3Hkr36cDfSgSA8eqQjFdl9LV+cOYiRzHbHl4gN9o2cDJLXSBjA18S YQVy8iq+arwnVSInZFSvW8AyVxVKK4g6jz5FjOrUa3olAskcC9AYOGYZO5Wo9gWNZoATUboLMPWZp FWA4oJMtkIi2/HrMozBxqcPWvDAMuuFoxgy73aLXKNrpWogqLs12OAbnkNSCR14eCK8kSMiZ3BxW1 1fGYme4hvt8P2EQ6kkzZn/nqtS+H/9dlWBpHdVJR5hA+2o/rdgUfMygSlX8c7K26edRyq9lABSqmC m+W8dRJTyX2nXucgOUHSZg==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1mwcG6-0003D4-Ty; Sun, 12 Dec 2021 22:44:14 -0500 In-Reply-To: <87ilvu1ldh.fsf@yahoo.com> (message from Po Lu on Sun, 12 Dec 2021 12:46:02 +0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281817 Archived-At: [[[ 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)