Bug 163135 - Soffice executable raises "Secure coding is automatically enabled for restorable state" warning when running in headless mode on MacOS Sonoma
Summary: Soffice executable raises "Secure coding is automatically enabled for restora...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
24.8.1.2 release
Hardware: ARM macOS (All)
: medium minor
Assignee: Patrick (volunteer)
URL:
Whiteboard: target:25.2.0 target:24.8.3 target:24...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-24 15:50 UTC by grace
Modified: 2024-09-25 12:15 UTC (History)
1 user (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 grace 2024-09-24 15:50:08 UTC
Description:
When running `soffice --headless --convert-to pdf --outdir <out> <source>` on MacOS Sonoma 14.6.1, libreoffice raises the following warning:

WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState

Based on this StackOverflow post, libreoffice needs to take action to address this MacOS requirement: https://stackoverflow.com/questions/77283578/sonoma-and-nsapplicationdelegate-applicationsupportssecurerestorablestate

This does not prevent usage of the software.

Steps to Reproduce:
1. Run `soffice --headless --convert-to pdf --outdir <out> <source>` on MacOS Sonoma


Actual Results:
Warning in stderr

Expected Results:
No stderr output


Reproducible: Always


User Profile Reset: No

Additional Info:
See related thread for matplotlib: https://github.com/matplotlib/matplotlib/issues/27389/
Comment 1 Patrick (volunteer) 2024-09-24 20:03:31 UTC
AFAICT, LibreOffice does not appear to use any of native "restorable state" data so I implemented -[NSApplicationDelegate applicationSupportsSecureRestorableState:] in the following patch so that LibreOffice will opt-in to secure coding:

https://gerrit.libreoffice.org/c/core/+/173882

I will commit that patch once it passes all of the automatic tests.
Comment 2 Commit Notification 2024-09-24 20:56:27 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2fc1034de4fd23d810593533b70ff674b0ccd706

tdf#163135 eliminate native "secure coding" warning

It will be available in 25.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.
Comment 3 Patrick (volunteer) 2024-09-24 21:00:49 UTC
I have committed my fix for this bug. The fix should be in tomorrow's (25 September 2024) nightly master builds:

https://dev-builds.libreoffice.org/daily/master/current.html

Notes for macOS testers:

The nightly master build installer does not overwrite any LibreOffice official versions. Instead, it will be installed as a separate application called "LibreOfficeDev" in the /Applications folder.

Because this is a "test" build, you will need to do the following steps before you launch the LibreOfficeDev application:

1. Go to the Finder and navigate to the /Applications/Utilities folder
2. Launch the "Terminal" application
3. Paste the following command in the Terminal application window and press the Return key to execute the command:

   xattr -d com.apple.quarantine /Applications/LibreOfficeDev.app
Comment 4 Commit Notification 2024-09-25 08:01:01 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/6d473ec78d180eceeead86bfa2487e8a32d43d65

tdf#163135 eliminate native "secure coding" warning

It will be available in 24.8.3.

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 2024-09-25 12:15:45 UTC
Patrick Luby committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/23294444065625ce4523b8b829c2594c90fe5b5b

tdf#163135 eliminate native "secure coding" warning

It will be available in 24.2.7.

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.