Elevate Rights on OSX

#1

Please, please, please, add an option to elevate rights on OSX so I can copy and create files in protected folders. Especially the plugins folder, as my recent APP is a plugin manager. :wink:

I have read the documentation on how to do that on OSX but for some reason (I have some mental disability problems) I can’t get my head around it…

Thanks!

0 Likes

#2

Use STPrivilegedTask. It makes it into a one liner: https://github.com/sveinbjornt/STPrivilegedTask

1 Like

#3

Thanks. :slight_smile:

Edit: still wish a JUCE alternative would appear…

0 Likes

#4

It’s not something that fits well into a cross-platform framework.

0 Likes

#5

What? Tom, that’s not right, will have to disagree. Otherwise everything that JUCE stands for is mute. There’s a heck tons of stuff that are platform specific, but that mirrors to all platforms, ok, they go. But now something that is needed in all platforms, as rights to protected folders, can be done in Linux, which JUCE already DID. :-\ Humm… On Windows is just a compiler setting. On OSX is more complicated… And on iOS JUCE HAS IT. :-\ Humm…

0 Likes

#6

I agree with William here. Windows has a mechanism for this too. For other platforms you have permission flags etc. that are all supported by JUCE to ask for microphone, camera access etc. so I don’t think asking to OS to elevate privileges, so custom installers etc. can do their job is too strange to include.

0 Likes

#7

To add: you just added (only seven hours ago) the necessary sandboxing flags for OSX.

0 Likes

#8

Here’s the relevant info: https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/AccessControl.html

Rail

0 Likes

#9

I think I must have misunderstood the request, or, at least, there’s a gap in my knowledge here.

macOS and Windows both provide ways of launching or scheduling processes that run with different permissions than the parent. Although similar, they’re not easy to unify into a single API, and I don’t believe anything equivalent exists on the mobile platforms. Wrapping this functionality is different from applying application-wide permissions such as microphone access. What would a good cross-platform API look like?

What have we already done in Linux? I think this might be the bit I’m missing.

0 Likes

#10

JUCE_API void JUCE_CALLTYPE Process::raisePrivilege() { if (geteuid() != 0 && getuid() == 0) swapUserAndEffectiveUser(); }

JUCE_API void JUCE_CALLTYPE Process::lowerPrivilege() { if (geteuid() == 0 && getuid() != 0) swapUserAndEffectiveUser(); }

0 Likes

#11

Still nothing? :frowning:

0 Likes

#12

In my case, this would really save my day. As I need it for two situations.

  1. my custom installer, which I can share the source-code and even create a short manual about it. It works great on Windows, thanks to the one-setting it takes me to make it request admin rights.

  2. my plugin manager + bridge, which needs to erase and create bridged plugin files.

So the feature would save my day. :slight_smile: :hugs:

Cheers, WilliamK

0 Likes