Re: Mojave Privileged Helper Tool - full disk access

2018-09-07 Thread Mark Allan
So I worked out most of this for myself. My privileged helper tool is only executable by root. If I set it to world-executable, then it's possible to drag and drop it into the Full Disk Access panel. Still can't get it to show up when pressing the add/plus (+) button, but that&#

Mojave Privileged Helper Tool - full disk access

2018-09-06 Thread Mark Allan
Hi All, I have an app with a privileged helper tool which needs full disk access in 10.14 Mojave. The privileged helper tool is (as you'd expect) a binary rather than an app bundle, so it's not showing up when I press the plus (+) button in Security & Privacy -> Privacy -&

Re: Problem using NSTimer in privileged helper tool

2017-10-22 Thread Uli Kusterer
> This causes my privileged helper tool to crash with the following message > printed to Console: > > Terminating app due to uncaught exception 'NSInvalidArgumentException', > reason: '*** -[NSXPCEncoder _checkObject:]: This coder only encodes objects > that ad

Re: Problem using NSTimer in privileged helper tool

2017-10-21 Thread Jean-Daniel
> Le 20 oct. 2017 à 18:56, Quincey Morris > a écrit : > > On Oct 20, 2017, at 03:23 , Mark Allan wrote: >> >> That worked with the block-based NSTimer API but not the selector-based API. >> I tried changing it to 'currentRunLoop' which got rid of the crash, but the >> timer never fired. >

Re: Problem using NSTimer in privileged helper tool

2017-10-20 Thread Jens Alfke
> On Oct 20, 2017, at 9:56 AM, Quincey Morris > wrote: > > — When you scheduled the timer on the main run loop, it was actually being > scheduled on the main app’s run loop. When it was block based, only the block > had to be passed across the XPC interface (which somehow works), but when it

Re: Problem using NSTimer in privileged helper tool

2017-10-20 Thread Quincey Morris
On Oct 20, 2017, at 03:23 , Mark Allan wrote: > > That worked with the block-based NSTimer API but not the selector-based API. > I tried changing it to 'currentRunLoop' which got rid of the crash, but the > timer never fired. This is pure guesswork, but I suspect this is what was going on: —

Re: Problem using NSTimer in privileged helper tool

2017-10-20 Thread Mark Allan
(sending again - the list was missed off the 'cc' in my reply) > On 19 Oct 2017, at 6:19 pm, Jens Alfke > wrote: > >> On Oct 19, 2017, at 9:04 AM, Mark Allan > > wrote: >> >> Initially, I thought this meant my own class needed to conform t

Re: Problem using NSTimer in privileged helper tool

2017-10-20 Thread Mark Allan
> On 19 Oct 2017, at 6:05 pm, Quincey Morris > wrote: > > On Oct 19, 2017, at 09:04 , Mark Allan > wrote: >> >> Terminating app due to uncaught exception 'NSInvalidArgumentException', >> reason: '*** -[NSXPCEncoder _checkObject:]: This coder only encodes objects

Re: Problem using NSTimer in privileged helper tool

2017-10-19 Thread Quincey Morris
On Oct 19, 2017, at 09:04 , Mark Allan wrote: > > Terminating app due to uncaught exception 'NSInvalidArgumentException', > reason: '*** -[NSXPCEncoder _checkObject:]: This coder only encodes objects > that adopt NSSecureCoding (object is of class '__NSCFTimer').' It’s very suspicious that the

Re: Problem using NSTimer in privileged helper tool

2017-10-19 Thread Alex Zavatone
; I'm currently writing a Mac app which performs some lengthy process on some > data, and for a variety of reasons it needs to do this via privileged helper > tool. > > The class which does the work sends progress updates periodically to its > delegate, which then comm

Problem using NSTimer in privileged helper tool

2017-10-19 Thread Mark Allan
Hi all, I'm currently writing a Mac app which performs some lengthy process on some data, and for a variety of reasons it needs to do this via privileged helper tool. The class which does the work sends progress updates periodically to its delegate, which then communicates these back t

Re: Yet another privileged-helper-tool question: how to launch from a system-preferences panel?

2016-01-22 Thread Damien DeVille
aunch a privileged launchd > daemon. > > I build both the preferences panel and my helper tool in the same way, and > apply (using the attached python script) the “trust” entries of both > info.plist files (of my preferences panel and the helper tool). It all runs - > but fails to l

Re: Yet another privileged-helper-tool question: how to launch from a system-preferences panel?

2016-01-14 Thread Motti Shneor
On Jan 13, 2016, at 9:42 AM, Motti Shneor wrote: >> >> Hi. >> >> I tried to modify the SMJobBless sample from Apple to use a >> System-Preference panel, instead of an independent Cocoa App, to launch a >> privileged launchd daemon. >> >> I build both th

Yet another privileged-helper-tool question: how to launch from a system-preferences panel?

2016-01-13 Thread Motti Shneor
Hi. I tried to modify the SMJobBless sample from Apple to use a System-Preference panel, instead of an independent Cocoa App, to launch a privileged launchd daemon. I build both the preferences panel and my helper tool in the same way, and apply (using the attached python script) the “trust

Re: Communicating with Privileged Helper Tool

2016-01-07 Thread Damien DeVille
root domain. I’m not sure how to achieve this with `CFMachPort` directly… You mentioned supporting 10.6, if you’re able to bump it to 10.7 I’d suggest going with xpc. > The helper tool *is* launched by launchd, however if I add the MachService > name to the plist, won't that mean the co

Re: Communicating with Privileged Helper Tool

2015-12-23 Thread Mark Allan
nLoopSource, kCFRunLoopCommonModes); I know the port is getting created, as I can connect from another GUI app, I just can't connect from the helper tool. I'm using the following to try and connect to it from the helper tool: CFMessagePortRef remotePort = CFMessagePortCreate

