Three years ago, I wrote a program to manipulate the CAP_NET_RAW capability of my programs. I used the AMBIENT capability set.
But now, I'm not able to compile my program on my actual Debian distro (kernel 5.10) because CAPNG_SELECT_AMBIENT does not exist anymore in cap-ng.h.
I notice that a new constant appeared: CAPNG_SELECT_BOTH
Can someone explain what happened to CAPNG_SELECT_AMBIENT?


1 Answer 1


Support for ambient capabilities was added to libcap-ng in upstream version 0.8, released in 2020-09-08. If you used it three years ago, you must have been using some pretty bleeding-edge distribution.

Debian 11's current version of that library (packages libcap-ng0, libcap-ng-dev) is still 0.7.9-2.2+b1 as of this writing.

So CAPNG_SELECT_AMBIENT has simply not arrived to the stable version of Debian yet. Debian 12 ("bookworm", the release currently in testing) seems to be getting version 0.8.3.

  • 1
    You asked for CAPNG_SELECT_AMBIENT: it's defined in /usr/include/cap-ng.h, which comes in Bookworm package libcap-ng-dev_0.8.3-1+b3. libcap-ng is not part of the "core" Linux capabilities, but an optional add-on library to make the use of the POSIX 1003.1e capabilities easier in user-space.
    – telcoM
    Commented Apr 2, 2023 at 12:15
  • Well spotted, noting that it appears that libcap-ng-dev has to be installed in addition to the normal libcap-dev. I've deleted my slightly older comment since I'd been using a brute-force search over the capability.h files and realised it was incomplete (and didn't manage to fix it within the 5 min editing window). Commented Apr 2, 2023 at 12:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .