sysui/desktop/macosx/LaunchConstraint.plist.in |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 25fc475be265d44487f569c7b61a304eecb4ea9c
Author:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
AuthorDate: Fri Jul 4 18:10:18 2025 +0200
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Fri Jul 4 18:30:46 2025 +0200

    tdf#167080 macOS: fix opening PDFs in signed builds
    
    the parent-launch constraints worked for their intended purpose, but for
    the wrong reason. External launches weren't blocked because the parent
    didn't match the constraints, but because the parent didn't have stuff
    defined/stuff that the OS didn't recognize. And that then also blocked
    the xpdfimport helper, which is used to import PDFs into LibreOffice.
    
    The parent-constraints are set via the --launch-constraint-parent flag
    when running codesign, but was also added as an additional dict layer in
    the plist file, and that apparently is not valid, but still accepted.
    
    In Console.app, the block should be logged with
    
    c[4]p[2]m[1]e[0], (Constraint not matched)
    
    constraint identifier 4, i.e. launch constraint
    process identifier 2, i.e. related to the parent process
    match result 1, i.e. the launch constraints not matched
    error code 0, i.e. no error
    
    instead it was
    c[4]p[2]m[5]e[5], (parent-constraints)
    a generic parent-constraints error with
    match result 5, "The operating system couldn’t match the executable file
    with the constraint, because the constraint contains a non-optional fact
    that isn’t defined for the executable file."
    so far no difference to the expected validation error, but the
    error code is 5, "The launch constraint contains a fact that the
    operating system doesn’t recognize."
    So even LibreOffice itself didn't qualify as a parent process and the
    xpdfimport helper was blocked.
    
    see also:
    
https://developer.apple.com/documentation/security/applying-launch-environment-and-library-constraints
    
    Change-Id: I0debdb87f04a69f58fcb543d027bdc3b9a4ea0cc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187412
    Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    (cherry picked from commit 14b5fa6d6cadd8be1c62017c4d500903b4a6f386)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187415

diff --git a/sysui/desktop/macosx/LaunchConstraint.plist.in 
b/sysui/desktop/macosx/LaunchConstraint.plist.in
index c10bdfede58b..2272a297bdee 100644
--- a/sysui/desktop/macosx/LaunchConstraint.plist.in
+++ b/sysui/desktop/macosx/LaunchConstraint.plist.in
@@ -11,13 +11,10 @@
 <plist version="1.0">
 <dict>
 <!-- require the parent process to be LibreOffice -->
-    <key>parent-constraints</key>
-    <dict>
-        <key>signing-identifier</key>
-        <string>@MACOSX_BUNDLE_IDENTIFIER@</string>
-        <key>team-identifier</key>
-        <string>@MACOSX_CODESIGNING_TEAM_IDENTIFIER@</string>
-    </dict>
+    <key>signing-identifier</key>
+    <string>@MACOSX_BUNDLE_IDENTIFIER@</string>
+    <key>team-identifier</key>
+    <string>@MACOSX_CODESIGNING_TEAM_IDENTIFIER@</string>
 </dict>
 </plist>
 <!-- vim:set shiftwidth=4 softtabstop=4 expandtab: -->

Reply via email to