[libvirt] [PATCH] selinux: Fix incorrect file label generation.

Eric Blake eblake at redhat.com
Fri Aug 17 14:28:07 UTC 2012


On 08/17/2012 08:18 AM, Osier Yang wrote:
> On 2012年08月17日 20:53, Viktor Mihajlovski wrote:
>> This is an ad-hoc fix for the file label generation. It uses the base
>> context
>> role to determine whether to use the libvirt process context role. If
>> this
>> is object_r we don't touch it.
>> It might be better to add a new flag to
>> virSecuritySELinuxGenNewContext that
>> specifies the context type (process or file) in the future.

I'd rather Daniel Berrange chimed in on the approach.


>> +    if (strcmp("object_r", context_role_get(context))&&
> 
> No strcmp directly, it should be STREQ instead. Good to read HACKING
> before making patches. :-)

Also, 'make syntax-check' will catch coding style abuse like this.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120817/a55087a8/attachment-0001.sig>


More information about the libvir-list mailing list