Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sepolicy: Fix publicity mismatch for ostree_sepolicy_host_enabled #3196

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libostree/ostree-repo-checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ create_file_copy_from_input_at (OstreeRepo *repo, OstreeRepoCheckoutAtOptions *o
g_autoptr (GVariant) modified_xattrs = NULL;

/* If we're doing SELinux labeling, prepare it */
if (sepolicy_enabled && ostree_sepolicy_host_enabled (options->sepolicy))
if (sepolicy_enabled && _ostree_sepolicy_host_enabled (options->sepolicy))
{
/* If doing sepolicy path-based labeling, we don't want to set the
* security.selinux attr via the generic xattr paths in either the symlink
Expand Down Expand Up @@ -1045,7 +1045,7 @@ checkout_tree_at_recurse (OstreeRepo *self, OstreeRepoCheckoutAtOptions *options
};

/* If we're doing SELinux labeling, prepare it */
if (sepolicy_enabled && ostree_sepolicy_host_enabled (options->sepolicy))
if (sepolicy_enabled && _ostree_sepolicy_host_enabled (options->sepolicy))
{
/* We'll set the xattr via setfscreatecon(), so don't do it via generic xattrs below. */
modified_xattrs = _ostree_filter_selinux_xattr (xattrs);
Expand Down
2 changes: 2 additions & 0 deletions src/libostree/ostree-sepolicy-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ gboolean _ostree_sepolicy_preparefscreatecon (OstreeSepolicyFsCreatecon *con, Os

GVariant *_ostree_filter_selinux_xattr (GVariant *xattrs);

gboolean _ostree_sepolicy_host_enabled (OstreeSePolicy *self);

G_END_DECLS
4 changes: 2 additions & 2 deletions src/libostree/ostree-sepolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,13 +755,13 @@ _ostree_filter_selinux_xattr (GVariant *xattrs)
}

/**
* ostree_sepolicy_host_enabled:
* _ostree_sepolicy_host_enabled:
* @self: Policy
*
* Return if the host has selinux enabled
*/
gboolean
ostree_sepolicy_host_enabled (OstreeSePolicy *self)
_ostree_sepolicy_host_enabled (OstreeSePolicy *self)
{
#ifdef HAVE_SELINUX
return cached_is_selinux_enabled ();
Expand Down
3 changes: 0 additions & 3 deletions src/libostree/ostree-sepolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,4 @@ void ostree_sepolicy_fscreatecon_cleanup (void **unused);
#define ostree_cleanup_sepolicy_fscreatecon \
__attribute__ ((cleanup (ostree_sepolicy_fscreatecon_cleanup)))

_OSTREE_PUBLIC
gboolean ostree_sepolicy_host_enabled (OstreeSePolicy *self);

G_END_DECLS
Loading