GithubHelp home page GithubHelp logo

mbsanchez / qtprivilegedhelperexample Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 6.0 460 KB

License: GNU General Public License v3.0

QMake 22.14% C++ 24.67% Objective-C++ 17.51% C 4.91% Shell 0.34% Python 30.42%

qtprivilegedhelperexample's People

Contributors

mbsanchez avatar

Stargazers

 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

qtprivilegedhelperexample's Issues

error: invalid or corrupted code requirement(s)

To run HostApp, before I set the certificate.pri and tried to build ExampleTool and PrivilegedHelper, then this errors are appeared:

screen shot 2017-11-06 at 1 28 40 pm

(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?

Why is ExampleTool needed?

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

PrivilegedHelper tool not installed

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).

screen shot 2017-11-04 at 9 39 58 pm

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?

The file was not recognized as a valid object file && and failed on macOS Sierra

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?

Privileged helper and library dependency

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?

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.