diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-28 23:08:39 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-28 23:34:17 +0200 |
commit | d758950ac88c2c6759d1616ac8be2c70c9dcf761 (patch) | |
tree | e96860712abea784525a2b7feb3a690b443e1372 /mkfs/selinux.c | |
parent | 9bcb6edfe419d390acddc2ed7d0c04d37b753ac3 (diff) |
Replace fstree/sqfshelper xattr code with sqfs_xattr_writer_t
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs/selinux.c')
-rw-r--r-- | mkfs/selinux.c | 9 |
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"); |