Git Product home page Git Product logo

smjobblessxpc's People

Contributors

atnan avatar mdales avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smjobblessxpc's Issues

Failed to bless helper in OS X 10.10 (CFErrorDomainLaunchd - error 4 = kSMErrorAuthorizationFailure)

My own app stopped being able to install its helper in OS X 10.10 in the final release, though I believe this was working in earlier beta versions. I came across SMJobBlessXPC as an excellent reduction test case... and found the same problem.

After duly authorizing with an admin password, SMJobBless() results in:
Failed to bless helper. Error: Error Domain=CFErrorDomainLaunchd Code=4 "The operation couldn’t be completed. (CFErrorDomainLaunchd error 4.)"

Error 4 is kSMErrorAuthorizationFailure. The same code was working prior to 10.10 in my testing.

One user reports to me that he noticed the symptoms of the bug in 10.9.5 but not in prior minor releases of 10.9; I can't confirm that at the moment.

How to write on /Library/Fonts folder on Mac with SMJobBless function

0
down vote
favorite
I try to use SMJobBless function to authenticate for my application can do write on /Library/Fonts but not working,

if (![self blessHelperWithLabel:@"com.apple.bsd.SMJobBlessHelper" error:&error]) {
NSLog(@"Something went wrong! %@ / %d", [error domain], (int) [error code]);
} else {
//Access to this point.
/* At this point, the job is available. However, this is a very
* simple sample, and there is no IPC infrastructure set up to
* make it launch-on-demand. You would normally achieve this by
* using XPC (via a MachServices dictionary in your launchd.plist).
*/
NSLog(@"Job is available!");
bool result = false;
result = [[NSFileManager defaultManager] isWritableFileAtPath:@"/Library/Fonts"];
[self->_textField setHidden:false];
}
My application printed "Job is available" but when i check authorities write on /Library/Fonts, result is false
Thanks in advance.

Error On Mountain Lion

Not sure what this error is, but on mountain lion, I'm getting:

Failed to bless helper. Error: Error Domain=kSMErrorDomainFramework Code=3 "The operation couldn’t be completed. (kSMErrorDomainFramework error 3 - The client and tool did not match requirements.)" UserInfo=0x1001577b0 {NSDescription=The client and tool did not match requirements.}

When ported to a different project, I get XPC_ERROR_CONNECTION_INTERRUPTED

The demo project works great. But when I try to integrate it into a different project, I consistently get either XPC_ERROR_CONNECTION_INTERRUPTED or sometimes XPC_ERROR_CONNECTION_INVALID errors. Is there something I might have missed? Nothing shows up in the system log for the helper process either—but if I run it from the command line (with sudo), I do see the expected messages in the system log. So the helper is clearly not getting launched, although SMBlessJob does in fact do its thing (as verified by looking in /Library/PrivilegedHelperTools etc.)

SMJobless not working

Something went wrong! Error Domain=CFErrorDomainLaunchd Code=2 "The operation couldn’t be completed. (CFErrorDomainLaunchd error 2.)"

Error Domain=CFErrorDomainLaunchd Code=4 "(null)"

While running the application i got this error what should i do.
I need to run a sudo command to get total number of files and to get full path, So i need authorization how can i fix this. kindly help me to out.

SMJobBless buggy?

I've been running SMJobBlessXPC, without the sandbox, but with code-signing and I noticed a pattern. The first time the blessing would work and I would see:

Helper available.
Sending request: Hi there, helper service.
Received response: Hi there, host application!

Quitting SMJobBlessApp and starting it again, without any changes to the code, I would get the dreaded:

Failed to bless helper. Error: Error Domain=CFErrorDomainLaunchd Code=2 “(null)"

Repeating this, running the App, quitting, running it again, the pattern became clear, especially when I used LaunchControl.app to monitor the status of /Library/PrivilegedHelperTools/com.apple.bsd.SMJobBlessHelper:

Status SMJobBlessHelper result SMJobBless()
unloaded YES (will load SMJobBlessHelper)
loaded NO (will unload SMJobBlessHelper)

So, who's to blame? The docs for SMJobBless() state:

If the job is already installed, success is returned.

My tests seem to indicate otherwise, unless there's something I'm missing.

How to write on /Library/Fonts folder on Mac with SMJobBless function

I try to use SMJobBless function to authenticate for my application can do write on /Library/Fonts but not working,

if (![self blessHelperWithLabel:@"com.apple.bsd.SMJobBlessHelper" error:&error]) {
NSLog(@"Something went wrong! %@ / %d", [error domain], (int) [error code]);
} else {
//Access to this point.
/* At this point, the job is available. However, this is a very
* simple sample, and there is no IPC infrastructure set up to
* make it launch-on-demand. You would normally achieve this by
* using XPC (via a MachServices dictionary in your launchd.plist).
*/
NSLog(@"Job is available!");
bool result = false;
result = [[NSFileManager defaultManager] isWritableFileAtPath:@"/Library/Fonts"];
[self->_textField setHidden:false];
}
My application printed "Job is available" but when i check authorities write on /Library/Fonts, result is false
Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.