Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sandbox custom qlgenerator (Quick look) plugin

How to sandbox quick look plugin on mavericks?

Currently obtaining following error message:

2014-04-14 16:26:50.507 qlmanage[5601:303] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x8b13, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.

2014-04-14 16:26:50.512 qlmanage[5601:303] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x3f0f, name = 'com.apple.CFPasteboardClient'
See /usr/include/servers/bootstrap_defs.h for the error codes.

2014-04-14 16:26:50.512 qlmanage[5601:303] Failed to allocate communication port for com.apple.CFPasteboardClient; this is likely due to sandbox restrictions

Following entitlement is defined at Xcode's "Code Signing Entitlements" build setting, still observed above error message:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
    <array>
        <string>com.apple.CFPasteboardClient</string>
        <string>com.apple.tsm.portname</string>
    </array>
</dict>
</plist>
like image 995
Lakshmi Avatar asked Apr 14 '14 11:04

Lakshmi


1 Answers

While this doesn't solve the original issue let me add some updates on the current status of standalone QuickLook plugins development in 2019 that could have saved me a lot of time when I reached this answer.

  • The com.apple.tsm.portname error is still there but it doesn't seem to cause issues once the plugin is installed in one of the Library/Quicklook locations. The plugin will work anyway.
  • If you are developing a standalone plugin (not inside an app) you wouldn't even have entitlements, so don't try to mess with those to solve this issue.
  • Debugging with qlmanage -p <file> seems to be completely broken at least in Mojave if you use the kUTTypeHTML data representation (kUTTypeRTF works), nothing is displayed but when you copy the plugin under Library it will work normally...
  • Still impossible to use Swift to implement the generators (the last officially provided motivation points to lack of ABI stability (lol))
like image 88
Saltama Avatar answered Nov 02 '22 04:11

Saltama