CAPNG\_HAVE\_CAPABILITIES(3) Libcap-ng API CAPNG\_HAVE\_CAPABILITIES(3)

# [NAME](#NAME)

```
capng_have_capabilities, capng_have_permitted_capabilities - check for capabilities
```

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;cap-ng.h&gt;**

capng\_results\_t capng\_have\_capabilities(capng\_select\_t set); capng\_results\_t capng\_have\_permitted\_capabilities(void);

# [DESCRIPTION](#DESCRIPTION)

capng\_have\_capabilities will check the selected internal capabilities sets to see what the status is. The capabilities sets must be previously setup with calls to capng\_get\_caps\_process, capng\_get\_caps\_fd, or in some other way setup. The options are CAPNG\_SELECT\_CAPS for the traditional capabilities, CAPNG\_SELECT\_BOUNDS for the bounding set, CAPNG\_SELECT\_BOTH if checking both are desired, CAPNG\_SELECT\_AMBIENT if only checking the ambient capabilities, or CAPNG\_SELECT\_ALL if testing all sets is desired. When capabilities are checked, it will only look at the effective capabilities.

If, however, the source of capabilities comes from a file, then you may need to additionally check the permitted capabilities. It's for this reason that **capng\_have\_permitted\_capabilities** was created. It takes no arguments because it simply checks the permitted set.

# [RETURN VALUE](#RETURN_VALUE)

This function will return one of the following four self explanatory values: CAPNG\_FAIL, CAPNG\_NONE, CAPNG\_PARTIAL, CAPNG\_FULL.

# [SEE ALSO](#SEE_ALSO)

[**capng\_get\_caps\_process**(3)](/man/os/libcap-ng/capng_get_caps_process.3), [**capng\_get\_caps\_fd**(3)](/man/os/libcap-ng/capng_get_caps_fd.3), [**capng\_have\_capability**(3)](/man/os/libcap-ng/capng_have_capability.3), [**capabilities**(7)](/man/os/libcap-ng/capabilities.7)

# [AUTHOR](#AUTHOR)

Steve Grubb

Sept 2020 Red Hat

---

Document: capng_have_capabilities(3) from libcap-ng 0.9.6-r0 (Chainguard OS)
Source: https://github.com/stevegrubb/libcap-ng.git
