]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
05d3a176 | 2 | #pragma once |
729e3769 | 3 | |
8a4b13c5 ZJS |
4 | #include "bus-util.h" |
5 | ||
6bb92a16 LP |
6 | int polkit_agent_open(void); |
7 | void polkit_agent_close(void); | |
8a4b13c5 | 8 | |
3b402966 | 9 | static inline int polkit_agent_open_if_enabled( |
8a4b13c5 ZJS |
10 | BusTransport transport, |
11 | bool ask_password) { | |
12 | ||
13 | /* Open the polkit agent as a child process if necessary */ | |
14 | ||
15 | if (transport != BUS_TRANSPORT_LOCAL) | |
3b402966 | 16 | return 0; |
8a4b13c5 ZJS |
17 | |
18 | if (!ask_password) | |
3b402966 | 19 | return 0; |
8a4b13c5 | 20 | |
3b402966 | 21 | return polkit_agent_open(); |
8a4b13c5 | 22 | } |