Description: After installing password protection on the macro library (MyLibrary (built into the document)) when trying to load this library: ThisComponent.BasicLibraries.LoadLibrary("MyLibrary") An error appears: Invalid value or data type. Incompatible type. Library macros don't work. Steps to Reproduce: 1.Download the Cyanopica ZIP archive.zip and unzip it (anywhere). 2.Import the Library1 library and move the StartSet module from It to the Standard global library (ReadMe.txt). 3.Launch the Cyanopica.odb database Actual Results: Error connecting the macro library with password protection. Expected Results: The database is being started. Opens and configures the main form for working with the database. Reproducible: Always User Profile Reset: Yes Additional Info: If you remove password protection from the macro library, the database works normally.
Created attachment 164348 [details] Database with a secure library A database with a built-in mylibrary macro library that is password-protected. The password for the library is 111. To start the database, you need to import the startset macro model (from the attached Library1 library) to the Standard global library.
Created attachment 164360 [details] Password-protected library with custom type with array data field Reproducible. This is caused by a fixed-type array data field in a custom type in the protected library. The attachment is a minimal reproducer. It contains two libraries: Library1 (password-protected; password is "123" without quotes), and Standard. Library1 contains a single module with only one definition of a custom type: > Type TFail > i(0) As Integer ' Fails when this password-protected library is loaded > End Type Library Standard contains sub Main, which only loads the password-protected library: > Sub Main > ThisComponent.BasicLibraries.LoadLibrary("Library1") > End Sub This sub is executed when the button is clicked in the document. The problem happens in SbiImage::Load (case FileOffset::UserTypes), which calls pTypeElem->PutObject.
Regression after https://git.libreoffice.org/core/+/8a7b7b7b72c299bc9a96815814c1452be7f662c1.
Or rather implementation error.
The reference code, which runs when the library is not protected, is in SbiParser::DefType.
https://gerrit.libreoffice.org/c/core/+/100877
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d7d9d3cf1a529cfe99fb1b5ae65967c54e9f23bb tdf#135799: properly load arrays in user-defined types from image It will be available in 7.1.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.
When you try to unblock a protected library, the LO crashes. ThisDatabaseDocument = ThisComponent If ThisDatabaseDocument.BasicLibraries.isLibraryPasswordProtected("MyLibrary") Then ThisDatabaseDocument.BasicLibraries.verifyLibraryPassword("MyLibrary",Pass) The library is not protected. It doesn't cause any errors, but the library remains unprotected. If ( NOT ThisDatabaseDocument.BasicLibraries.isLibraryPasswordProtected("MyLibrary")) Then ThisDatabaseDocument.BasicLibraries.changeLibraryPassword("MyLibrary",Ps,Pass) '
Created attachment 164549 [details] The option with the secure library in which the collapse.
The latest version of the database (Cyanopica_pass) does not require additional libraries. You just need to unzip it and run it. If you have a global macro library named "MyLibrary", delete it or move it. Otherwise, the database will not work.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-7-0": https://git.libreoffice.org/core/commit/c6d7efe327820744f03a0fd6d2e68f74e97e2914 tdf#135799: properly load arrays in user-defined types from image It will be available in 7.0.2. 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.