Bug 87530 - can't add password to macro library
Summary: can't add password to macro library
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.4.0.0.beta2
Hardware: x86 (IA32) All
: medium major
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:5.2.0 target:5.1.2 target:5.0.6
Keywords: bibisected, bisected, regression
: 92922 (view as bug list)
Depends on:
Blocks: 89710
  Show dependency treegraph
 
Reported: 2014-12-20 14:42 UTC by JO3EMC
Modified: 2021-05-20 06:39 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JO3EMC 2014-12-20 14:42:55 UTC
We can't "add" the password security to Basic Macro Library.

We checked reappearance of this probrem in 4.4.0.1 Writer/Calc/Draw on Windows8.1 and Calc on Debian Linux.

Steps to reproduce:

1. File> New> Text document
2. Tools> Macros> Organize> LibO Basic, click Organizer, tab Libraries, location:Untitled 1, click New, name Library1, Ok
(You can "set" the password at this time)
3. Save the document and *close it*.
4. Reopen the document
5. Tools> Macros> Organize> LibO Basic, click Organizer, tab Libraries, location:Untitled 1
6. do some operation related to password setting
(concrete examples are described after)
3. Save the document and *close it*.
4. Reopen the document
7. password setting has failed

Operation exampes in Step6 and there results:

1. make new Library, but don't set the password.
    * no problem. we can get expected result.

2. make new Library, and immediatery after that, set the password.
    * password lock will be lost.
    * Module following the Library will be absent.
    * illegal display of [LibreOffice Basic] window, opend with the [Edit] button in Organazer Libraries tab.

3. make new Library, and set the passowrd after edit the Library.
    * password lock will be lost, but contents of Library will be kept.

4. "add" the password to existing Library with no password.
    * password lock will be lost.
    * edit which made after the last Save befor set the password will be lost.
Comment 1 raal 2014-12-20 17:27:12 UTC
I can confirm with Version: 4.5.0.0.alpha0+
Build ID: 2116f1cfb31e5fcf829c2f101cd878a32b56c365
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-12-19_05:59:03

Tried 6./2. - I have both libraries, but without password

* password lock will be lost. -> setting higher priority
Comment 2 Gerhard Schaber 2015-03-18 11:00:28 UTC
I can confirm this as well.
Comment 3 Gerhard Schaber 2015-04-01 21:00:09 UTC
In OpenOffice a password can be set for a library. Once there is a password associated with the library, even LibreOffice keeps the password and handles everything correctly (except the 65k limit per module). The password is retained even after storing the library.
Comment 4 Gerhard Schaber 2015-05-28 15:55:18 UTC
It happened sometime between 4.1.1.2 and 4.2.8.2
Comment 5 Gerhard Schaber 2015-05-28 16:11:06 UTC
Maybe bugs #68983 and #42899.
Comment 6 Gerhard Schaber 2015-05-29 07:28:00 UTC
With 4.2.4.2 it works.
With 4.2.5.2 the whole content of the Basic library is lost after applying a password and reloading the ODB file.
With 4.2.8.2 the library is retained, but no password is applied. After reloading the ODB file, I can open the library without having to enter the password that I previously set.
Comment 7 Gerhard Schaber 2015-05-29 08:28:54 UTC
With 4.2.6.3 the whole content of the Basic library is lost after applying a password and reloading the ODB file.
Comment 8 nico13 2015-07-22 22:06:05 UTC
With 4.4.4.3 modules were lost in one try, and password is never saved.
Hope it will be fixed soon.
Comment 9 nico13 2015-07-23 08:29:51 UTC
Works in Apache OpenOffice 4.1.1
If the Library is protected in OpenOffice it has to be unlocked by password in Libreoffice Version 4.4.4.3.
Comment 10 Gerhard Schaber 2015-08-04 15:27:24 UTC
 93615bca59da819a9b93a6d3b9cc880ac6d9fdfa is the first bad commit
