selinux_r...ult_handle(3)
β¨ NAME β¨
selinux_restorecon_default_handle β bestie, this one sets the default parameters for selinux_restorecon(3) π
π SYNOPSIS π
#include <selinux/restorecon.h>
#include <selinux/label.h>
struct selabel_handle *selinux_restorecon_default_handle(void);
π DESCRIPTION π
okay so. selinux_restorecon_default_handle() sets the default parameters for selinux_restorecon(3) by calling selabel_open(3) with the SELABEL_OPT_DIGEST option and literally nothing else. That one option is the whole vibe. β¨
What it does for you: it turns on a digest being calculated on the currently loaded policy file_contexts(5) set of files β exactly like it's described in the NOTES section of selinux_restorecon(3). no cap, go read that section, it's giving lore.
Calling selinux_restorecon_default_handle() is optional, but if you do use it, then you should call selinux_restorecon_set_sehandle(3) with the handle it hands back, so that handle actually gets set for use by selinux_restorecon(3). like, you can't just hold the handle and do nothing with it, that's not the move π«Ά
And why is it optional, you ask? because selinux_restorecon(3) will automatically call this one and selinux_restorecon_set_sehandle(3) all on its own β provided a handle has not already been set. for example, by selinux_restorecon_set_sehandle(3) being used to set customised selabel_open(3) parameters. so if you already did the custom thing, it respects that and doesn't step on your toes. iconic behaviour honestly π
πΈ RETURN VALUE πΈ
- On success: a non-NULL handle value comes back to you. slay. π
- On error:
NULLis returned, anderrnois set appropriately. π
π¦ SEE ALSO π¦
selinux_restorecon(3)selinux_restorecon_set_sehandle(3)selinux_restorecon_set_exclude_list(3)selinux_restorecon_set_alt_rootpath(3)selinux_restorecon_xattr(3)
mwah, that's the whole page bestie β brought to you by Security Enhanced Linux, dated 20 Oct 2015, chilling in manual section 3 of the SELinux API documentation. go forth and restore those contexts, you absolute main character π π
π¦ where this page comes from
- alpine 3.24: libselinux-doc 3.10-r1 Β· Public-Domain
- centos-stream 10: libselinux-devel 3.11-3.el10 Β· LicenseRef-Fedora-Public-Domain
- centos-stream 9: libselinux-devel 3.6-5.el9 Β· Public Domain
- centos-stream 9: libselinux-devel 3.6-5.el9 Β· Public Domain
- debian bookworm: libselinux1-dev 3.4-1+b6
- debian trixie: libselinux1-dev 3.8.1-1 Β· LicenseRef-public-domain
- fedora 43: libselinux-devel 3.9-5.fc43 Β· LicenseRef-Fedora-Public-Domain
- fedora 43: libselinux-devel 3.9-5.fc43 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.10-1.fc44 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.10-1.fc44 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.11-2.fc44 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-devel 3.11-2.fc44 Β· LicenseRef-Fedora-Public-Domain
- nixos 26.05: libselinux 3.10
- nixpkgs unstable: libselinux 3.11
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: libselinux-devel 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- ubuntu jammy: libselinux1-dev 3.3-1build2
- ubuntu noble: libselinux1-dev 3.5-2ubuntu2 Β· LicenseRef-public-domain
- ubuntu noble: libselinux1-dev 3.5-2ubuntu2.1 Β· LicenseRef-public-domain
- ubuntu questing: libselinux1-dev 3.8.1-1build1
- ubuntu resolute: libselinux-dev 3.9-4build1 Β· LicenseRef-public-domain
- ubuntu stonking: libselinux-dev 3.11-2.1 Β· LicenseRef-public-domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms