[libvirt] [PATCH 12/15] maint: avoid 'const fooPtr' in security

Daniel P. Berrange berrange at redhat.com
Mon Oct 14 15:34:20 UTC 2013


On Tue, Oct 08, 2013 at 11:29:03AM -0600, Eric Blake wrote:
> 'const fooPtr' is the same as 'foo * const' (the pointer won't
> change, but it's contents can).  But in general, if an interface
> is trying to be const-correct, it should be using 'const foo *'
> (the pointer is to data that can't be changed).
> 
> Fix up offenders in src/security.
> 
> * src/security/security_apparmor.c (reload_profile)
> (AppArmorSetSecurityHostdevLabelHelper)
> (AppArmorReleaseSecurityLabel, AppArmorRestoreSecurityAllLabel)
> (AppArmorSetSecurityProcessLabel)
> (AppArmorSetSecurityChildProcessLabel)
> (AppArmorSetSecurityImageLabel, AppArmorSecurityVerify)
> (AppArmorSetSecurityHostdevLabel)
> (AppArmorRestoreSecurityHostdevLabel, AppArmorSetFDLabel): Drop
> needless const.
> * src/security/security_selinux.c
> (virSecuritySELinuxSetSecurityFileLabel): Likewise.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  src/security/security_apparmor.c | 22 +++++++++++-----------
>  src/security/security_selinux.c  |  2 +-
>  2 files changed, 12 insertions(+), 12 deletions(-)

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list