Quantcast
Channel: Xamarin.Mac — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 1429

Interprocess communication with AuthorizationExecuteWithPrivileges

$
0
0

I have an application (C#, multiplatform) that require elevated permissions to do some tasks.
So, i have the main application (C#) that run with normal user, and launch another 'helper' application (C# or C) that run elevated.
The helper must be keep active during execution of the main application (so, users credential for elevation asked only one time at start).

Under Windows, both app are C#, the main create a System.Diagnostic.Process with verb "runas", and with shared-memory and mutex i do the interprocess communication. Shared-memory because stdin/stdout redirection don't work with "runas". Almost easy.

Under Linux, main application (C#) run the helper (C) via pkexec and a polkit action for requesting elevation. Interprocess communication via stdin/stdout/stderr. Easy.

Now, under Xamarin.Mac?

SMJobBless seem "tragic" about implementation and building an interprocess communication...

So i'm focused on AuthorizationExecuteWithPrivileges. (i know can be deprecated).
The latest parameter, a FILE* : anyone have any idea about how i can manage it (write string or read string async/event) ?

Thanks for any feedback or any alternative.


Viewing all articles
Browse latest Browse all 1429