]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
security: compilation error due to wrong parameter for vah_add_path().
authorJulio Faracco <jcfaracco@gmail.com>
Tue, 19 Jul 2016 01:09:20 +0000 (22:09 -0300)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 19 Jul 2016 07:02:51 +0000 (09:02 +0200)
The commit da665fbd introduced virStorageSourcePtr inside the structure
_virDomainFSDef. This is causing an error when libvirt is being compiled.

make[3]: Entering directory `/media/julio/8d65c59c-6ade-4740-9cdc-38016a4cb8ae
/home/julio/Desktop/virt/libvirt/src'
  CC       security/virt_aa_helper-virt-aa-helper.o
security/virt-aa-helper.c: In function 'get_files':
security/virt-aa-helper.c:1087:13: error: passing argument 2 of 'vah_add_path'
from incompatible pointer type [-Werror]
             if (vah_add_path(&buf, fs->src, "rw", true) != 0)
             ^
security/virt-aa-helper.c:732:1: note: expected 'const char *' but argument is
of type 'virStorageSourcePtr'
 vah_add_path(virBufferPtr buf, const char *path, const char *perms, bool
recursive)
 ^
cc1: all warnings being treated as errors

Adding the attribute "path" from virStorageSourcePtr fixes this issue.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
src/security/virt-aa-helper.c

index 9eafaee4c82af6bd11833c400ec0963b6d26f436..805d7d79621e66f59dc6670e744187b8750be184 100644 (file)
@@ -1084,7 +1084,7 @@ get_files(vahControl * ctl)
             /* We don't need to add deny rw rules for readonly mounts,
              * this can only lead to troubles when mounting / readonly.
              */
-            if (vah_add_path(&buf, fs->src, "rw", true) != 0)
+            if (vah_add_path(&buf, fs->src->path, "rw", true) != 0)
                 goto cleanup;
         }
     }