Browse Source

New API call iso_image_get_ignore_aclea(),

new iso_image_set_ignore_aclea() and iso_file_source_get_aa_string() flag bit3 to import all xattr namespaces
release-1.5.4.branch
Thomas Schmitt 4 years ago
parent
commit
7d45c88cff
  1. 3
      libisofs/builder.c
  2. 6
      libisofs/fs_local.c
  3. 9
      libisofs/image.c
  4. 8
      libisofs/image.h
  5. 18
      libisofs/libisofs.h
  6. 3
      libisofs/libisofs.ver

3
libisofs/builder.c

@ -252,7 +252,8 @@ int default_create_node(IsoNodeBuilder *builder, IsoImage *image,
/* Obtain ownership of eventual AAIP string */
ret = iso_file_source_get_aa_string(src, &aa_string,
1 | (image->builder_ignore_acl << 1) |
(image->builder_ignore_ea << 2 ));
(image->builder_ignore_ea << 2) |
(image->builder_take_all_ea << 3));
if (ret == 1 && aa_string != NULL) {
ret = iso_node_add_xinfo(new, aaip_xinfo_func, aa_string);
if (ret < 0)

6
libisofs/fs_local.c

@ -1,6 +1,6 @@
/*
* Copyright (c) 2007 Vreixo Formoso
* Copyright (c) 2009 - 2011 Thomas Schmitt
* Copyright (c) 2009 - 2017 Thomas Schmitt
*
* This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
@ -507,7 +507,7 @@ int lfs_get_aa_string(IsoFileSource *src, unsigned char **aa_string, int flag)
*aa_string = NULL;
if ((flag & 3 ) == 3) {
if ((flag & 6 ) == 6) { /* Neither ACL nor xattr shall be read */
ret = 1;
goto ex;
}
@ -521,7 +521,7 @@ int lfs_get_aa_string(IsoFileSource *src, unsigned char **aa_string, int flag)
}
ret = aaip_get_attr_list(path, &num_attrs, &names,
&value_lengths, &values,
(!(flag & 2)) | 2 | (flag & 4) | 16);
(!(flag & 2)) | 2 | (flag & 4) | (flag & 8) | 16);
if (ret <= 0) {
if (ret == -2)
ret = ISO_AAIP_NO_GET_LOCAL;

9
libisofs/image.c

@ -610,6 +610,15 @@ void iso_image_set_ignore_aclea(IsoImage *image, int what)
{
image->builder_ignore_acl = (what & 1);
image->builder_ignore_ea = !!(what & 2);
image->builder_take_all_ea = !!(what & 8);
}
int iso_image_get_ignore_aclea(IsoImage *image)
{
return image->builder_ignore_acl |
(image->builder_ignore_ea << 1) |
(image->builder_take_all_ea << 3);
}

8
libisofs/image.h

@ -1,6 +1,6 @@
/*
* Copyright (c) 2007 Vreixo Formoso
* Copyright (c) 2009 - 2016 Thomas Schmitt
* Copyright (c) 2009 - 2017 Thomas Schmitt
*
* This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
@ -145,6 +145,12 @@ struct Iso_Image
*/
unsigned int builder_ignore_ea : 1;
/**
* If not builder_ignore_ea : import all xattr namespaces from local
* filesystem, not only "user.
*/
unsigned int builder_take_all_ea : 1;
/**
* Files to exclude. Wildcard support is included.
*/

18
libisofs/libisofs.h

@ -1280,6 +1280,8 @@ int iso_image_new(const char *name, IsoImage **image);
* A bit field which sets the behavior:
* bit0= ignore ACLs if the external file object bears some
* bit1= ignore xattr if the external file object bears some
* bit3= if not bit1: import all xattr namespaces, not only "user."
* @since 1.5.0
* all other bits are reserved
*
* @since 0.6.14
@ -1287,6 +1289,19 @@ int iso_image_new(const char *name, IsoImage **image);
void iso_image_set_ignore_aclea(IsoImage *image, int what);
/**
* Obtain the current setting of iso_image_set_ignore_aclea().
*
* @param image
* The image to be inquired
* @return
* The currently set value.
*
* @since 1.5.0
*/
int iso_image_get_ignore_aclea(IsoImage *image);
/**
* Creates an IsoWriteOpts for writing an image. You should set the options
* desired with the correspondent setters.
@ -6918,6 +6933,9 @@ int iso_file_source_readlink(IsoFileSource *src, char *buf, size_t bufsiz);
* not be able to produce it again.
* bit1= No need to get ACL (but no guarantee of exclusion)
* bit2= No need to get xattr (but no guarantee of exclusion)
* bit3= if not bit2: import all xattr namespaces from
* local filesystem, not only "user."
* @since 1.5.0
* @return 1 means success (*aa_string == NULL is possible)
* <0 means failure and must b a valid libisofs error code
* (e.g. ISO_FILE_ERROR if no better one can be found).

3
libisofs/libisofs.ver

@ -84,6 +84,7 @@ iso_image_add_new_special;
iso_image_add_new_symlink;
iso_image_attach_data;
iso_image_create_burn_source;
iso_image_dir_get_node;
iso_image_filesystem_new;
iso_image_fs_get_abstract_file_id;
iso_image_fs_get_application_id;
@ -106,8 +107,8 @@ iso_image_get_bootcat;
iso_image_get_boot_image;
iso_image_get_copyright_file_id;
iso_image_get_data_preparer_id;
iso_image_dir_get_node;
iso_image_get_hppa_palo;
iso_image_get_ignore_aclea;
iso_image_get_mips_boot_files;
iso_image_get_msg_id;
iso_image_get_publisher_id;

Loading…
Cancel
Save