Repository navigation
This release is mostly polishing the code. Lots of little fixups all over the code base. See the Changelog file for details. That said, there were the two behavior changes that can affect existing callers:
- capng_change_id rejects unrecognized flags. It now returns -19 with errno set to EINVAL and changes nothing, where earlier releases ignored unknown flag bits and could report success. Callers that pass junk bits, for example from uninitialized flag variables, will now fail instead of silently succeeding.
- capng_update and capng_updatev warn when their result is ignored. Both are now declared warn_unused_result, so code that ignores their return value gets -Wunused-result warnings in builds with _FORTIFY_SOURCE, which Fedora enables by default. Packages built with -Werror will fail to build until they check the result. With GCC, casting the call to (void) doesn't silence the warning, so callers need to actually check the return value.
Also, a program that relies on CAPNG_SET_NO_NEW_PRIVS must require libcap-ng 1.0 or later at run time, not just at build time. Older libraries ignore the flag and return success without setting no_new_privs. Programs can check for the flag at compile time with #ifdef CAPNG_SUPPORTS_NO_NEW_PRIVS.
There are 2 new functions, capng_last_cap to get the last detected capability, and capng_update_list which is similar to capng_updatev but takes the arguments as a bounded array.
NOTE: if building on a 32 bit system, you will need commit 1ae238f for netcap_advanced_test to pass.