From 2ed6658bbce90e89f0a4e3aba41704944f10b1f1 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 4 Jul 2019 13:26:27 +0200 Subject: tar2sqfs: repack extended attributes into squashfs filesystem Signed-off-by: David Oberhollenzer --- lib/sqfs/write_xattr.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/sqfs/write_xattr.c b/lib/sqfs/write_xattr.c index b6198b4..ab2e28c 100644 --- a/lib/sqfs/write_xattr.c +++ b/lib/sqfs/write_xattr.c @@ -30,10 +30,14 @@ static int get_prefix(const char *key) } } - fprintf(stderr, "unknown xattr key '%s'\n", key); return -1; } +bool sqfs_has_xattr(const char *key) +{ + return get_prefix(key) >= 0; +} + static int write_pair(meta_writer_t *mw, const char *key, const char *value) { sqfs_xattr_entry_t kent; @@ -41,8 +45,10 @@ static int write_pair(meta_writer_t *mw, const char *key, const char *value) int type; type = get_prefix(key); - if (type < 0) + if (type < 0) { + fprintf(stderr, "unsupported xattr key '%s'\n", key); return -1; + } key = strchr(key, '.'); assert(key != NULL); -- cgit v1.2.3