selinux_relabel


Description:

[ Version ( since = "1.33.43" ) ]
public bool selinux_relabel (string specfile, string path, SelinuxRelabel? optargs) throws Error

relabel parts of the filesystem

SELinux relabel parts of the filesystem.

The specfile parameter controls the policy spec file used. You have to parse "/etc/selinux/config" to find the correct SELinux policy and then pass the spec file, usually: "/etc/selinux/" + *selinuxtype* + "/contexts/files/file_contexts".

The required path parameter is the top level directory where relabelling starts. Normally you should pass path as "/" to relabel the whole guest filesystem.

The optional force boolean controls whether the context is reset for customizable files, and also whether the user, role and range parts of the file context is changed.

This function depends on the feature "selinuxrelabel". See also feature_available.

Parameters:

this

A GuestfsSession object

optargs

a GuestfsSelinuxRelabel containing optional arguments

Returns:

true on success, false on error