From dfd0a8cc817bd525dc2b12513f007d55ac57332f Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Wed, 17 Jul 2024 21:44:14 +0200 Subject: [PATCH] New flag bit 11 "do not ignore Linux-like file attributes" with isoburn_drive_aquire(). New isoburn_read_opts extension isoburn_ropt_lfa_flags. --- libisoburn/burn_wrap.c | 9 ++++++--- libisoburn/isoburn.c | 2 ++ libisoburn/isoburn.h | 3 +++ libisoburn/isofs_wrap.c | 2 ++ libisoburn/libisoburn.h | 24 +++++++++++++++++++++--- xorriso/xorriso_timestamp.h | 2 +- 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/libisoburn/burn_wrap.c b/libisoburn/burn_wrap.c index a68ba6c4..990f31ae 100644 --- a/libisoburn/burn_wrap.c +++ b/libisoburn/burn_wrap.c @@ -345,6 +345,7 @@ int isoburn_is_intermediate_dvd_rw(struct burn_drive *d, int flag) and scan until end of medium. bit10= if not bit6: accept all xattr namespaces from external filesystems, not only "user.". + bit11= load lfa_flags (chattr) from external filesystems */ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d, int flag) @@ -389,7 +390,8 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d, (*o)->msgs_submit_handle= libisoburn_default_msgs_submit_handle; (*o)->msgs_submit_flag= libisoburn_default_msgs_submit_flag; iso_image_set_ignore_aclea((*o)->image, - ((flag >> 5 ) & 3) | ((!!(flag & 1024)) << 3)); + ((flag >> 5 ) & 3) | ((!!(flag & 1024)) << 3) | + ((!!(flag & (1 << 11))) << 2)); #ifdef Hardcoded_cd_rW /* <<< A70929 : hardcoded CD-RW with fabricated -msinfo */ @@ -541,6 +543,7 @@ ex: and scan until end of medium. bit10= if not bit6: accept all xattr namespaces from external filesystems, not only "user.". + bit11= load lfa_flags (chattr) from external filesystems */ int isoburn_drive_aquire(struct burn_drive_info *drive_infos[], char *adr, int flag) @@ -567,8 +570,8 @@ int isoburn_drive_aquire(struct burn_drive_info *drive_infos[], goto ex; drive_grabbed= 1; ret= isoburn_welcome_media(&o, (*drive_infos)[0].drive, - (flag & (8 | 16 | 32 | 64 | 128 | 512 | 1024)) | - !!(flag&2)); + (flag & (8 | 16 | 32 | 64 | 128 | 512 | 1024 | (1 << 11))) | + !!(flag & 2)); if(ret<=0) goto ex; diff --git a/libisoburn/isoburn.c b/libisoburn/isoburn.c index ddc0905e..282fa746 100644 --- a/libisoburn/isoburn.c +++ b/libisoburn/isoburn.c @@ -882,6 +882,7 @@ int isoburn_ropt_new(struct isoburn_read_opts **new_o, int flag) o->noaaip= 1; o->noacl= 1; o->noea= 1; + o->lfa_flags= 0; o->noino= 1; o->nomd5= 1; o->preferjoliet= 0; @@ -983,6 +984,7 @@ int isoburn_ropt_set_extensions(struct isoburn_read_opts *o, int ext) o->map_mode= (ext >> 12) & 3; o->do_joliet_map= !!(ext & 16384); o->joliet_map_mode= !!(ext & 32768); + o->lfa_flags= !!(ext & (1 << 16)); return(1); } diff --git a/libisoburn/isoburn.h b/libisoburn/isoburn.h index eea269eb..a47b6026 100644 --- a/libisoburn/isoburn.h +++ b/libisoburn/isoburn.h @@ -334,6 +334,9 @@ struct isoburn_read_opts { unsigned int noacl:1; /* Do not read ACL from external file objects */ unsigned int noea:1; /* Do not read XFS-style EA from externals */ + /* ts C40716 */ + unsigned int lfa_flags:1; /* Read Linux file attribute flags (chattr) */ + /* ts A90508 */ unsigned int noino:1; /* Discard eventual PX inode numbers */ diff --git a/libisoburn/isofs_wrap.c b/libisoburn/isofs_wrap.c index 5e1a467b..89dc4633 100644 --- a/libisoburn/isofs_wrap.c +++ b/libisoburn/isofs_wrap.c @@ -353,6 +353,8 @@ create_blank_image:; isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0); goto create_blank_image; } + iso_image_set_ignore_aclea(o->image, read_opts->noacl | (read_opts->noea << 1) + | (read_opts->lfa_flags << 2)); /* Important: do not return until iso_read_opts_free() */ diff --git a/libisoburn/libisoburn.h b/libisoburn/libisoburn.h index 61049bbf..c66673be 100644 --- a/libisoburn/libisoburn.h +++ b/libisoburn/libisoburn.h @@ -438,9 +438,13 @@ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[], (depending on media type and drive this might help or it might make the resulting toc even worse) bit4= do not emulate table of content on overwritable media - bit5= ignore ACL from external filesystems + bit5= ignore ACL from external filesystems. + This can later be overriden by isoburn_read_image() + according to its isoburn_read_opts. bit6= ignore POSIX Extended Attributes from external filesystems (xattr) + This can later be overriden by isoburn_read_image() + according to its isoburn_read_opts. bit7= pretend read-only profile and scan for table of content bit8= re-assess already acquired (*drive_infos)[0] rather than acquiring adr @@ -452,6 +456,12 @@ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[], bit10= if not bit6: accept all xattr namespaces from external filesystems, not only "user.". @since 1.5.0 + bit11= do not ignore Linux-like file attributes (chattr) from + external filesystems. See occurences of "lfa_flags" + and "chattr" in libisofs.h. + This can later be overriden by isoburn_read_image() + according to its isoburn_read_opts. + @since 1.5.8 @return 1 = success , 0 = drive not found , <0 = other error Please excuse the typo "aquire" in the function name. @@ -941,10 +951,12 @@ int isoburn_ropt_get_data_cache(struct isoburn_read_opts *o, @since 0.3.4 Do not obtain ACL from external filesystem objects (e.g. local filesystem files). + This overrides the setting by isoburn_drive_aquire(). bit7= noea @since 0.3.4 - Do not obtain XFS-style Extended Attributes from external - filesystem objects (e.g. local filesystem files). + Do not obtain XFS-style Extended Attributes (xattr) from + external filesystem objects (e.g. local filesystem files). + This overrides the setting by isoburn_drive_aquire(). bit8= noino @since 0.4.0 Do not load eventual inode numbers from RRIP entry PX, @@ -988,6 +1000,11 @@ int isoburn_ropt_get_data_cache(struct isoburn_read_opts *o, record (not suitable for writing them to a new ISO filesystem) 1 = stripped: strip off trailing ";1" or ".;1" + bit16= lfa_flags + Obtain Linux file attribute flags (chattr) from + external filesystem objects (e.g. local filesystem files). + This overrides the setting by isoburn_drive_aquire(). + @since 1.5.8 @return 1 success, <=0 failure */ @@ -1008,6 +1025,7 @@ int isoburn_ropt_get_data_cache(struct isoburn_read_opts *o, #define isoburn_ropt_map_lowercase ( 2048 | 12288 ) #define isoburn_ropt_joliet_unmapped ( 16384 | 0) #define isoburn_ropt_joliet_stripped ( 16384 | 32768) +#define isoburn_ropt_lfa_flags (1 << 16) int isoburn_ropt_set_extensions(struct isoburn_read_opts *o, int ext); int isoburn_ropt_get_extensions(struct isoburn_read_opts *o, int *ext); diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 62452b8f..2db3950e 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2024.06.29.213042" +#define Xorriso_timestamP "2024.07.17.194323"