]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
security: Refactor virSecurityManagerGenLabel
authorErik Skultety <eskultet@redhat.com>
Thu, 12 Feb 2015 17:32:41 +0000 (18:32 +0100)
committerJán Tomko <jtomko@redhat.com>
Fri, 13 Feb 2015 13:49:23 +0000 (14:49 +0100)
commitaee3b77c336b7ae54914e322239ffabee59d74eb
treee1f5453e98505284c7eeadbd21ef8d16c0a41998
parentc3d9d3bbc99b6694b713f6de4198e285ba944f03
security: Refactor virSecurityManagerGenLabel

if (mgr == NULL || mgr->drv == NULL)
    return ret;

This check isn't really necessary, security manager cannot be a NULL
pointer as it is either selinux (by default) or 'none', if no other driver is
set in the config. Even with no config file driver name yields 'none'.

The other hunk checks for domain's security model validity, but we should
also check devices' security model as well, therefore this hunk is moved into
a separate function which is called by virSecurityManagerCheckAllLabel that
checks both the domain's security model and devices' security model.

https://bugzilla.redhat.com/show_bug.cgi?id=1165485
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/security/security_manager.c