AuthorizationShell and sudo

I use AuthorizationShell - I think authored by Thomas Templemann - very successfully over the past couple years. I use it to run a HelperApp to run as root inside my bundle. It calls some reading and writing functions that need root permissions. When I start my app, the user gets the standard authentication Mac dialog and enters their password, so the helper app runs as root.

So now I’m trying to to run the “dd” command off a Shell object inside that helper app. I would think the user shouldn’t have to put in their password again, right?

If I do (for example) “dd if=disk.dmg of=/dev/disk4” I get Permission denied for /dev/disk4. If I do “sudo dd if=disk.dmg of=/dev/disk4” I get "sudo: no tty present and no askpass program specified’. I googled and got a couple ideas but I don’t see how they’d work with the AuthorizationShell.

Any ideas?

The function this relied on was deprecated in macOS 10.7. As far as I know, it doesn’t work inside an app that is sandboxed. Please see:

https://developer.apple.com/documentation/security/authorization_services?language=objc

FWIW it was originally written by Jon Johnson of REAL Software.

Thanks Jason, thanks for your comment but it’s irrelevant to my question. (I’m sure I’ll update the authorization stuff soon enough.)

My master app isn’t sandboxed and the Authorization Shell still works even up to Mojave. “Deprecated” doesn’t mean “Discontinued”.

My question is about a shell running in a root-running REAL/Xojo app and having it work as sudo and the error it is giving me.

Yes, that will not work. (short answer but there is no solution either)