[v2] security: apparmor: Label externalDataStore

Message ID 69c33aac22f5911bb800fe41b62e704fe24cd4ce.1575939270.git.crobinso@redhat.com
State Accepted
Commit b9a055a4093724602ac3dd2486a94a7f3ef9b16f
Headers show
Series
  • [v2] security: apparmor: Label externalDataStore
Related show

Commit Message

Cole Robinson Dec. 10, 2019, 12:55 a.m.
Teach virt-aa-helper how to label a qcow2 data_file, tracked internally
as externalDataStore. It should be treated the same as its sibling
disk image

Signed-off-by: Cole Robinson <crobinso@redhat.com>

---
v2:
s/src/tmp/

 src/security/virt-aa-helper.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Christian Ehrhardt Dec. 10, 2019, 7:19 a.m. | #1
On Tue, Dec 10, 2019 at 1:54 AM Cole Robinson <crobinso@redhat.com> wrote:

> Teach virt-aa-helper how to label a qcow2 data_file, tracked internally

> as externalDataStore. It should be treated the same as its sibling

> disk image

>

> Signed-off-by: Cole Robinson <crobinso@redhat.com>

>


Now LGTM, thanks for the rework.
And after Peters explanation (thanks) I agree that it is the right approach
to do it inside the loop.

Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>



> ---

> v2:

> s/src/tmp/

>

>  src/security/virt-aa-helper.c | 4 ++++

>  1 file changed, 4 insertions(+)

>

> diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c

> index c93dddb228..f623ff965f 100644

> --- a/src/security/virt-aa-helper.c

> +++ b/src/security/virt-aa-helper.c

> @@ -918,6 +918,10 @@ storage_source_add_files(virStorageSourcePtr src,

>          if (add_file_path(tmp, depth, buf) < 0)

>              return -1;

>

> +        if (tmp->externalDataStore &&

> +            storage_source_add_files(tmp->externalDataStore, buf, depth)

> < 0)

> +            return -1;

> +

>          depth++;

>      }

>

> --

> 2.23.0

>

>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 10, 2019 at 1:54 AM Cole Robinson &lt;<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Teach virt-aa-helper how to label a qcow2 data_file, tracked internally<br>
as externalDataStore. It should be treated the same as its sibling<br>
disk image<br>
<br>
Signed-off-by: Cole Robinson &lt;<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>&gt;<br></blockquote><div><br></div><div>Now LGTM, thanks for the rework.</div><div>And after Peters explanation (thanks) I agree that it is the right approach to do it inside the loop.</div><div><br></div>Reviewed-by: Christian Ehrhardt &lt;<a href="mailto:christian.ehrhardt@canonical.com" target="_blank">christian.ehrhardt@canonical.com</a>&gt;<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

---<br>
v2:<br>
s/src/tmp/<br>
<br>
 src/security/virt-aa-helper.c | 4 ++++<br>
 1 file changed, 4 insertions(+)<br>
<br>
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c<br>
index c93dddb228..f623ff965f 100644<br>
--- a/src/security/virt-aa-helper.c<br>
+++ b/src/security/virt-aa-helper.c<br>
@@ -918,6 +918,10 @@ storage_source_add_files(virStorageSourcePtr src,<br>
         if (add_file_path(tmp, depth, buf) &lt; 0)<br>
             return -1;<br>
<br>
+        if (tmp-&gt;externalDataStore &amp;&amp;<br>
+            storage_source_add_files(tmp-&gt;externalDataStore, buf, depth) &lt; 0)<br>
+            return -1;<br>
+<br>
         depth++;<br>
     }<br>
<br>
-- <br>
2.23.0<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr">Christian Ehrhardt<br>Staff Engineer, Ubuntu Server<br>Canonical Ltd</div></div>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Patch

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index c93dddb228..f623ff965f 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -918,6 +918,10 @@  storage_source_add_files(virStorageSourcePtr src,
         if (add_file_path(tmp, depth, buf) < 0)
             return -1;
 
+        if (tmp->externalDataStore &&
+            storage_source_add_files(tmp->externalDataStore, buf, depth) < 0)
+            return -1;
+
         depth++;
     }