Description: In LibreOffice if you open a Base file and connect with a different account than the one you saved and which is displayed in the authentication dialog and then close the Base file then you will be unable to reopen this Base file again without having to restart LibreOffice. Steps to Reproduce: You need to connect to the database with two different accounts in order to reproduce this little inconvenience. We can say user1 and user2. Important: their password must be different... 1. Open an odb file in LibreOffice normally used by user1 but with the user2. 2. Close this odb file. 3. Try to reopen this odb file. 4. You will never be able to Actual Results: If you log in with an account that is not the account saved in the odb file and after closing this file you try to reopen it, it will not be possible to log in again. Expected Results: When reopening a file in Base if the connection fails, then the authentication dialog should reappear. Reproducible: Always User Profile Reset: Yes Additional Info: The workaround for this problem is to close LibreOffice and reopen it... On the other hand, if both users have the same password, then you will see that when you open the odb file for the second time, you are connected with user1 but Base keep in cache the password of user2. Unfortunately, this cannot work.
So that there is no doubt when I say open an odb file: it is opening the file and trying to display the tables in the Base browser, in short to connect to the database.
I haven't tried it yet, but I'm pretty sure it can be reproduced like this: 1. Open an ODB file 2. Close this ODB file. 3. Change your database password. 4. You won't be able to reopen the ODB file without restarting LibreOffice.
At first glance I thought caching the username would be sufficient but that won't handle the case of a password change.
Created attachment 202362 [details] HsqlDB LibreOffice JDBC odb file
Created attachment 202363 [details] HsqlDB Java driver
Created attachment 202364 [details] HsqbDB database data zip files
It seems difficult to reproduce with MariaDB, so I'm providing all the elements needed to reproduce this with LibreOffice's native JDBC driver and the HsqlDB database driver. You will find three attached files: - An odb file (file: HsqlDB LibreOffice JDBC.odb) to connect to the data file. Before any connection you will need to change the database path to the folder where you unzipped HsqlDB database data file (ie: Open the odb and go to: Edit -> Database -> Properties -> General) - An HsqlDB database data file (file: hsqldb.data.zip) that must be unzipped into a folder. The name of this database is: db, and therefore the path to enter in the database path must end with: /db This database has three users: - SA, an administrator user with no password. - USER: a user with no privileges (except for logging in) with the password: user - TEST: a user with no privileges (except for logging in) with the password: test - The JDBC driver for the HsqlDB database (file: hsqldb.jar), which must first be added to the Java ClassPath (ie: In LibreOffice go to: Tools -> Options -> LibreOffice -> Advanced -> Class Path -> Add Archive). The class name is: org.hsqldb.jdbc.JDBCDriver
Here's a chronological explanation of what happens when opening an ODB file in LibreOffice. When opening a Base file for the first time, the following method will be executed: - ODatabaseSource::connectWithCompletion: with the entered username and password. When closing this Base file, the following method will be executed: - ODatabaseContext::storeTransientProperties: and the Password property will be stored. When opening the file again, the connection will be made using the method: - ODatasourceConnector::connect: With the username from the ODB file and the password from the cache. You'll never be able to go beyond this point with LibreOffice if you log in the first time with a user other than the one provided. To fix this problem: - I detect in ODatabaseSource::connectWithCompletion when an unknown user (other than the one in the odb file) is logged in. - And if detected, I don't cache the password when closing in ODatabaseContext::storeTransientProperties I haven't found anything simpler to do...
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/5b064206d83c6854e292e93de168fbf802201e5b tdf#167960: store also username associated with this password It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d4e478e4b501ec6c6e928fb3f3564be5f44666f4 Revert "tdf#167960: store also username associated with this password" It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
prrvchr committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/04d2a7d2f6a20bc69b7876e9c502c627e83e9f8f tdf#167960 The password of an unknown user is no longer stored It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.