mbsanchez / qtprivilegedhelperexample Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
To run HostApp, before I set the certificate.pri and tried to build ExampleTool and PrivilegedHelper, then this errors are appeared:
(Normally, SHA-1 has spaces but I wrote CERTSHA1 in a contiguous format like this: EEDF324B5E25EEDF324B5E25EEDF324B5E25)
So, I assigned CERT_OU to XXXXXXXXXX again and rebuilt ExampleTool and PrivilegedHelper. Then errors disappeared. Afterward, I assigned CERT_OU to real value (from certificate) to build HostApp. I think it is necessary for HostApp. It was built successfully. Then I run SMJobBlessUtil.py script and get this error:
sudo python SMJobBlessUtil.py check ../build-PrivilegedHelperExample-Desktop_Qt_5_9_1_clang_64bit-Debug/HostApp.app
../build-PrivilegedHelperExample-Desktop_Qt_5_9_1_clang_64bit-Debug/HostApp.app: app code signature invalid
I think the other issues which mentioned before is related with this.
I couldn't solve it.
Edit: I checked my certificate with SMJobBless example and it worked. The certificate is valid.
And I wonder, there are commands which are hardcoded in .pro files:
plist.commands += /usr/libexec/PlistBuddy -c \'Set :SMPrivilegedExecutables:$${HELPER_IDENTIFIER} 'anchor apple generic and identifier \\\"$${HELPER_IDENTIFIER}\\\" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = $${CERT_OU})'\' $${INFO_PLIST_PATH};
Should we also change these lines?
Hi, can you explain why the need for both the PrivilegedHelper and the ExampleTool?
My understanding, perhaps incorrect, is that the app installs the PrivilegedHelper so that it may execute with elevated privileges, so why doesn't the PrivilegedHelper itself incorporate the logic that must run privileged as opposed to executing a separate tool like ExampleTool?
Thanks
Hi,
I need to privileges for create new file at /var/log. So I found out your solution. I pulled project and changed all of necessary region (XXXXXXXXXX) about certification info in certificate.pri and .plist file.
I get this error
Failed to install privileged helper (on console).
At the same directory, there is com.gokhanacer.PrivilegedHelper file (I changed mbs domain).
I debugged on QtCreator, and problem appeared blessHelperWithLabel(CFStringRef label, CFErrorRef error)* function in smjobbless.mm.
So I didn't solve this problem. Could you help me, please?
I got couple of such errors when I am trying to build the project:
ERROR: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump: '/Users/mac/projects/mohammed/QtPrivilegedHelperExampleModified/build-PrivilegedHelperExample-qt_5_7_1-Debug/HostApp.app/Contents/Frameworks/QtWidgets.framework/Versions/5/Resources/Info.plist': The file was not recognized as a valid object file.\nfatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: internal objdump command failed\n"
This issue returns the macdeployqt utility, I don't know if it is critical, but the HostApp does not work for me. In line 74 of file smjobbless.mm result is always false.
result = SMJobBless(kSMDomainSystemLaunchd, label, authRef, error);
I am using qt 5.7.1
macOS Sierra
But the objective-C ECHelper project works fine.
Xcode Version 8.2.1
Did you test the project on macOS Sierra?
Hello,
Your privileged helper depends on Qt library. Could you please clarify where is the correct location to put Qt library for helper? It can be copied to /Library/Frameworks and RPATH of privileged helper can be changed to @executable_path/../Frameworks , right?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.