New API calls isoburn_igopt_set_max_ce_entries(), isoburn_igopt_get_max_ce_entries()

This commit is contained in:
Thomas Schmitt 2023-01-22 16:13:57 +01:00
parent c310e2abc1
commit 9a578a657f
5 changed files with 87 additions and 4 deletions

View File

@ -7,7 +7,7 @@
Class core of libisoburn.
Copyright 2007 - 2009 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Copyright 2007 - 2021 Thomas Schmitt <scdbackup@gmx.net>
Copyright 2007 - 2023 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -481,6 +481,13 @@ int isoburn_make_iso_write_opts(struct isoburn *out_o,
if(opts->vol_uuid[0] == 0 && opts->gpt_guid_mode == 2)
guid_mode= 0;
iso_write_opts_set_gpt_guid(wopts, opts->gpt_guid, guid_mode);
ret = iso_write_opts_set_max_ce_entries(wopts, opts->max_ce_entries,
opts->max_ce_entries_flag);
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot set limit for number of CE entries",
0, "FAILURE", 0);
{ret= -1; goto ex;}
}
iso_write_opts_attach_jte(wopts, opts->libjte_handle);
iso_write_opts_set_hfsp_serial_number(wopts, opts->hfsp_serial_number);
@ -1204,6 +1211,8 @@ int isoburn_igopt_new(struct isoburn_imgen_opts **new_o, int flag)
o->iso_mbr_part_type= -1;
memset(o->gpt_guid, 0, 16);
o->gpt_guid_mode= 0;
o->max_ce_entries= 31; /* Linux hates >= RR_MAX_CE_ENTRIES = 32 */
o->max_ce_entries_flag= 2; /* omit non-isofs fattr and ACL if needed */
memset(o->hfsp_serial_number, 0, 8);
o->hfsp_block_size= 0;
o->apm_block_size= 0;
@ -1937,6 +1946,32 @@ int isoburn_igopt_get_gpt_guid(struct isoburn_imgen_opts *opts,
}
int isoburn_igopt_set_max_ce_entries(struct isoburn_imgen_opts *opts,
uint32_t num, int flag)
{
if(num > 100000) {
isoburn_msgs_submit(NULL, 0x00060000,
"Too many CE entries enabled for single file (max 100000)",
0, "SORRY", 0);
return(0);
}
if(num == 0)
num= 1;
opts->max_ce_entries= num;
opts->max_ce_entries_flag= (flag & 15);
return(1);
}
int isoburn_igopt_get_max_ce_entries(struct isoburn_imgen_opts *opts,
uint32_t *num, int *max_ce_flag)
{
*num= opts->max_ce_entries;
*max_ce_flag= opts->max_ce_entries_flag;
return(1);
}
int isoburn_igopt_set_disc_label(struct isoburn_imgen_opts *opts, char *label)
{
strncpy(opts->ascii_disc_label, label, Libisoburn_disc_label_sizE - 1);

View File

@ -3,7 +3,7 @@
Class struct of libisoburn.
Copyright 2007 - 2009 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Copyright 2007 - 2020 Thomas Schmitt <scdbackup@gmx.net>
Copyright 2007 - 2023 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -769,6 +769,9 @@ struct isoburn_imgen_opts {
/* Whether to fsync() stdio_drives after isoburn_activate_session() */
int do_fsync;
/* See libisoburn.h isoburn_igopt_set_max_ce_entries() */
uint32_t max_ce_entries;
int max_ce_entries_flag;
};

View File

@ -6,7 +6,7 @@
Lower level API definition of libisoburn.
Copyright 2007-2009 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Copyright 2007-2022 Thomas Schmitt <scdbackup@gmx.net>
Copyright 2007-2023 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -2183,6 +2183,48 @@ int isoburn_igopt_set_gpt_guid(struct isoburn_imgen_opts *opts,
int isoburn_igopt_get_gpt_guid(struct isoburn_imgen_opts *opts,
uint8_t guid[16], int *mode);
/** Set the maximum number of SUSP CE entries and thus continuation areas.
Each continuation area can hold at most 2048 bytes of SUSP data (Rock Ridge
or AAIP). The first area can be smaller. There might be some waste at the
end of each area.
When the maximum number is exceeded during ISO filesystem production
then possibly xattr and ACL get removed or error ISO_TOO_MANY_CE gets
reported and filesystem production is prevented.
Files with 32 or more CE entries do not show up in mounted filesystems on
Linux. So the default setting is 31 with drop mode 2. If a higher limit is
chosen and 31 gets surpassed, then a warning message gets reported.
@since 1.5.6
@param opts
The option set to be inquired.
@param num
The maximum number of CE entries per file.
Not more than 100000 may be set here.
0 gets silently mapped to 1,because the root directory needs one CE.
@param flag
bit0-bit3 = Drop mode: What to do with AAIP data on too many CE:
0 = throw ISO_TOO_MANY_CE, without dropping anything
1 = permanently drop non-isofs fattr from IsoNode and
retry filesystem production
2 = drop ACL if dropping non-isofs fattr does not suffice
@return
<=0 = error, 1 = success
*/
int isoburn_igopt_set_max_ce_entries(struct isoburn_imgen_opts *opts,
uint32_t num, int flag);
/** Inquire the current setting of isoburn_igopt_().
@since 1.5.6
@param opts
The option set to be inquired.
@param num
Returns the current setting
@param max_ce_flag
Returns the current flag setting
@return
<=0 = error, 1 = success
*/
int isoburn_igopt_get_max_ce_entries(struct isoburn_imgen_opts *opts,
uint32_t *num, int *max_ce_flag);
/** Set a name for the system area. This setting is ignored unless system area
type 3 "SUN Disk Label" is in effect by iso_write_opts_set_system_area().

View File

@ -43,6 +43,7 @@ isoburn_igopt_get_hfsp_serial_number;
isoburn_igopt_get_iso_mbr_part_type;
isoburn_igopt_get_iso_type_guid;
isoburn_igopt_get_level;
isoburn_igopt_get_max_ce_entries;
isoburn_igopt_get_out_charset;
isoburn_igopt_get_over_mode;
isoburn_igopt_get_over_ugid;
@ -74,6 +75,7 @@ isoburn_igopt_set_hfsp_serial_number;
isoburn_igopt_set_iso_mbr_part_type;
isoburn_igopt_set_iso_type_guid;
isoburn_igopt_set_level;
isoburn_igopt_set_max_ce_entries;
isoburn_igopt_set_out_charset;
isoburn_igopt_set_over_mode;
isoburn_igopt_set_over_ugid;
@ -173,6 +175,7 @@ Xorriso_option_application_id;
Xorriso_option_application_use;
Xorriso_option_as;
Xorriso_option_assert_volid;
Xorriso_option_assess_indev_features;
Xorriso_option_auto_charset;
Xorriso_option_backslash_codes;
Xorriso_option_ban_stdio_write;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2023.01.10.180154"
#define Xorriso_timestamP "2023.01.22.151329"