CAPNG_RESTORE_STATE(3)
π CAPNG_RESTORE_STATE β the libcap-ng glow-up page π
okay bestie, so this one lives in the Libcap-ng API, and it's literally the undo button for your library state. let's get into it π«Ά
β¨ NAME β¨
capng_restore_state β set the internal library state. that's it, that's the whole job, and she does it flawlessly π
πΈ SYNOPSIS πΈ
#include <cap-ng.h>
void capng_restore_state(void **state);
π¦ DESCRIPTION π¦
so capng_restore_state is the function that takes all that state info you saved earlier with capng_save_state and restores the library's internal state with it. it's giving "rewind, we're going back" βͺβ¨
heads up bestie: this function is not available in the python bindings. not everything gets to come to the party, iykyk π
π RETURN VALUE π
None. nothing. zero. she's a void, she doesn't return the gossip, she just does the thing π
π₯ NOTES π₯
capng_restore_statefrees the previouslymalloc'd state β so like, the state can't be restored multiple times. one save, one restore, periodt. try it twice and that's on you π- the working pid is part of the restored state, so if you're restoring the state to a different thread, you can use
capng_setpidto update it. cute little fix-up, no cap π
π SEE ALSO π
π AUTHOR π
Steve Grubb β the icon, the legend, the author of this whole situation π
and that's the page bestie!! this little masterpiece shipped out of Red Hat back in March 2026 (yes, she's from the future, we don't ask questions π§β¨). go save that state, go restore that state, and stay slaying fr fr πππ¦
π¦ where this page comes from
- arch rolling: libcap-ng 0.9.6-1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 10: libcap-ng-devel 0.9.3-2.el10 Β· LGPL-2.0-or-later
- fedora 43: libcap-ng-devel 0.9.6-1.fc43 Β· LGPL-2.0-or-later
- fedora 43: libcap-ng-devel 0.9.6-1.fc43 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.2-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.2-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.6-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: libcap-ng-devel 0.9.6-1.fc44 Β· LGPL-2.0-or-later
- nixos 26.05: libcap-ng 0.9.3
- nixpkgs unstable: libcap-ng 0.9.6
- ubuntu stonking: libcap-ng-dev 0.9.6-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms