]> xenbits.xensource.com Git - libvirt.git/commit
lxc_container: Check retval of capng_get_caps_process()
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 11 Sep 2023 08:47:01 +0000 (10:47 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 11 Sep 2023 10:34:03 +0000 (12:34 +0200)
commit3222c9ca6723905e628d4c9989c5744a16f1dcde
treee4e2813c50cccf2a3cad59d6d561245b4c42b0b4
parentefeaf5589cef03c014c79e76074de8f493b12099
lxc_container: Check retval of capng_get_caps_process()

Added in v0.6.5~14 the call to capng_get_caps_process() inside of
lxcContainerDropCapabilities() is not really explained in the
commit message. But looking into the libcap-ng sources it's to
initialize the internal state of the library.

But with recent libcap-ng commit [1] (which some bleeding edge
distros - like Fedora rawhide - already picked up) the function
has been marked as 'warn unused result'. Well, check for its
retval then.

1: https://github.com/stevegrubb/libcap-ng/commit/a0743c335c9a16a2fda9b25120a5523742119e47

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/lxc/lxc_container.c