summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-04 13:26:27 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-04 13:42:06 +0200
commit2ed6658bbce90e89f0a4e3aba41704944f10b1f1 (patch)
treee8b60a37ab1e310a6c65c2e84b30cfc15eb8a1c5 /lib
parent6623b1fe4df1e2fceb27eff286a86cf36809b2bc (diff)
tar2sqfs: repack extended attributes into squashfs filesystem
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/sqfs/write_xattr.c10
1 files changed, 8 insertions, 2 deletions
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);