aboutsummaryrefslogtreecommitdiff
path: root/mkfs/selinux.c
diff options
context:
space:
mode:
Diffstat (limited to 'mkfs/selinux.c')
-rw-r--r--mkfs/selinux.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mkfs/selinux.c b/mkfs/selinux.c
index a4cda71..d5de9a8 100644
--- a/mkfs/selinux.c
+++ b/mkfs/selinux.c
@@ -10,7 +10,7 @@
#define XATTR_VALUE_SELINUX "system_u:object_r:unlabeled_t:s0"
#ifdef WITH_SELINUX
-int selinux_relable_node(void *sehnd, fstree_t *fs,
+int selinux_relable_node(void *sehnd, sqfs_xattr_writer_t *xwr,
tree_node_t *node, const char *path)
{
char *context = NULL;
@@ -22,8 +22,13 @@ int selinux_relable_node(void *sehnd, fstree_t *fs,
goto fail;
}
- ret = fstree_add_xattr(fs, node, XATTR_NAME_SELINUX, context);
+ ret = sqfs_xattr_writer_add(xwr, XATTR_NAME_SELINUX,
+ context, strlen(context));
free(context);
+
+ if (ret)
+ fputs("Error relabeling tree node\n", stderr);
+
return ret;
fail:
perror("relabeling files");