Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake and make script won't export user authentication functions #133

Closed
taozuhong opened this issue Nov 24, 2023 · 3 comments
Closed

CMake and make script won't export user authentication functions #133

taozuhong opened this issue Nov 24, 2023 · 3 comments

Comments

@taozuhong
Copy link
Contributor

The library built by autotools script: missing most of functions
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-sqlite3mc/PKGBUILD
image

The library built by CMake script: missing user authentication functions only
image

Anything missing by me?

@utelle
Copy link
Owner

utelle commented Nov 24, 2023

The library built by autotools script: missing most of functions https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-sqlite3mc/PKGBUILD

Well, the autoconf/automake build files coming with sqlite3mc were originally not meant to be used on Windows platforms (MSYS). However, I agree that it would be nice to have them working there as well.

The library built by CMake script: missing user authentication functions only

The CMake script was adjusted recently to define the preprocessor symbol SQLITE_API=__declspec(dllexport) in case a shared/DLL library is built. The file Makefile.am needs to be adjusted to use the same approach under Windows.

As you observed this works for all API functions ... except the ones of the user authentication. The reason is that the functions of the user authentication API are not decorated with the symbol SQLITE_API.

To be frank I'm extremely sorry to have added the user authentication extension at all. It keeps causing issues all the time. This extension is provided by the SQLite core developer team, but it is not maintained well. There are flaws in the implementation, but bug reports are ignored.

Actually, the user authentication is not very useful, because it prevents unauthorized access only, if it was compiled into the SQLite library. If you access a database file, that was created with a user authentication enabled SQLite library, with a SQLite library that does not contain this extension, you can freely access all data in the database.

@taozuhong
Copy link
Contributor Author

Found that the user authentication functions missing prefix SQLITE_API, add it will be exported.

utelle added a commit that referenced this issue Nov 26, 2023
Under Windows a DLL build with autoconf/automake (MSYS) did not export the SQLite API properly.

All Windows build files have been adjusted to use the symbol SQLITE_API to define the API to be exported from a DLL, instead of using a .def file (which could cause various problems).
@utelle
Copy link
Owner

utelle commented Nov 26, 2023

Commit 85be37e should fix the issue with missing exported API functions.

The preprocessor symbol SQLITE_API is now used to flag public API functions.

@utelle utelle closed this as completed Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants