capng_set_rootid(3)

capng_set_rootid3

Set namespace root id

Usage

#include <cap-ng.h>

int capng_set_rootid(uid_t rootid);

Overview

capng_set_rootid sets the root user ID for file capabilities operations. The value is host-endian and relative to the caller's user namespace. Pass CAPNG_UNSET_ROOTID to clear a previously selected namespace root ID and go back to writing regular V2 file capabilities. Other values select V3 file capabilities; the kernel validates and maps the user ID when the capabilities are written.

Return value

On success, it returns 0. It returns -1 if there is an internal error or the kernel headers used to build the library do not support V3 file capabilities.

Releases

3 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12–13
  2. Arch

Author

Steve Grubb

From libcap-ng 0.9.6-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.