[20/30] security: dac: Drop !parent handling in SetImageLabelInternal

Message ID 54d9c4ea4531ec10f219e92b6de133a496d24f1f.1570482718.git.crobinso@redhat.com
State Accepted
Commit a7262a664d514b6d9f49c6e40b5a581b9bc271ec
Headers show
Series
  • storagefile, security: qcow2 data_file support
Related show

Commit Message

Cole Robinson Oct. 7, 2019, 9:49 p.m.
The only caller always passes in a non-null parent

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

---
 src/security/security_dac.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
2.23.0

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

Comments

Daniel Henrique Barboza Oct. 10, 2019, 3:31 p.m. | #1
On 10/7/19 6:49 PM, Cole Robinson wrote:
> The only caller always passes in a non-null parent

>

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

> ---


Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>


>   src/security/security_dac.c | 5 ++---

>   1 file changed, 2 insertions(+), 3 deletions(-)

>

> diff --git a/src/security/security_dac.c b/src/security/security_dac.c

> index 4b4afef18a..bcc781213e 100644

> --- a/src/security/security_dac.c

> +++ b/src/security/security_dac.c

> @@ -893,9 +893,8 @@ virSecurityDACSetImageLabelInternal(virSecurityManagerPtr mgr,

>           return 0;

>   

>       disk_seclabel = virStorageSourceGetSecurityLabelDef(src, SECURITY_DAC_NAME);

> -    if (parent)

> -        parent_seclabel = virStorageSourceGetSecurityLabelDef(parent,

> -                                                              SECURITY_DAC_NAME);

> +    parent_seclabel = virStorageSourceGetSecurityLabelDef(parent,

> +                                                          SECURITY_DAC_NAME);

>   

>       if (disk_seclabel && (!disk_seclabel->relabel || disk_seclabel->label)) {

>           if (!disk_seclabel->relabel)


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

Patch

diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 4b4afef18a..bcc781213e 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -893,9 +893,8 @@  virSecurityDACSetImageLabelInternal(virSecurityManagerPtr mgr,
         return 0;
 
     disk_seclabel = virStorageSourceGetSecurityLabelDef(src, SECURITY_DAC_NAME);
-    if (parent)
-        parent_seclabel = virStorageSourceGetSecurityLabelDef(parent,
-                                                              SECURITY_DAC_NAME);
+    parent_seclabel = virStorageSourceGetSecurityLabelDef(parent,
+                                                          SECURITY_DAC_NAME);
 
     if (disk_seclabel && (!disk_seclabel->relabel || disk_seclabel->label)) {
         if (!disk_seclabel->relabel)