[PATCH 7/7] util: Make client-side polkit work even with polkit disabled

Ján Tomko jtomko at redhat.com
Mon Nov 22 15:50:11 UTC 2021


On a Sunday in 2021, Martin Kletzander wrote:
>The reason for this is twofold:
>
>- the polkit build option is documented for UNIX socket access checks
>
>- there is no server-side change or dbus call done when enabling this as it only
>  starts a polkit agent on the client-side (actually only in virsh) and does not
>  need any requirements (starting is skipped if pkttyagent is not installed)
>
>Also move the conditional implementation to the bottom of the file so that it
>does not look like the whole file is build conditionally and the common
>functions are at the top.
>

Please, separate the code movement from the functional changes, to make
it obvious what this commit does.

>Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
>---
> src/util/virpolkit.c | 240 ++++++++++++++++++++-----------------------
> 1 file changed, 109 insertions(+), 131 deletions(-)
>
>diff --git a/src/util/virpolkit.c b/src/util/virpolkit.c
>index 7156adc10c0a..b51104100796 100644
>--- a/src/util/virpolkit.c
>+++ b/src/util/virpolkit.c
>@@ -21,6 +21,7 @@
>
> #include <config.h>
> #include <fcntl.h>
>+#include <poll.h>

This does not compile on mingw:
../src/util/virpolkit.c:24:10: fatal error: poll.h: No such file or directory
    24 | #include <poll.h>
       |          ^~~~~~~~

Jano

> #include <unistd.h>
>
> #include "virpolkit.h"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20211122/aa2fd601/attachment-0001.sig>


More information about the libvir-list mailing list