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's not a big

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 -> Full D

Re: Problem using NSTimer in privileged helper tool

2017-10-22 Thread Uli Kusterer
:runID repeats:YES]; > > > 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 objec

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'

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

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

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

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: '***

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

Re: Problem using NSTimer in privileged helper tool

2017-10-19 Thread Alex Zavatone
t; > 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

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

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

2016-01-22 Thread Damien DeVille
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” entries of both > info.plist files (of my preferences panel and the helper tool). It all r

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

2016-01-14 Thread Motti Shneor
mien > >> On Jan 13, 2016, at 9:42 AM, Motti Shneor <su...@bezeqint.net> 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 >> privile

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
in the 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 conn

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 some additional

Re: Communicating with Privileged Helper Tool

2015-12-23 Thread Mark Allan
opGetCurrent(), runLoopSource, 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 = CFMessagePortC

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 ___

Re: RunLoop in Helper Tool

2013-09-16 Thread Uli Kusterer
On 16 Sep 2013, at 01:10, Greg Parker gpar...@apple.com 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

Re: RunLoop in Helper Tool

2013-09-16 Thread Marcel Weiher
On Sep 16, 2013, at 9:12 , Uli Kusterer witness.of.teacht...@gmx.net wrote: On 16 Sep 2013, at 01:10, Greg Parker gpar...@apple.com 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

Re: Helper tool

2013-09-15 Thread Gerriet M. Denkmann
On 13 Sep 2013, at 22:09, Charles Srstka cocoa...@charlessoft.com wrote: On Sep 13, 2013, at 8:47 AM, Gerriet M. Denkmann gerr...@mdenkmann.de 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

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 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 The problem

Re: RunLoop in Helper Tool

2013-09-15 Thread Jean-Daniel Dupas
sept. 2013 à 10:32, Gerriet M. Denkmann gerr...@mdenkmann.de 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. Maybe all three

Re: RunLoop in Helper Tool

2013-09-15 Thread Gerriet M. Denkmann
]; // mode = nil CFRunLoopRef rl2 = CFRunLoopGetMain (); // 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

Re: RunLoop in Helper Tool

2013-09-15 Thread Marcel Weiher
On Sep 15, 2013, at 10:32 , Gerriet M. Denkmann gerr...@mdenkmann.de 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 exit(0) ? Marcel

Re: RunLoop in Helper Tool

2013-09-15 Thread Kevin Meaney
been wondering why LaunchAgent doesn't stop. Back to exit(0) it is. Kevin On 15 Sep 2013, at 15:30, Marcel Weiher marcel.wei...@gmail.com wrote: On Sep 15, 2013, at 10:32 , Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I have a Helper Tool, running as root, started via SMJobBless

Re: RunLoop in Helper Tool

2013-09-15 Thread Jean-Daniel Dupas
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 not possible to stop a [NSRunLoop run] call

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): LaunchOnlyOnce = YES RunAtLoad = YES OnDemand = NO The problem: it runs

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: 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 gerr...@mdenkmann.de wrote: I have a Helper Tool, running as root, started via SMJobBless and communicating vie Xpc. Sometimes it does: [[NSOperationQueue

Re: NSDistributedNotificationCenter and Helper Tool

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

Re: RunLoop in Helper Tool

2013-09-15 Thread Marcel Weiher
On Sep 15, 2013, at 17:04 , Kevin Meaney k...@yvs.eu.com wrote: On 15 Sep 2013, at 15:30, Marcel Weiher marcel.wei...@gmail.com 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

Re: RunLoop in Helper Tool

2013-09-15 Thread Greg Parker
On Sep 15, 2013, at 10:50 AM, Marcel Weiher marcel.wei...@gmail.com wrote: On Sep 15, 2013, at 17:04 , Kevin Meaney k...@yvs.eu.com wrote: On 15 Sep 2013, at 15:30, Marcel Weiher marcel.wei...@gmail.com wrote: Do all the cleanup you want to do and then exit(0) ? I was doing exit(0) but

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

Re: Helper tool

2013-09-13 Thread Charles Srstka
On Sep 13, 2013, at 8:47 AM, Gerriet M. Denkmann gerr...@mdenkmann.de 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

Re: Helper tool

2013-09-13 Thread Gerriet M. Denkmann
On 13 Sep 2013, at 22:10, Charles Srstka cocoa...@charlessoft.com wrote: On Sep 13, 2013, at 10:09 AM, Charles Srstka cocoa...@charlessoft.com wrote: On Sep 13, 2013, at 8:47 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I have a helper tool (started via SMJobBless from the main

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 Kevin Meaney
On 13 Sep 2013, at 17:15, Gerriet M. Denkmann gerr...@mdenkmann.de 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

Re: Helper tool

2013-09-13 Thread Charles Srstka
On Sep 13, 2013, at 10:09 AM, Charles Srstka cocoa...@charlessoft.com wrote: On Sep 13, 2013, at 8:47 AM, Gerriet M. Denkmann gerr...@mdenkmann.de 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

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 The problem: it runs

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. Regards Jonathan Mitchell

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]

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

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

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

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 . But how to start

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