OSTree.SePolicy¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
|||
r/w/co |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class OSTree.SePolicy(**kwargs)¶
- Bases:
- Abstract:
No
- classmethod fscreatecon_cleanup(unused)¶
- Parameters:
unused (
objectorNone) – Not used, just in case you didn’t infer that from the parameter name
Cleanup function for
OSTree.SePolicy.setfscreatecon().
- classmethod new(path, cancellable)¶
- Parameters:
path (
Gio.File) – Path to a root directorycancellable (
Gio.CancellableorNone) – Cancellable
- Raises:
- Returns:
An accessor object for SELinux policy in root located at path
- Return type:
- classmethod new_at(rootfs_dfd, cancellable)¶
- Parameters:
rootfs_dfd (
int) – Directory fd for rootfs (will not be cloned)cancellable (
Gio.CancellableorNone) – Cancellable
- Raises:
- Returns:
An accessor object for SELinux policy in root located at rootfs_dfd
- Return type:
New in version 2017.4.
- classmethod new_from_commit(repo, rev, cancellable)¶
- Parameters:
repo (
OSTree.Repo) – The reporev (
str) – ostree ref or checksumcancellable (
Gio.CancellableorNone) – Cancellable
- Raises:
- Returns:
A new policy
- Return type:
Extract the SELinux policy from a commit object via a partial checkout. This is useful for labeling derived content as separate commits.
This function is the backend of
ostree_repo_commit_modifier_set_sepolicy_from_commit().
- classmethod set_null_log()¶
Disable SELinux’s builtin logging; one rarely wants this enabled.
New in version 2025.2.
- get_label(relpath, unix_mode, cancellable)¶
- Parameters:
relpath (
str) – Pathunix_mode (
int) – Unix modecancellable (
Gio.CancellableorNone) – Cancellable
- Raises:
- Returns:
- out_label:
Return location for security context
- Return type:
Store in out_label the security context for the given relpath and mode unix_mode. If the policy does not specify a label,
Nonewill be returned.
- get_path()¶
-
This API should be considered deprecated, because it’s supported for policy objects to be created from file-descriptor relative paths, which may not be globally accessible.
- restorecon(path, info, target, flags, cancellable)¶
- Parameters:
path (
str) – Path string to use for policy lookupinfo (
Gio.FileInfoorNone) – File attributestarget (
Gio.File) – Physical path to target fileflags (
OSTree.SePolicyRestoreconFlags) – Flags controlling behaviorcancellable (
Gio.CancellableorNone) – Cancellable
- Raises:
- Returns:
- out_new_label:
New label, or
Noneif unchanged
- Return type:
Reset the security context of target based on the SELinux policy.
- setfscreatecon(path, mode)¶
- Parameters:
- Raises:
- Return type:
Property Details¶
- OSTree.SePolicy.props.path¶
- Name:
path- Type:
- Default Value:
- Flags:
- OSTree.SePolicy.props.rootfs_dfd¶
- Name:
rootfs-dfd- Type:
- Default Value:
-1- Flags: