mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-09-24 09:04:16 +00:00
Provide functions for manipulating arrays of extended attributes
* src/common.h (xheader_xattr_free,xheader_xattr_copy): Remove protos. (xattr_map_init,xattr_map_copy) (xattr_map_add,xattr_map_free): New protos. * src/tar.h (xattr_map): New struct. (tar_stat_info): Replace xattr_map_size and xattr_map with one field: xattr_map. * src/xattrs.c (XATTRS_PREFIX,XATTRS_PREFIX_LEN): New defines. (xheader_xattr_init,xattr_map_init) (xattr_map_free,xattr_map_add) (xheader_xattr_add,xattr_map_copy): New functions. All uses changed. * src/create.c (start_header): Update to use struct xattr_map. * src/extract.c: Update to use struct xattr_map. * src/tar.c: Likewise. * src/xheader.c (xheader_xattr_init,xheader_xattr_free) (xheader_xattr_add,xheader_xattr_copy): Remove. (xattr_coder,xattr_decoder): Use xattr_map_ functions.
This commit is contained in:
+3
-8
@@ -966,14 +966,9 @@ start_header (struct tar_stat_info *st)
|
||||
xheader_store ("RHT.security.selinux", st, NULL);
|
||||
if (xattrs_option > 0)
|
||||
{
|
||||
size_t scan_xattr = 0;
|
||||
struct xattr_array *xattr_map = st->xattr_map;
|
||||
|
||||
while (scan_xattr < st->xattr_map_size)
|
||||
{
|
||||
xheader_store (xattr_map[scan_xattr].xkey, st, &scan_xattr);
|
||||
++scan_xattr;
|
||||
}
|
||||
size_t i;
|
||||
for (i = 0; i < st->xattr_map.xm_size; i++)
|
||||
xheader_store (st->xattr_map.xm_map[i].xkey, st, &i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user