Communicating with Privileged Helper Tool

2015-12-23 Thread Mark Allan
Hi all, I've got a an OS X application that needs to perform some privileged operations, so I've written a privileged helper tool (PHT) and it all works fine to call the necessary functions from my user-land application and get the response. What I'm struggling with is

Helper tool

2015-12-03 Thread Jonathan Mitchell
I need to install a persistent always on launch daemon/agent for my app that queries an external URL and optionally communicates with the app if it is running. Is EvenBetterAuthorizationSample the current best practice? J ___ Cocoa-dev

Re: RunLoop in Helper Tool

2013-09-16 Thread Marcel Weiher
On Sep 16, 2013, at 9:12 , Uli Kusterer wrote: > On 16 Sep 2013, at 01:10, Greg Parker wrote: >> And of course every Cocoa app halts by calling exit(). NSApplicationMain() >> never returns. (I'm pretty sure it doesn't attempt to stop the main run >> loop, either.) > > It does go and close al

Re: RunLoop in Helper Tool

2013-09-16 Thread Uli Kusterer
On 16 Sep 2013, at 01:10, Greg Parker wrote: > And of course every Cocoa app halts by calling exit(). NSApplicationMain() > never returns. (I'm pretty sure it doesn't attempt to stop the main run loop, > either.) It does go and close all documents and send NSApplicationWillTerminateNotificati

Re: RunLoop in Helper Tool

2013-09-15 Thread Greg Parker
On Sep 15, 2013, at 10:50 AM, Marcel Weiher wrote: > On Sep 15, 2013, at 17:04 , Kevin Meaney wrote: >> On 15 Sep 2013, at 15:30, Marcel Weiher wrote: >>> Do all the cleanup you want to do and then exit(0) ? >> >> I was doing exit(0) but after reading this discussion I thought it would be >>

Re: RunLoop in Helper Tool

2013-09-15 Thread Marcel Weiher
On Sep 15, 2013, at 17:04 , Kevin Meaney wrote: > On 15 Sep 2013, at 15:30, Marcel Weiher wrote: >> Do all the cleanup you want to do and then exit(0) ? > > I was doing exit(0) but after reading this discussion I thought it would be > cleaner to do the CFRunLoopStop on the main thread. I al

Re: NSDistributedNotificationCenter and Helper Tool

