Bug 158593 - Expert dialog crashes when editing locked down "set" configuration
Summary: Expert dialog crashes when editing locked down "set" configuration
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Stephan Bergmann
URL:
Whiteboard: target:24.8.0 target:24.2.0.0.beta2
Keywords: haveBacktrace
Depends on:
Blocks: Options-Dialog-Expert
  Show dependency treegraph
 
Reported: 2023-12-08 09:28 UTC by Gabor Kelemen (allotropia)
Modified: 2023-12-19 09:46 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
The example extensions keys are still editable (122.37 KB, image/png)
2023-12-08 09:28 UTC, Gabor Kelemen (allotropia)
Details
bt with debug symbols (11.92 KB, text/plain)
2023-12-08 16:14 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2023-12-08 09:28:15 UTC
Created attachment 191308 [details]
The example extensions keys are still editable

1. Install the attachment 156482 [details] from bug 129311, restart LO
2. Go to Options - Advanced - Expert configuration
3. Go to ooO - Common - Security - Scripting - TrustedAuthors
4. Under the a0 set, try to edit any of the RawData, SubjectName, SerialNumber keys
-> this is possible, since these are not greyed out, but the a0 node in the extension is locked down, so they should be
5. Press OK in the small edit box, then OK on the Expert Configuration
-> crash

Version: 24.2.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 0f82e9d42822e627edd1fb3b3c87e1f8a22136a4
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded

in 7.6 it just fell into an endless loop, so it was not good earlier either.
Comment 1 Julien Nabet 2023-12-08 16:14:21 UTC
Created attachment 191317 [details]
bt with debug symbols

On pc Debian x86-64 with master sources updated today, I got an assertion.

I also joined some console logs;
Comment 2 Julien Nabet 2023-12-08 16:48:01 UTC
I tried to find the root cause by using "catch throw" and got this:
#1  0x00007f5d734d2ecf in configmgr::Access::checkFinalized() (this=0x55ee3f1eb910) at configmgr/source/access.cxx:2218
#2  0x00007f5d734dafaa in configmgr::Access::replaceByName(rtl::OUString const&, com::sun::star::uno::Any const&)
    (this=0x55ee3fa34c90, aName="SubjectName", aElement=uno::Any("string": "test key - only signing1 <libreoffice@lists.freedesktop.org>")) at configmgr/source/access.cxx:1125
#3  0x00007f5d58a799dc in CuiAboutConfigTabPage::FillItemSet() (this=0x7ffdf8f83478) at cui/source/options/optaboutconfig.cxx:313
#4  0x00007f5d58b3c19f in SvxJavaOptionsPage::ExpertConfigHdl_Impl(weld::Button&) (this=0x55ee3fb4f930) at cui/source/options/optjava.cxx:304
#5  0x00007f5d58b38d9d in SvxJavaOptionsPage::LinkStubExpertConfigHdl_Impl(void*, weld::Button&) (instance=0x55ee3fb4f930, data=...) at cui/source/options/optjava.cxx:294
Comment 3 Julien Nabet 2023-12-08 16:59:04 UTC
Naive patch here:
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 6e3bdd9b2747..f153e46330c8 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -310,7 +310,14 @@ void CuiAboutConfigTabPage::FillItemSet()
         Reference<XNameAccess> xUpdateAccess = getConfigAccess((*pIter)->Name, true);
         Reference<XNameReplace> xNameReplace(xUpdateAccess, UNO_QUERY_THROW);
 
-        xNameReplace->replaceByName((*pIter)->Property, (*pIter)->Value);
+        try
+        {
+            xNameReplace->replaceByName((*pIter)->Property, (*pIter)->Value);
+        }
+        catch (css::lang::IllegalArgumentException)
+        {
+            SAL_WARN("cui.options", "configmgr modification of finalized item: " << (*pIter)->Name);
+        }
 
         Reference<util::XChangesBatch> xChangesBatch(xUpdateAccess, UNO_QUERY_THROW);
         xChangesBatch->commitChanges();


"naive" because it won't inform user it didn't work and not sure if it's the right way to fix this.

Can't help more here=>uncc myself
Comment 4 Commit Notification 2023-12-19 06:58:03 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f8199c424412f56edb1c64fada27e0c94d34fe79

tdf#158593 Make configmgr READONLY Property more useful

It will be available in 24.8.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.
Comment 5 Commit Notification 2023-12-19 09:46:50 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/f0601f55e04fd6fc29af4783404e57574732aae7

tdf#158593 Make configmgr READONLY Property more useful

It will be available in 24.2.0.0.beta2.

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.