diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-05 19:15:13 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-05 16:22:00 +0200 |
commit | 2d3cb9c4323a803268206db3a9363abc67d908d0 (patch) | |
tree | ebf126a48931b46f5d76c42818754dbf054c68b5 /bin | |
parent | c9a8adc15f9de110771156fdc85fb98533648a53 (diff) |
libsqfs: Add an xattr writer function to add a combined key-value struct
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/gensquashfs/src/dirscan_xattr.c | 2 | ||||
-rw-r--r-- | bin/gensquashfs/src/filemap_xattr.c | 2 | ||||
-rw-r--r-- | bin/gensquashfs/src/selinux.c | 4 | ||||
-rw-r--r-- | bin/tar2sqfs/src/process_tarball.c | 6 |
4 files changed, 7 insertions, 7 deletions
diff --git a/bin/gensquashfs/src/dirscan_xattr.c b/bin/gensquashfs/src/dirscan_xattr.c index e39a868..1bc829f 100644 --- a/bin/gensquashfs/src/dirscan_xattr.c +++ b/bin/gensquashfs/src/dirscan_xattr.c @@ -95,7 +95,7 @@ static int xattr_from_path(sqfs_xattr_writer_t *xwr, const char *path) goto fail; } - ret = sqfs_xattr_writer_add(xwr, key, value, vallen); + ret = sqfs_xattr_writer_add_kv(xwr, key, value, vallen); if (ret) { sqfs_perror(path, "storing xattr key-value pairs", diff --git a/bin/gensquashfs/src/filemap_xattr.c b/bin/gensquashfs/src/filemap_xattr.c index 0870d3b..508e75a 100644 --- a/bin/gensquashfs/src/filemap_xattr.c +++ b/bin/gensquashfs/src/filemap_xattr.c @@ -240,7 +240,7 @@ xattr_apply_map_file(char *path, void *map, sqfs_xattr_writer_t *xwr) { printf(" %s = \n", entry->key); fwrite(entry->value, entry->value_len, 1, stdout); puts("\n"); - ret = sqfs_xattr_writer_add( + ret = sqfs_xattr_writer_add_kv( xwr, entry->key, entry->value, entry->value_len); if (ret < 0) { return ret; diff --git a/bin/gensquashfs/src/selinux.c b/bin/gensquashfs/src/selinux.c index 678723b..24fba54 100644 --- a/bin/gensquashfs/src/selinux.c +++ b/bin/gensquashfs/src/selinux.c @@ -22,8 +22,8 @@ int selinux_relable_node(void *sehnd, sqfs_xattr_writer_t *xwr, goto fail; } - ret = sqfs_xattr_writer_add(xwr, XATTR_NAME_SELINUX, - context, strlen(context)); + ret = sqfs_xattr_writer_add_kv(xwr, XATTR_NAME_SELINUX, + context, strlen(context)); free(context); if (ret) diff --git a/bin/tar2sqfs/src/process_tarball.c b/bin/tar2sqfs/src/process_tarball.c index 5b0cbdd..9ad7d9a 100644 --- a/bin/tar2sqfs/src/process_tarball.c +++ b/bin/tar2sqfs/src/process_tarball.c @@ -56,7 +56,9 @@ static int copy_xattr(sqfs_writer_t *sqfs, const char *filename, } for (xattr = list; xattr != NULL; xattr = xattr->next) { - if (sqfs_get_xattr_prefix_id(xattr->key) < 0) { + ret = sqfs_xattr_writer_add(sqfs->xwr, xattr); + + if (ret == SQFS_ERROR_UNSUPPORTED) { fprintf(stderr, "%s: squashfs does not " "support xattr prefix of %s\n", dont_skip ? "ERROR" : "WARNING", @@ -67,8 +69,6 @@ static int copy_xattr(sqfs_writer_t *sqfs, const char *filename, continue; } - ret = sqfs_xattr_writer_add(sqfs->xwr, xattr->key, xattr->value, - xattr->value_len); if (ret) { sqfs_perror(filename, "storing xattr key-value pair", ret); |