2013-09-15 Thread Gerriet M. Denkmann
nn > wrote: > >> I have a Helper Tool, running as root, started via SMJobBless and >> communicating vie Xpc. >> >> Sometimes it does: >> >> [[NSOperationQueue mainQueue] addOperationWithBlock:^ >> { >> NSDistributedNotificat

Re: NSDistributedNotificationCenter and Helper Tool

2013-09-15 Thread Jeff Johnson
Hi Gerriet. You need to use the option NSNotificationPostToAllSessions. -Jeff On Sep 15, 2013, at 12:15 PM, Gerriet M. Denkmann wrote: > I have a Helper Tool, running as root, started via SMJobBless and > communicating vie Xpc. > > Sometimes it does: > > [[NSOperat

NSDistributedNotificationCenter and Helper Tool

2013-09-15 Thread Gerriet M. Denkmann
I have a Helper Tool, running as root, started via SMJobBless and communicating vie Xpc. Sometimes it does: [[NSOperationQueue mainQueue] addOperationWithBlock:^ { NSDistributedNotificationCenter *d = [ NSDistributedNotificationCenter defaultCenter

Re: Helper tool

2013-09-15 Thread Seth Willits
On Sep 15, 2013, at 2:02 AM, Gerriet M. Denkmann wrote: >>> I have a helper tool (started via SMJobBless from the main app). >>> >>> Its launchd.plist contains (no idea why, probably I copied this from some >>> sample code): >>> LaunchOnlyOnc

Re: RunLoop in Helper Tool

2013-09-15 Thread Jean-Daniel Dupas
LoopGetMain()); > Tried it. Even tried stopping both run loops, but to no avail. The helper > tool just will not quit. > > But maybe I will be able to make my NSTimers work now having a better > understanding of what is going on. > Now that you mention it, I remember it is n

Re: RunLoop in Helper Tool

2013-09-15 Thread Kevin Meaney
then I've been wondering why LaunchAgent doesn't stop. Back to exit(0) it is. Kevin On 15 Sep 2013, at 15:30, Marcel Weiher wrote: > On Sep 15, 2013, at 10:32 , Gerriet M. Denkmann wrote: > >> I have a Helper Tool, running as root, started via SMJobBless and >> co

Re: RunLoop in Helper Tool

2013-09-15 Thread Marcel Weiher
On Sep 15, 2013, at 10:32 , Gerriet M. Denkmann wrote: > I have a Helper Tool, running as root, started via SMJobBless and > communicating vie Xpc. > > Works fine, but: > 1. it cannot stop (CFRunLoopStop), Do all the cleanup you want to do and then exi

Re: RunLoop in Helper Tool

2013-09-15 Thread Gerriet M. Denkmann
nLoopGetMain (); // mode = kCFRunLoopDefaultMode > Try that instead: CFRunLoopStop(CFRunLoopGetMain()); Tried it. Even tried stopping both run loops, but to no avail. The helper tool just will not quit. But maybe I will be able to make my NSTimers work now

Re: RunLoop in Helper Tool

2013-09-15 Thread Jean-Daniel Dupas
sept. 2013 à 10:32, Gerriet M. Denkmann a écrit : > I have a Helper Tool, running as root, started via SMJobBless and > communicating vie Xpc. > > Works fine, but: > 1. it cannot stop (CFRunLoopStop), > 2. Timers never fire > 3. NSRunLoop currentMode returns nil. > >

Re: Helper tool

2013-09-15 Thread Gerriet M. Denkmann
> On Sep 13, 2013, at 6:47 AM, Gerriet M. Denkmann wrote: > >> I have a helper tool (started via SMJobBless from the main app). >> >> Its launchd.plist contains (no idea why, probably I copied this from some >> sample code): >> LaunchOnlyOnce = YES

RunLoop in Helper Tool

2013-09-15 Thread Gerriet M. Denkmann
I have a Helper Tool, running as root, started via SMJobBless and communicating vie Xpc. Works fine, but: 1. it cannot stop (CFRunLoopStop), 2. Timers never fire 3. NSRunLoop currentMode returns nil. Maybe all three things are related. To 1: if ( asked to quit ) { NSRunLoop

Re: Helper tool

2013-09-15 Thread Gerriet M. Denkmann
On 13 Sep 2013, at 22:09, Charles Srstka wrote: > On Sep 13, 2013, at 8:47 AM, "Gerriet M. Denkmann" > wrote: > >> I have a helper tool (started via SMJobBless from the main app). >> >> Its launchd.plist contains (no idea why, probably I

Re: Helper tool

2013-09-13 Thread Seth Willits
On Sep 13, 2013, at 6:47 AM, Gerriet M. Denkmann wrote: > I have a helper tool (started via SMJobBless from the main app). > > Its launchd.plist contains (no idea why, probably I copied this from some > sample code): > LaunchOnlyOnce = YES > RunAtLoad = YES > OnDemand = NO

Re: Helper tool

2013-09-13 Thread Charles Srstka
On Sep 13, 2013, at 10:09 AM, Charles Srstka wrote: > On Sep 13, 2013, at 8:47 AM, "Gerriet M. Denkmann" > wrote: > >> I have a helper tool (started via SMJobBless from the main app). >> >> Its launchd.plist contains (no idea why, probably I

Re: Helper tool

2013-09-13 Thread Kevin Meaney
On 13 Sep 2013, at 17:15, Gerriet M. Denkmann wrote: >> >> I should add that if you want to see what all the available options are for >> launchd.plist, you can get a nice description of them by typing "man >> launchd.plist" in the Terminal. > > This I have done already (but thanks for the hi

Re: Helper tool

2013-09-13 Thread Jeremy Matthews
I'm getting prepped for writing few of those...any good sample code out there? I was having some issues compiling Apple sample code from a version of Xcode that shall not be named...throwing bizarre errors. Figured I'd start with some sane, validated goodness. Thanks, j

Re: Helper tool

2013-09-13 Thread Gerriet M. Denkmann
On 13 Sep 2013, at 22:10, Charles Srstka wrote: > On Sep 13, 2013, at 10:09 AM, Charles Srstka wrote: > >> On Sep 13, 2013, at 8:47 AM, "Gerriet M. Denkmann" >> wrote: >> >>> I have a helper tool (started via SMJobBless from the main app). >&

Re: Helper tool

2013-09-13 Thread Charles Srstka
On Sep 13, 2013, at 8:47 AM, "Gerriet M. Denkmann" wrote: > I have a helper tool (started via SMJobBless from the main app). > > Its launchd.plist contains (no idea why, probably I copied this from some > sample code): > LaunchOnlyOnce = YES > RunAtLoad = YES

Helper tool

2013-09-13 Thread Gerriet M. Denkmann
I have a helper tool (started via SMJobBless from the main app). Its launchd.plist contains (no idea why, probably I copied this from some sample code): LaunchOnlyOnce = YES RunAtLoad = YES OnDemand = NO The problem: it runs even when the the main app has never asked it to run. Obviously it

Re: NSApplicationScriptsDirectory access for helper tool

2012-12-02 Thread jonat...@mugginsoft.com
On 30 Nov 2012, at 15:00, jonat...@mugginsoft.com wrote: > I think that this question can be distilled down to : > > Can a sandboxed app bundle helper tool use NSUserUnixTask to run a user > script in NSApplicationScriptsDirectory? > > All my attempts have failed. > &g

Re: NSApplicationScriptsDirectory access for helper tool

2012-11-30 Thread jonat...@mugginsoft.com
I think that this question can be distilled down to : Can a sandboxed app bundle helper tool use NSUserUnixTask to run a user script in NSApplicationScriptsDirectory? All my attempts have failed. Regards Jonathan Mitchell On 30 Nov 2012, at 13:50, jonat...@mugginsoft.com wrote: > I

NSApplicationScriptsDirectory access for helper tool

2012-11-30 Thread jonat...@mugginsoft.com
In a sandboxed app I do the following for say com.mystuff.app and a folder named com.mystuff.app is created in NSApplicationScriptsDirectory as expected. NSError *error = nil; NSURL *scriptsFolderURL = [[NSFileManager defaultManager] URLForDirectory:NSAppl

Re: SMJobBless - how to start helper tool?

2012-03-18 Thread Charles Srstka
On Mar 18, 2012, at 1:42 PM, Kurt Revis wrote: > "ssd" has apparently gone missing, but BetterAuthorizationSample is still > around. A few google searches should help you find them. The “ssd” sample code is still around as well. It’s just tricky to find — and the fact that Google searching for

Re: SMJobBless - how to start helper tool?

2012-03-18 Thread Kurt Revis
On Mar 18, 2012, at 3:20 AM, Gerriet M. Denkmann wrote: > Messing around with the Apple sample project SMJobBless, I got the > SMJobBless() function to work. > I.e. my helper tool is blessed and gets copied to: > /Library/PrivilegedHelperTools/de.mdenkmann.SMJobBlessHelper . >

Re: SMJobBless - how to start helper tool?

2012-03-18 Thread Jerry Krinock
On 2012 Mar 18, at 03:20, Gerriet M. Denkmann wrote: > SMJobBless Wrong email list for SMJobBless. Use apple-c...@lists.apple.com. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

SMJobBless - how to start helper tool?

2012-03-18 Thread Gerriet M. Denkmann
Messing around with the Apple sample project SMJobBless, I got the SMJobBless() function to work. I.e. my helper tool is blessed and gets copied to: /Library/PrivilegedHelperTools/de.mdenkmann.SMJobBlessHelper . But how to start the helper tool? (Nothing shows up in Activity Monitor, nothing