Support hardcoded user.ima to security.ima translation
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
4179cbadd2
commit
29440346f1
@ -1096,7 +1096,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;
|
||||
@ -1137,9 +1138,15 @@ 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))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return g_variant_ref_sink (g_variant_builder_end (&builder));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user