]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virt-aa-helper: Use virCommand APIs directly
authorAndrea Bolognani <abologna@redhat.com>
Mon, 19 Aug 2019 07:02:10 +0000 (09:02 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 19 Aug 2019 13:46:58 +0000 (15:46 +0200)
Right now we're using the virRun() convenience API, but that
doesn't allow the kind of control we want. Use the virCommand
APIs directly instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/security/virt-aa-helper.c

index ad9a7dda94df43ff470fd8400ee2ae173b2c8173..c5080f698abe365959ac397d70cb15b243b0e14b 100644 (file)
@@ -170,7 +170,9 @@ parserCommand(const char *profile_name, const char cmd)
         const char * const argv[] = {
             "/sbin/apparmor_parser", flag, profile, NULL
         };
-        if ((ret = virRun(argv, &status)) != 0 ||
+        VIR_AUTOPTR(virCommand) command = virCommandNewArgs(argv);
+
+        if ((ret = virCommandRun(command, &status)) != 0 ||
             (WIFEXITED(status) && WEXITSTATUS(status) != 0)) {
             if (ret != 0) {
                 vah_error(NULL, 0, _("failed to run apparmor_parser"));