Let -for_backup perform -lfa_flags only if enabled at compile time in libisofs

This commit is contained in:
Thomas Schmitt 2024-07-23 17:30:57 +02:00
parent 60b8fa7bee
commit 9ca64c4e9f
10 changed files with 125 additions and 88 deletions

View File

@ -1637,6 +1637,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
Xorriso_option_acl(xorriso, "on", 0);
Xorriso_option_xattr(xorriso, "any", 0);
Xorriso_option_md5(xorriso, "on", 0);
if(xorriso->lfa_flags_default & 8)
Xorriso_option_lfa_flags(xorriso, "default:on:no_restore", 0);
} else if(strcmp(argpt, "-z")==0 ||

View File

@ -243,6 +243,15 @@ LIBISOBURN_MISCONFIGURATION_ = 0;
/* Second initialization. This time with libs. */
Xorriso_preparer_string(xorriso, xorriso->preparer_id, 0);
/* Inquire lfa capabilities of libisofs */
xorriso->lfa_flags_setting&= ~8;
xorriso->lfa_flags_default&= ~8;
ret= iso_local_attr_support(4);
if(ret & 4) {
xorriso->lfa_flags_setting|= 8;
xorriso->lfa_flags_default|= 8;
}
Xorriso_process_msg_queues(xorriso,0);
if(reason[0]) {
sprintf(xorriso->info_text, "%s", reason);

View File

@ -1946,7 +1946,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" Enable or disable processing of MD5 checksums.",
" -for_backup",
" Shortcut for: -hardlinks on -acl on -xattr any -md5 on",
" -lfa_flags default:on:restore_mask=aAcCdDijmPsStTux",
" possibly: -lfa_flags default:on:restore_mask=aAcCdDijmPsStTux",
" -ecma119_map \"unmapped\"|\"stripped\"|\"uppercase\"|\"lowercase\"",
" Choose conversion of file names if neither Rock Ridge",
" nor Joliet is present in the loaded ISO session.",

View File

@ -1436,6 +1436,7 @@ next_command:;
Xorriso_option_acl(xorriso, "on", 0);
Xorriso_option_xattr(xorriso, "any", 0);
Xorriso_option_md5(xorriso, "on", 0);
if(xorriso->lfa_flags_default & 8)
Xorriso_option_lfa_flags(xorriso,
"default:on:restore_mask=aAcCdDijmPsStTux", 0);
ret= 1;

View File

@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH XORRISO 1 "Version 1.5.7, Jul 21, 2024"
.TH XORRISO 1 "Version 1.5.7, Jul 23, 2024"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -1147,6 +1147,9 @@ Enable all extra features which help to produce or to restore backups with
highest fidelity of file properties. Currently this is a shortcut for:
.br
\-hardlinks on \-acl on \-xattr any \-md5 on
.br
and possibly:
.br
\-lfa_flags default:on:restore_mask=aAcCdDijmPsStTux
.br
If you restore a backup with xattr from non\-user namespaces, then make sure
@ -1160,10 +1163,14 @@ events.
Command \-xattr "user" after command \-for_backup will exclude non\-user
attributes from being recorded or restored.
.br
The \-lfa_flags restore mask of \-for_backup enables all known settable
attributes, except "F" which has special constraints which xorriso cannot yet
detect at restore time. Command \-lfa_flags "restore_mask=" after \-for_backup
will enable all known settable attributes.
The command \-lfa_flags is executed by \-for_backup only if the underlying
libisofs was compiled with support for Linux file attributes,
which is typically not the case on non\-Linux systems.
.br
If \-lfa_flags is executed by \-for_backup then the restore mask enables all
known settable attributes, except "F" which has special constraints which
xorriso cannot yet detect at restore time. Command \-lfa_flags "restore_mask="
after \-for_backup will enable all known settable attributes.
.TP
\fB\-ecma119_map\fR "stripped"|"unmapped"|"lowercase"|"uppercase"
Choose the conversion of file names when a session gets loaded, if they stem

View File

@ -1023,8 +1023,9 @@ activate them only after image loading.
Enable all extra features which help to produce or to restore
backups with highest fidelity of file properties. Currently this
is a shortcut for:
-hardlinks on -acl on -xattr any -md5 on -lfa_flags
default:on:restore_mask=aAcCdDijmPsStTux
-hardlinks on -acl on -xattr any -md5 on
and possibly:
-lfa_flags default:on:restore_mask=aAcCdDijmPsStTux
If you restore a backup with xattr from non-user namespaces, then
make sure that the target operating system and filesystem know what
these attributes mean. Possibly you will need administrator
@ -1034,11 +1035,14 @@ activate them only after image loading.
or preconditions will cause failure events.
Command -xattr "user" after command -for_backup will exclude
non-user attributes from being recorded or restored.
The -lfa_flags restore mask of -for_backup enables all known
settable attributes, except "F" which has special constraints which
xorriso cannot yet detect at restore time. Command -lfa_flags
"restore_mask=" after -for_backup will enable all known settable
attributes.
The command -lfa_flags is executed by -for_backup only if the
underlying libisofs was compiled with support for Linux file
attributes, which is typically not the case on non-Linux systems.
If -lfa_flags is executed by -for_backup then the restore mask
enables all known settable attributes, except "F" which has special
constraints which xorriso cannot yet detect at restore time.
Command -lfa_flags "restore_mask=" after -for_backup will enable
all known settable attributes.
-ecma119_map "stripped"|"unmapped"|"lowercase"|"uppercase"
Choose the conversion of file names when a session gets loaded, if
they stem neither from a Rock Ridge name nor from a Joliet name.
@ -5915,11 +5919,11 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -assess_indev_features shows filesystem features: Inquiry. (line 61)
* -auto_charset learns character set from image: Loading. (line 141)
* -backslash_codes enables backslash conversion: Scripting. (line 71)
* -ban_stdio_write demands real drive: Loading. (line 415)
* -ban_stdio_write demands real drive: Loading. (line 419)
* -biblio_file sets biblio file name: SetWrite. (line 277)
* -blank erases media: Writing. (line 57)
* -boot_image controls bootability: Bootable. (line 75)
* -calm_drive reduces drive activity: Loading. (line 405)
* -calm_drive reduces drive activity: Loading. (line 409)
* -cd sets working directory in ISO: Navigate. (line 7)
* -cdx sets working directory on disk: Navigate. (line 15)
* -changes_pending overrides change status: Writing. (line 12)
@ -5955,12 +5959,12 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -cp_rx copies file trees to disk: Restore. (line 131)
* -cp_rx copies file trees to disk <1>: Restore. (line 139)
* -cut_out inserts piece of data file or device: Insert. (line 139)
* -data_cache_size adjusts read cache size: Loading. (line 431)
* -data_cache_size adjusts read cache size: Loading. (line 435)
* -dev acquires one drive for input and output: AqDrive. (line 12)
* -devices gets list of drives: Inquiry. (line 7)
* -device_links gets list of drives: Inquiry. (line 17)
* -dialog enables dialog mode: DialogCtl. (line 7)
* -disk_dev_ino fast incremental backup: Loading. (line 325)
* -disk_dev_ino fast incremental backup: Loading. (line 329)
* -disk_pattern controls pattern expansion: Insert. (line 34)
* -displacement compensate altered image start address: Loading.
(line 102)
@ -5972,8 +5976,8 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -dusx show directory size on disk: Navigate. (line 96)
* -dux show directory size on disk: Navigate. (line 92)
* -dvd_obs set write block size and end alignment: SetWrite. (line 421)
* -early_stdio_test classifies stdio drives: Loading. (line 419)
* -ecma119_map names w/o Rock Ridge, Joliet: Loading. (line 298)
* -early_stdio_test classifies stdio drives: Loading. (line 423)
* -ecma119_map names w/o Rock Ridge, Joliet: Loading. (line 302)
* -eject ejects drive tray: Writing. (line 50)
* -end writes pending session and ends program: Scripting. (line 151)
* -errfile_log logs problematic disk files: Scripting. (line 116)
@ -5986,7 +5990,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -extract_cut copies file piece to disk: Restore. (line 108)
* -extract_l copies files to disk: Restore. (line 104)
* -extract_single copies file to disk: Restore. (line 101)
* -file_name_limit curbs length of file names: Loading. (line 345)
* -file_name_limit curbs length of file names: Loading. (line 349)
* -file_size_limit limits data file size: SetInsert. (line 7)
* -find traverses and alters ISO tree: CmdFind. (line 7)
* -findx traverses disk tree: Navigate. (line 99)
@ -6008,11 +6012,11 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -indev acquires a drive for input: AqDrive. (line 23)
* -in_charset sets input character set: Loading. (line 136)
* -iso_nowtime fixed "now" time for ISO 9660 objects: Loading.
(line 319)
(line 323)
* -iso_rr_pattern controls pattern expansion: Manip. (line 10)
* -jigdo clears JTE or or adds parameter to JTE: Jigdo. (line 37)
* -joliet enables production of Joliet tree: SetWrite. (line 10)
* -joliet_map Joliet names: Loading. (line 311)
* -joliet_map Joliet names: Loading. (line 315)
* -launch_frontend starts frontend program at pipes: Frontend.
(line 141)
* -lfa_flags controls handling of Linux file attributes: Loading.
@ -6097,7 +6101,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
(line 57)
* -rollback discards pending changes: Writing. (line 9)
* -rollback_end ends program without writing: Scripting. (line 154)
* -rom_toc_scan searches for sessions: Loading. (line 377)
* -rom_toc_scan searches for sessions: Loading. (line 381)
* -rr_reloc_dir sets name of relocation directory: SetWrite. (line 171)
* -scdbackup_tag enables scdbackup checksum tag: Emulation. (line 179)
* -scsi_dev_family choose Linux device file type: AqDrive. (line 95)
@ -6175,7 +6179,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Appended partitions, MBR: Bootable. (line 480)
* Automatic execution order, of arguments, -x: ArgSort. (line 16)
* Backslash Interpretation, _definition: Processing. (line 57)
* Backup, enable fast incremental, -disk_dev_ino: Loading. (line 325)
* Backup, enable fast incremental, -disk_dev_ino: Loading. (line 329)
* Backup, enable features, -for_backup: Loading. (line 278)
* Backup, scdbackup checksum tag, -scdbackup: Emulation. (line 179)
* Blank media, _definition: Media. (line 34)
@ -6215,8 +6219,8 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Directory, delete, -rmdir: Manip. (line 29)
* disk_path, _definition: Insert. (line 6)
* Drive, accessability, -drive_class: AqDrive. (line 43)
* Drive, classify stdio, -early_stdio_test: Loading. (line 419)
* Drive, demand real MMC, -ban_stdio_write: Loading. (line 415)
* Drive, classify stdio, -early_stdio_test: Loading. (line 423)
* Drive, demand real MMC, -ban_stdio_write: Loading. (line 419)
* Drive, eject tray, -eject: Writing. (line 50)
* Drive, for input and output, -dev: AqDrive. (line 12)
* Drive, for input, -indev: AqDrive. (line 23)
@ -6224,7 +6228,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Drive, get drive list, -devices: Inquiry. (line 7)
* Drive, get drive list, -device_links: Inquiry. (line 17)
* Drive, list supported media, -list_profiles: Writing. (line 163)
* Drive, reduce activity, -calm_drive: Loading. (line 405)
* Drive, reduce activity, -calm_drive: Loading. (line 409)
* Drive, report SCSI commands, -scsi_log: Scripting. (line 143)
* Drive, write and eject, -commit_eject: Writing. (line 53)
* Drive, _definition: Drives. (line 6)
@ -6240,9 +6244,9 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Examples: Examples. (line 6)
* extattr, _definition: Extras. (line 66)
* File content, copy, -concat: Restore. (line 148)
* File names, curb length, -file_name_limit: Loading. (line 345)
* File names, if Joliet is loaded: Loading. (line 311)
* File names, if neither Rock Ridge nor Joliet: Loading. (line 298)
* File names, curb length, -file_name_limit: Loading. (line 349)
* File names, if Joliet is loaded: Loading. (line 315)
* File names, if neither Rock Ridge nor Joliet: Loading. (line 302)
* Filesytem features, show, -assess_indev_features: Inquiry. (line 61)
* Filter, apply to file tree, -set_filter_r: Filter. (line 84)
* Filter, apply to file, -set_filter: Filter. (line 58)
@ -6268,7 +6272,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* HFS+ serial number: Bootable. (line 455)
* hidden, set in ISO image, -hide: Manip. (line 204)
* HP-PA boot sector, production: Bootable. (line 430)
* Image reading, cache size, -data_cache_size: Loading. (line 431)
* Image reading, cache size, -data_cache_size: Loading. (line 435)
* Image, demand volume ID, -assert_volid: Loading. (line 129)
* Image, discard pending changes, -rollback: Writing. (line 9)
* Image, filesystem to load, -read_fs: Loading. (line 120)
@ -6320,7 +6324,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Jigdo Template Extraction, -jigdo: Jigdo. (line 37)
* Jigdo Template Extraction, _definition: Jigdo. (line 6)
* LBA, _definition: Drives. (line 17)
* libisofs, fixed "now" time: Loading. (line 319)
* libisofs, fixed "now" time: Loading. (line 323)
* Linux device type, -scsi_dev_family: AqDrive. (line 95)
* Linux file attributes, control handling, -lfa_flags: Loading.
(line 207)
@ -6443,7 +6447,7 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* System area, _definition: Bootable. (line 227)
* Table-of-content, choose info to show, -toc_info_type: Inquiry.
(line 49)
* Table-of-content, search sessions, -rom_toc_scan: Loading. (line 377)
* Table-of-content, search sessions, -rom_toc_scan: Loading. (line 381)
* Table-of-content, show parts of, -toc_of: Inquiry. (line 41)
* Table-of-content, show, -toc: Inquiry. (line 27)
* Timestamps, set in ISO image, -alter_date: Manip. (line 166)
@ -6503,48 +6507,48 @@ Node: Commands26634
Node: ArgSort28311
Node: AqDrive29805
Node: Loading36962
Node: Insert63079
Node: SetInsert75274
Node: Manip85448
Node: CmdFind97112
Node: Filter117915
Node: Writing122537
Node: SetWrite135031
Node: Bootable166306
Node: Jigdo197588
Node: Charset202591
Node: Exception205920
Node: DialogCtl212049
Node: Inquiry214651
Node: Navigate227184
Node: Verify236339
Node: Restore247488
Node: Emulation259695
Node: Scripting270151
Node: Frontend277934
Node: Examples287560
Node: ExDevices288738
Node: ExCreate289399
Node: ExDialog290699
Node: ExGrowing291970
Node: ExModifying292779
Node: ExBootable293289
Node: ExCharset293844
Node: ExPseudo294740
Node: ExCdrecord295667
Node: ExMkisofs295987
Node: ExGrowisofs297884
Node: ExException299037
Node: ExTime299495
Node: ExIncBackup299953
Node: ExRestore303979
Node: ExRecovery304925
Node: Files305497
Node: Environ306831
Node: Seealso307579
Node: Bugreport308343
Node: Legal308934
Node: CommandIdx309946
Node: ConceptIdx328275
Node: Insert63321
Node: SetInsert75516
Node: Manip85690
Node: CmdFind97354
Node: Filter118157
Node: Writing122779
Node: SetWrite135273
Node: Bootable166548
Node: Jigdo197830
Node: Charset202833
Node: Exception206162
Node: DialogCtl212291
Node: Inquiry214893
Node: Navigate227426
Node: Verify236581
Node: Restore247730
Node: Emulation259937
Node: Scripting270393
Node: Frontend278176
Node: Examples287802
Node: ExDevices288980
Node: ExCreate289641
Node: ExDialog290941
Node: ExGrowing292212
Node: ExModifying293021
Node: ExBootable293531
Node: ExCharset294086
Node: ExPseudo294982
Node: ExCdrecord295909
Node: ExMkisofs296229
Node: ExGrowisofs298126
Node: ExException299279
Node: ExTime299737
Node: ExIncBackup300195
Node: ExRestore304221
Node: ExRecovery305167
Node: Files305739
Node: Environ307073
Node: Seealso307821
Node: Bugreport308585
Node: Legal309176
Node: CommandIdx310188
Node: ConceptIdx328517

End Tag Table

View File

@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISO 1 "Version 1.5.7, Jul 21, 2024"
@c man .TH XORRISO 1 "Version 1.5.7, Jul 23, 2024"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -1403,6 +1403,9 @@ Enable all extra features which help to produce or to restore backups with
highest fidelity of file properties. Currently this is a shortcut for:
@*
-hardlinks on -acl on -xattr any -md5 on
@*
and possibly:
@*
-lfa_flags default:on:restore_mask=aAcCdDijmPsStTux
@*
If you restore a backup with xattr from non-user namespaces, then make sure
@ -1416,10 +1419,14 @@ events.
Command -xattr "user" after command -for_backup will exclude non-user
attributes from being recorded or restored.
@*
The -lfa_flags restore mask of -for_backup enables all known settable
attributes, except "F" which has special constraints which xorriso cannot yet
detect at restore time. Command -lfa_flags "restore_mask=" after -for_backup
will enable all known settable attributes.
The command -lfa_flags is executed by -for_backup only if the underlying
libisofs was compiled with support for Linux file attributes,
which is typically not the case on non-Linux systems.
@*
If -lfa_flags is executed by -for_backup then the restore mask enables all
known settable attributes, except "F" which has special constraints which
xorriso cannot yet detect at restore time. Command -lfa_flags "restore_mask="
after -for_backup will enable all known settable attributes.
@c man .TP
@item -ecma119_map "stripped"|"unmapped"|"lowercase"|"uppercase"
@kindex -ecma119_map names w/o Rock Ridge, Joliet

View File

@ -187,6 +187,10 @@ struct XorrisO { /* the global context of xorriso */
int lfa_flags_setting; /* Current settings of command -lfa_flags
bit0= on
bit1= auto_su
bit2= auto_on (i.e. only if libisofs has been
compiled with lfa enabled)
bit3= libisofs indeed has lfa enabled
(to be set only at program start)
bit11-14= at the end of the command these bits
get put into .do_aaip if bit0 is on.
Else the lfa bits of do_aaip will be set

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.07.22.214318"
#define Xorriso_timestamP "2024.07.23.152959"

View File

@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISOFS 1 "Version 1.5.7, Jul 21, 2024"
@c man .TH XORRISOFS 1 "Version 1.5.7, Jul 23, 2024"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -68,7 +68,7 @@
@copying
xorrisofs - Emulation of ISO 9660 program mkisofs by program xorriso
Copyright @copyright{} 2011 - 2023 Thomas Schmitt
Copyright @copyright{} 2011 - 2024 Thomas Schmitt
@quotation
Permission is granted to distribute this text freely.
@ -943,7 +943,7 @@ Alias of -rr_reloc_dir "/.rr_moved"
Enable all options which improve backup fidelity:
@*
@minus{}@minus{}acl, @minus{}@minus{}xattr-any, @minus{}@minus{}md5,
@minus{}@minus{}hardlinks, @minus{}@minus{}lfa_flags.
@minus{}@minus{}hardlinks, and possibly @minus{}@minus{}lfa_flags.
@*
If you later restore a backup with xattr from non-user namespaces, then make
sure that the target operating system and filesystem know what these attributes
@ -953,6 +953,10 @@ privileges and just record what is readable.
@*
Option @minus{}@minus{}xattr after option @minus{}@minus{}for_backup excludes
non-user attributes from being recorded.
@*
Option @minus{}@minus{}for_backup enables @minus{}@minus{}lfa_flags only if
the underlying libisofs was compiled with support for Linux file attributes,
which is typically not the case on non-Linux systems.
@c man .TP
@item @minus{}@minus{}acl
@kindex @minus{}@minus{}acl Recording of ACLs