commit 93615bca59da819a9b93a6d3b9cc880ac6d9fdfa
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Sat Mar 14 19:47:06 2015 +0800

    source-hash-5246fa262450f686674850c53df666422f441c86
    
    commit 5246fa262450f686674850c53df666422f441c86
    Author:     Michael Stahl <mstahl@redhat.com>
    AuthorDate: Wed May 21 22:26:05 2014 +0200
    Commit:     Michael Stahl <mstahl@redhat.com>
    CommitDate: Thu May 22 13:12:55 2014 +0200
    
        fdo#68983: basic: if the library is not loaded fully, copy source storage
    
        Also fixes fdo#42899 and fdo#67685 in a different way; the previous fix
        for fdo#42899 caused the problem with password-protected libraries for
        which the password is not known: only the binary representation of the
        BAISC module was stored, not the source code; by simply copying from the
        source storage the problem can be avoided.
    
        It would be possible to ask for the password when storing, but that
        would not work when non-interactive (called via API).
    
        An alternative fix would be to pass in the
        SfxObjectShell::IsSetModifyEnabled() flag and actually reset the BASIC
        library's modify flag correctly, but that requires adding a
        parameter to XStorageBasedLibraryContainer::storeLibrariesToStorage().
    
        (regression from af34774d260a68fc02cd78ba90dd8d4afaf1a2a4 )
    
        Change-Id: I4701401f35171139fc2fe8d225d13d4e533091a0

:040000 040000 6e740902a1eae6647cd280d3727938dcac9ee46c 7bbf2b151d50f57c9f2a75075571235ee0c27c9c M	opt
Comment 11 Gerhard Schaber 2015-08-11 08:36:40 UTC
Michael, could you have a look into this, please?
Comment 12 Buovjaga 2015-08-11 13:26:32 UTC
*** Bug 92922 has been marked as a duplicate of this bug. ***
Comment 13 Gerhard Schaber 2015-09-15 08:28:49 UTC
Could anyone who knows the code have a look? The issue is already bibisected. The comment in the original check-in suggests another solution.

I would gladly test this and the other related issues fdo#42899 and fdo#67685 once a fix is available.
Comment 14 Gerhard Schaber 2015-11-20 19:06:06 UTC
Is password protection for macros officially still supported? This was broken 1,5 years ago.

Best regards,

Gerhard
Comment 15 Robinson Tryon (qubit) 2015-12-10 01:18:36 UTC Comment hidden (obsolete)
Comment 16 Gerhard Schaber 2016-03-06 21:40:52 UTC
Could you please fix that regression so that one does not need OpenOffice to create a password to use with LibreOffice?
Comment 17 Gerhard Schaber 2016-03-06 21:40:52 UTC Comment hidden (obsolete)
Comment 18 Gerhard Schaber 2016-03-06 21:41:09 UTC Comment hidden (obsolete)
Comment 19 Commit Notification 2016-03-07 11:09:43 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=aeb43916366b293935314efe9454c66b4877b9d1

basic: tdf#87530 don't copy storage that doesn't exist

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2016-03-07 11:09:48 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6a351c5cf91d0f667168d834ba2eb5c04121c7d5

basic: tdf#87530 if a new password is set, must set mbLoadedSource flag

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 Gerhard Schaber 2016-03-07 11:52:24 UTC
Wow, great. Many thanks. Much appreciated.

I just noticed that my previous comment apparently was sent three times. Sorry about that. No idea how this happened. I remember that I got a mid air collision message for my own comment for some reason.
Comment 22 Michael Stahl (allotropia) 2016-03-08 22:11:18 UTC
sorry that bug somehow removed itself from my todo-list...

the patch from comment #19 should fix the operation 2. from description
the patch from comment #20 should fix the operation 3./4. from description

fixed on master
Comment 23 Commit Notification 2016-03-08 22:13:05 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7faecc70c286c0e1a3068b77ccde771640928b37

tdf#87530 finish the regression test

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 24 Commit Notification 2016-03-09 09:58:28 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e93270fae07be68a92bdb7d6d964a54412ce983c&h=libreoffice-5-1

basic: tdf#87530 don't copy storage that doesn't exist

It will be available in 5.1.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 25 Commit Notification 2016-03-09 10:00:55 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a93f26304e21e257aaf6914e0f8607c80fb912af&h=libreoffice-5-1

basic: tdf#87530 if a new password is set, must set mbLoadedSource flag

It will be available in 5.1.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 26 Commit Notification 2016-03-09 10:14:20 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b3f2b2529dc4ed313f423d29551577b6dfed4258&h=libreoffice-5-0

basic: tdf#87530 don't copy storage that doesn't exist

It will be available in 5.0.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 27 Commit Notification 2016-03-09 10:16:48 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2317420ecee0bf2f01f1555fdaaa56dc9fd6a9c8&h=libreoffice-5-0

basic: tdf#87530 if a new password is set, must set mbLoadedSource flag

It will be available in 5.0.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.