[libvirt] [PATCH 1/5] virt-aa-helper wasn't running virErrorInitialize

Martin Kletzander mkletzan at redhat.com
Tue Nov 25 07:21:16 UTC 2014


On Mon, Nov 24, 2014 at 09:54:42PM +0100, Cédric Bosdonnat wrote:
>This turns out to be working by magic but needs to be fixed.
>---
> src/security/virt-aa-helper.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
>index e4d9a76..81f9f40 100644
>--- a/src/security/virt-aa-helper.c
>+++ b/src/security/virt-aa-helper.c
>@@ -1251,6 +1251,12 @@ main(int argc, char **argv)
>         exit(EXIT_FAILURE);
>     }
>
>+    if (virThreadInitialize() < 0 ||
>+        virErrorInitialize() < 0) {
>+        fprintf(stderr, _("%s: initialization failed\n"), argv[0]);
>+        exit(EXIT_FAILURE);
>+    }
>+

Calling virInitialize() would also set the logging output and filters
from the environment.  And if some parts of it are not needed, it can
be controlled by compilation flags, but that's just a hint.

As a general fix, this is enough. ACK.

>     /* clear the environment */
>     environ = NULL;
>     if (setenv("PATH", "/sbin:/usr/sbin", 1) != 0)
>--
>2.1.2
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141125/aa97e69f/attachment-0001.sig>


More information about the libvir-list mailing list