Skip to content

Commit

Permalink
Support hardcoded user.ima to security.ima translation
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Berger <[email protected]>
  • Loading branch information
stefanberger committed Apr 13, 2021
1 parent 9af4e82 commit 7a4858e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/libpriv/rpmostree-postprocess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,8 @@ filter_xattrs_impl (OstreeRepo *repo,
/* If you have a use case for something else, file an issue */
static const char *accepted_xattrs[] =
{ "security.capability", /* https://lwn.net/Articles/211883/ */
"user.pax.flags" /* https://github.com/projectatomic/rpm-ostree/issues/412 */
"user.pax.flags", /* https://github.com/projectatomic/rpm-ostree/issues/412 */
"user.ima" /* will be replaced with security.ima */
};
g_autoptr(GVariant) existing_xattrs = NULL;
g_autoptr(GVariantIter) viter = NULL;
Expand Down Expand Up @@ -1266,7 +1267,13 @@ filter_xattrs_impl (OstreeRepo *repo,
const char *validkey = accepted_xattrs[i];
const char *attrkey = g_variant_get_bytestring (key);
if (g_str_equal (validkey, attrkey))
g_variant_builder_add (&builder, "(@ay@ay)", key, value);
{
if (g_str_equal (validkey, "user.ima"))
g_variant_builder_add (&builder, "(@ay@ay)",
g_variant_new_bytestring ("security.ima"), value);
else
g_variant_builder_add (&builder, "(@ay@ay)", key, value);
}
}
}

Expand Down

0 comments on commit 7a4858e

Please sign in to comment.