selinux\_restorecon\_default\_handle(3) SELinux API documentation selinux\_restorecon\_default\_handle(3)

# [NAME](#NAME)

selinux\_restorecon\_default\_handle - sets default parameters for [**selinux\_restorecon**(3)](/man/os/libselinux/selinux_restorecon.3)

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;selinux/restorecon.h&gt;**  
**#include &lt;selinux/label.h&gt;**

**struct selabel\_handle \*selinux\_restorecon\_default\_handle(void);**

# [DESCRIPTION](#DESCRIPTION)

**selinux\_restorecon\_default\_handle**() sets default parameters for [**selinux\_restorecon**(3)](/man/os/libselinux/selinux_restorecon.3) by calling [**selabel\_open**(3)](/man/os/libselinux/selabel_open.3) with the **SELABEL\_OPT\_DIGEST** option only. This will enable a digest to be calculated on the currently loaded policy [**file\_contexts**(5)](/man/os/libselinux/file_contexts.5) set of files as described in the **NOTES** section of [**selinux\_restorecon**(3)](/man/os/libselinux/selinux_restorecon.3).

Calling **selinux\_restorecon\_default\_handle**() is optional, however if used then [**selinux\_restorecon\_set\_sehandle**(3)](/man/os/libselinux/selinux_restorecon_set_sehandle.3) should be called with the returned handle to set this for use by [**selinux\_restorecon**(3)](/man/os/libselinux/selinux_restorecon.3).

**selinux\_restorecon\_default\_handle**() is optional as [**selinux\_restorecon**(3)](/man/os/libselinux/selinux_restorecon.3) will automatically call this and [**selinux\_restorecon\_set\_sehandle**(3)](/man/os/libselinux/selinux_restorecon_set_sehandle.3) provided a handle has not already been set, for example by [**selinux\_restorecon\_set\_sehandle**(3)](/man/os/libselinux/selinux_restorecon_set_sehandle.3) to set customised [**selabel\_open**(3)](/man/os/libselinux/selabel_open.3) parameters.

# [RETURN VALUE](#RETURN_VALUE)

A non-NULL handle value is returned on success. On error, NULL is returned and *errno* is set appropriately.

# [SEE ALSO](#SEE_ALSO)

[**selinux\_restorecon**(3)](/man/os/libselinux/selinux_restorecon.3),  
[**selinux\_restorecon\_set\_sehandle**(3)](/man/os/libselinux/selinux_restorecon_set_sehandle.3),  
[**selinux\_restorecon\_set\_exclude\_list**(3)](/man/os/libselinux/selinux_restorecon_set_exclude_list.3),  
[**selinux\_restorecon\_set\_alt\_rootpath**(3)](/man/os/libselinux/selinux_restorecon_set_alt_rootpath.3),  
[**selinux\_restorecon\_xattr**(3)](/man/os/libselinux/selinux_restorecon_xattr.3)

20 Oct 2015 Security Enhanced Linux

---

Document: selinux_restorecon_default_handle(3) from libselinux 3.11-r2 (Chainguard OS)
Source: https://github.com/SELinuxProject/selinux.git
