clients/polkit: signal error when polkit setuid helper cannot be spawned

Also the child fds are set to -1 so that nm_close() doesn't throw an assertion.

Fixes: df1d214b2 (clients: polkit-agent: implement polkit agent without using libpolkit)
This commit is contained in:
Antonio Cardace 2019-12-24 13:26:54 +01:00
parent 99a8a49c27
commit 34514b6294

View file

@ -552,6 +552,14 @@ begin_authentication (AuthRequest *request)
&request->child_stdout,
NULL,
NULL)) {
/* not findind the PolicyKit setuid helper is a critical error */
request->child_stdin = -1;
request->child_stdout = -1;
g_signal_emit (request->listener,
signals[ERROR],
0,
"The PolicyKit setuid helper 'polkit-agent-helper-1' has not been found");
complete_authentication (request, FALSE);
return;
}