diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sqfs2tar/src/sqfs2tar.h | 2 | ||||
-rw-r--r-- | bin/sqfs2tar/src/write_tree.c | 4 | ||||
-rw-r--r-- | bin/sqfs2tar/src/xattr.c | 23 | ||||
-rw-r--r-- | bin/tar2sqfs/src/process_tarball.c | 2 |
4 files changed, 12 insertions, 19 deletions
diff --git a/bin/sqfs2tar/src/sqfs2tar.h b/bin/sqfs2tar/src/sqfs2tar.h index 4bf5428..88185ee 100644 --- a/bin/sqfs2tar/src/sqfs2tar.h +++ b/bin/sqfs2tar/src/sqfs2tar.h @@ -48,7 +48,7 @@ char *assemble_tar_path(char *name, bool is_dir); /* xattr.c */ int get_xattrs(const char *name, const sqfs_inode_generic_t *inode, - tar_xattr_t **out); + dir_entry_xattr_t **out); /* write_tree.c */ int write_tree(const sqfs_tree_node_t *n); diff --git a/bin/sqfs2tar/src/write_tree.c b/bin/sqfs2tar/src/write_tree.c index 354ec21..150bac1 100644 --- a/bin/sqfs2tar/src/write_tree.c +++ b/bin/sqfs2tar/src/write_tree.c @@ -68,7 +68,7 @@ static void inode_stat(const sqfs_tree_node_t *node, struct stat *sb) static int write_tree_dfs(const sqfs_tree_node_t *n) { sqfs_hard_link_t *lnk = NULL; - tar_xattr_t *xattr = NULL; + dir_entry_xattr_t *xattr = NULL; char *name, *target; struct stat sb; size_t len; @@ -134,7 +134,7 @@ static int write_tree_dfs(const sqfs_tree_node_t *n) target = S_ISLNK(sb.st_mode) ? (char *)n->inode->extra : NULL; ret = write_tar_header(out_file, &sb, name, target, xattr, record_counter++); - free_xattr_list(xattr); + dir_entry_xattr_list_free(xattr); if (ret > 0) goto out_skip; diff --git a/bin/sqfs2tar/src/xattr.c b/bin/sqfs2tar/src/xattr.c index abec4fb..8d21cd8 100644 --- a/bin/sqfs2tar/src/xattr.c +++ b/bin/sqfs2tar/src/xattr.c @@ -6,32 +6,25 @@ */ #include "sqfs2tar.h" -static tar_xattr_t *mkxattr(const sqfs_xattr_entry_t *key, - const sqfs_xattr_value_t *value) +static dir_entry_xattr_t *mkxattr(const sqfs_xattr_entry_t *key, + const sqfs_xattr_value_t *value) { - tar_xattr_t *ent; - - ent = calloc(1, sizeof(*ent) + strlen((const char *)key->key) + - value->size + 2); + dir_entry_xattr_t *ent; + ent = dir_entry_xattr_create((const char *)key->key, + value->value, value->size); if (ent == NULL) { perror("creating xattr entry"); return NULL; } - ent->key = ent->data; - ent->value = (sqfs_u8 *)ent->key + strlen((const char *)key->key) + 1; - ent->value_len = value->size; - - strcpy(ent->key, (const char *)key->key); - memcpy(ent->value, value->value, value->size + 1); return ent; } int get_xattrs(const char *name, const sqfs_inode_generic_t *inode, - tar_xattr_t **out) + dir_entry_xattr_t **out) { - tar_xattr_t *list = NULL, *ent; + dir_entry_xattr_t *list = NULL, *ent; sqfs_xattr_value_t *value; sqfs_xattr_entry_t *key; sqfs_xattr_id_t desc; @@ -86,6 +79,6 @@ int get_xattrs(const char *name, const sqfs_inode_generic_t *inode, *out = list; return 0; fail: - free_xattr_list(list); + dir_entry_xattr_list_free(list); return -1; } diff --git a/bin/tar2sqfs/src/process_tarball.c b/bin/tar2sqfs/src/process_tarball.c index 2ba018d..bcc60db 100644 --- a/bin/tar2sqfs/src/process_tarball.c +++ b/bin/tar2sqfs/src/process_tarball.c @@ -41,7 +41,7 @@ static int write_file(istream_t *input_file, sqfs_writer_t *sqfs, static int copy_xattr(sqfs_writer_t *sqfs, tree_node_t *node, const tar_header_decoded_t *hdr) { - tar_xattr_t *xattr; + dir_entry_xattr_t *xattr; int ret; ret = sqfs_xattr_writer_begin(sqfs->xwr, 0); |