New commands -lfa_flags, -lsattr, -lsattrd, -chattr, -chattr_r, -find test -has_lfa_flags, -find actions lsattrd, chattr

This commit is contained in:
Thomas Schmitt 2024-07-20 23:12:16 +02:00
parent dfd0a8cc81
commit 0802689b11
26 changed files with 1222 additions and 165 deletions

View File

@ -376,5 +376,7 @@ isoburn_read_iso_head_v2;
isoburn_toc_disc_get_sectors_v2;
isoburn_toc_session_get_sectors_v2;
isoburn_toc_track_get_emul_v2;
Xorriso_option_chattri;
Xorriso_option_lfa_flags;
} LIBISOBURN1;

View File

@ -146,7 +146,17 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->do_iso1999= 0;
m->ecma119_map= 1;
m->joliet_map= 1;
/* off:read:restore:restore_su_auto:restore_only_known */
m->lfa_flags_default= 2 | (11 << 11);
if(geteuid() != 0) {
/* do not restore known superuser lfa_flags */
m->lfa_flags_default|= (1 << 13);
}
m->lfa_flags_setting= m->lfa_flags_default;
m->lfa_restore_mask= ~((uint64_t) 0);
m->do_aaip= 0;
if(m->lfa_flags_setting & 1)
m->do_aaip|= m->lfa_flags_setting & (15 << 11);
m->do_md5= 64;
m->no_emul_toc= 0;
m->do_old_empty= 0;

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2019 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -294,6 +294,7 @@ ex:;
bit23= timestamps younger than xorriso->isofs_st_in
bit24= hardlink split
bit25= hardlink fusion
bit26= Linux file attribute mismatch
@param flag bit0= compare atime
bit1= compare ctime
bit2= check only existence of both file objects
@ -312,15 +313,16 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
{
struct stat s1, s2, stbuf;
int ret, missing= 0, is_split= 0, i, was_error= 0, diff_count= 0;
int content_shortcut= 0, mask;
int content_shortcut= 0, mask, max_bit;
char *respt;
char *a= NULL;
char ttx1[40], ttx2[40];
char ttx1[40], ttx2[40], *lfa_text= NULL;
char *a1_acl= NULL, *a2_acl= NULL, *d1_acl= NULL, *d2_acl= NULL;
char *attrlist1= NULL, *attrlist2= NULL;
struct SplitparT *split_parts= NULL;
int split_count= 0;
time_t stamp;
uint64_t lfa_flags1, lfa_flags2;
char *part_path= NULL, *part_name;
int partno, total_parts= 0;
@ -484,6 +486,39 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
}
}
/* lfa_flags */
if(xorriso->do_aaip & (3 << 11)) {
ret= Xorriso_get_lfa_flags(xorriso, NULL, disk_adr, &lfa_flags1, &max_bit,
2 | ((flag & (1 << 28)) >> 23));
if(ret < 0)
goto ex;
ret= Xorriso_get_lfa_flags(xorriso, NULL, iso_adr, &lfa_flags2, &max_bit,
0);
if(ret < 0)
goto ex;
if(lfa_flags1 != lfa_flags2) {
(*result)|= (1 << 26);
Xorriso_encode_lfa_flags(xorriso, lfa_flags1, &lfa_text, 1);
if(lfa_text != NULL) {
sprintf(respt, "%s lsattr : %s <> ", a, lfa_text);
free(lfa_text);
}
Xorriso_encode_lfa_flags(xorriso, lfa_flags2, &lfa_text, 1);
if(lfa_text != NULL) {
sprintf(respt + strlen(respt), "%s", lfa_text);
free(lfa_text);
}
Xorriso_encode_lfa_flags(xorriso, lfa_flags1 ^ lfa_flags2, &lfa_text, 0);
if(lfa_text != NULL) {
sprintf(respt + strlen(respt), " diff= %s", lfa_text);
free(lfa_text);
}
strcat(respt, "\n");
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
}
}
if(s1.st_uid != s2.st_uid) {
sprintf(respt, "%s st_uid : %lu <> %lu\n", a,
(unsigned long) s1.st_uid, (unsigned long) s2.st_uid);

View File

@ -1160,6 +1160,7 @@ int Xorriso_findx_action(struct XorrisO *xorriso, struct FindjoB *job,
gid_t group= 0;
time_t date= 0;
mode_t mode_or= 0, mode_and= ~1;
uint64_t chattr_flags;
char *target, *text_2, *wdi_mem= NULL, *disk_prefix, *iso_path= NULL;
char *basename;
struct FindjoB *subjob;
@ -1168,7 +1169,8 @@ int Xorriso_findx_action(struct XorrisO *xorriso, struct FindjoB *job,
Xorriso_alloc_meM(iso_path, char, SfileadrL);
action= Findjob_get_action_parms(job, &target, &text_2, &user, &group,
&mode_and, &mode_or, &type, &date, &subjob, 0);
&mode_and, &mode_or, &type, &date, &subjob,
&chattr_flags, 0);
if(action<0)
action= 0;
if(action==15 || action==16 || action==18 || action==19 || action==20) {

View File

@ -267,13 +267,16 @@ int Xorriso_make_read_options(struct XorrisO *xorriso,
ext|= isoburn_ropt_norock;
if(xorriso->read_fs & 2)
ext|= isoburn_ropt_nojoliet;
if((xorriso->ino_behavior & (1 | 2)) && !(xorriso->do_aaip & (1 | 4 | 32))
if((xorriso->ino_behavior & (1 | 2)) &&
!(xorriso->do_aaip & (1 | 4 | 32 | (1 << 11)))
&& !(xorriso->do_md5 & 1) && !(xorriso->do_hfsplus))
ext|= isoburn_ropt_noaaip;
if(!(xorriso->do_aaip & 1))
ext|= isoburn_ropt_noacl;
if(!(xorriso->do_aaip & 4))
ext|= isoburn_ropt_noea;
if(xorriso->do_aaip & (1 << 11))
ext|= isoburn_ropt_lfa_flags;
if(xorriso->ino_behavior & 1)
ext|= isoburn_ropt_noino;
if(!(xorriso->do_md5 & 1))
@ -464,6 +467,8 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
} else if(xorriso->do_aaip & 1024) {
aquire_flag|= 1024;
}
if(xorriso->do_aaip & (1 << 11))
aquire_flag|= 1 << 11;
if(flag & 128)
aquire_flag|= 256;
burn_preset_device_open(xorriso->drives_exclusive |

View File

@ -1092,6 +1092,24 @@ int Findjob_set_commit_filter_2(struct FindjoB *o, int flag)
}
int Findjob_set_uint64_filter(struct FindjoB *o, int test_type, uint64_t value,
int flag)
{
struct ExprtesT *t;
int ret;
ret= Findjob_default_and(o, 0);
if(ret <= 0)
return(ret);
t= o->cursor->test;
t->test_type= test_type;
t->arg1= calloc(sizeof(uint64_t), 1);
*((uint64_t *) t->arg1)= value;
return(1);
}
int Findjob_set_arg1(struct FindjoB *o, int test_type, char *arg1, int flag)
{
struct ExprtesT *t;
@ -1174,7 +1192,7 @@ int Findjob_get_action_parms(struct FindjoB *o, char **target, char **text_2,
uid_t *user, gid_t *group,
mode_t *mode_and, mode_t *mode_or,
int *type, time_t *date, struct FindjoB **subjob,
int flag)
uint64_t *lfa_flags, int flag)
{
*target= o->target;
*text_2= o->text_2;
@ -1185,6 +1203,7 @@ int Findjob_get_action_parms(struct FindjoB *o, char **target, char **text_2,
*type= o->type;
*date= o->date;
*subjob= o->subjob;
*lfa_flags= o->lfa_flags;
return(o->action);
}
@ -1341,3 +1360,13 @@ int Findjob_set_action_found_path(struct FindjoB *o, int flag)
return(1);
}
int Findjob_set_action_chattr(struct FindjoB *o, int action,
uint64_t lfa_flags, int operator, int flag)
{
o->action= action;
o->lfa_flags= lfa_flags;
o->type= operator;
return(1);
}

View File

@ -57,6 +57,7 @@ struct ExprtesT {
26= -mindepth int *arg1
27= -size off_t *arg1 int *arg2 (0=test for equal, -1=smaller, 1=larger,
-2=smaller_or_equal , 2=larger_or_equal)
28= -has_lfa_flags uint64_t *arg1 (Linux file attribute flag bits)
*/
int test_type;
@ -187,6 +188,8 @@ struct FindjoB {
57= like 55 but tolerating existing truncated names
58= internal: last_data_file_block
59= set_to_mtime
60= lsattrd
61= chattr mode
*/
int action;
int prune;
@ -206,6 +209,7 @@ struct FindjoB {
off_t estim_lower_size;
struct FindjoB *subjob;
uint32_t last_data_file_block;
uint64_t lfa_flags;
/* Errors */
char errmsg[4096];
@ -273,6 +277,9 @@ int Findjob_set_bless_filter(struct XorrisO *xorriso, struct FindjoB *o,
int Findjob_set_arg1(struct FindjoB *o, int test_type, char *arg1, int flag);
int Findjob_set_uint64_filter(struct FindjoB *o, int test_type, uint64_t value,
int flag);
int Findjob_open_bracket(struct FindjoB *job, int flag);
int Findjob_close_bracket(struct FindjoB *job, int flag);
@ -299,6 +306,9 @@ int Findjob_test_2(struct XorrisO *xorriso, struct FindjoB *o,
int Findjob_set_action_found_path(struct FindjoB *o, int flag);
int Findjob_set_action_chattr(struct FindjoB *o, int action,
uint64_t lfa_flags, int operator, int flag);
/* @param flag bit0= recursive
*/
int Findjob_set_action_target(struct FindjoB *o, int action, char *target,
@ -375,7 +385,7 @@ int Findjob_get_action_parms(struct FindjoB *o, char **target, char **text_2,
uid_t *user, gid_t *group,
mode_t *mode_and, mode_t *mode_or,
int *type, time_t *date, struct FindjoB **subjob,
int flag);
uint64_t *lfa_flags, int flag);
int Findjob_set_found_path(struct FindjoB *o, char *path, int flag);

View File

@ -49,6 +49,8 @@ int Xorriso_set_ignore_aclea(struct XorrisO *xorriso, int flag)
hflag|= 2;
if(xorriso->do_aaip & 1024)
hflag|= 8;
if(xorriso->do_aaip & 2048)
hflag|= 4;
iso_image_set_ignore_aclea(volume, hflag);
return(1);
}
@ -1148,7 +1150,7 @@ int Xorriso_mount(struct XorrisO *xorriso, char *dev, int adr_mode,
burn_preset_device_open(
(xorriso->drives_exclusive && !(xorriso->mount_opts_flag & 1)) |
(xorriso->linux_scsi_dev_family << 2), 0, 0);
aquire_flag= 1;
aquire_flag= 1 | 32 | 64;
if((xorriso->toc_emulation_flag & 2) && (adr_mode == 3 || adr_mode == 0))
aquire_flag|= 16; /* -rom_toc_scan emul_off with sbsector or auto */
if(xorriso->toc_emulation_flag & 4)
@ -3436,3 +3438,40 @@ ex:;
return(ret);
}
int Xorriso_decode_lfa_flags(struct XorrisO *xorriso, char *flags_text,
uint64_t *lfa_flags, int flag)
{
int ret;
ret= iso_util_decode_lfa_flags(flags_text, lfa_flags, 0);
if(ret < 0) {
Xorriso_report_iso_error(xorriso, "", ret,
"Error when converting chattr attribute letters",
0, "WARNING", 1);
return(0);
}
return(1);
}
/* @param flags_text will return the resulting text in allocated memory.
@param flag bit0= produce lsattr(1) format with '-' and peculiar
sequence
*/
int Xorriso_encode_lfa_flags(struct XorrisO *xorriso, uint64_t lfa_flags,
char **flags_text, int flag)
{
int ret;
ret= iso_util_encode_lfa_flags(lfa_flags, flags_text, flag & 1);
if(ret < 0) {
Xorriso_report_iso_error(xorriso, "", ret,
"Error when converting chattr attribute bits",
0, "WARNING", 1);
return(0);
}
return(1);
}

View File

@ -40,7 +40,7 @@
/* @param flag bit0= give directory x-permission where is r-permission
bit1= do not transfer ACL or xattr
bit1= do not transfer ACL, xattr, file attribute flags
bit2= record dev,inode (only if enabled by xorriso)
bit3= with bit0: pretend to have indeed a directory
bit5= transfer ACL or xattr from eventual link target
@ -49,7 +49,8 @@ int Xorriso_transfer_properties(struct XorrisO *xorriso, struct stat *stbuf,
char *disk_path, IsoNode *node, int flag)
{
mode_t mode;
int ret= 1;
int ret= 1, max_bit, os_errno;
uint64_t lfa_flags;
size_t num_attrs= 0, *value_lengths= NULL;
char **names= NULL, **values= NULL;
@ -74,7 +75,7 @@ int Xorriso_transfer_properties(struct XorrisO *xorriso, struct stat *stbuf,
iso_node_set_mtime(node, stbuf->st_mtime);
iso_node_set_ctime(node, stbuf->st_ctime);
if((xorriso->do_aaip & 5) && !(flag & 2)) {
if((xorriso->do_aaip & (1 | 4 | 2048)) && !(flag & 2)) {
ret= iso_local_get_attrs(disk_path, &num_attrs, &names, &value_lengths,
&values, ((xorriso->do_aaip & 1) && !(flag & 2))
| ((!(xorriso->do_aaip & 4)) << 2)
@ -97,6 +98,26 @@ int Xorriso_transfer_properties(struct XorrisO *xorriso, struct stat *stbuf,
0, "FAILURE", 1);
ret= 0; goto ex;
}
if(xorriso->do_aaip & 2048) {
ret= iso_local_get_lfa_flags(disk_path, &lfa_flags, &max_bit, &os_errno,
(flag & 32));
if(ret < 0) {
Xorriso_process_msg_queues(xorriso, 0);
Xorriso_report_iso_error(xorriso, disk_path, ret,
"Error when obtaining file attribute flags",
os_errno, "FAILURE", 1 | 2);
ret= 0; goto ex;
} else if(ret > 0) {
ret= iso_node_set_lfa_flags(node, lfa_flags, 0);
if(ret < 0) {
Xorriso_process_msg_queues(xorriso, 0);
Xorriso_report_iso_error(xorriso, "", ret,
"Error when setting file attribute flags to image node",
0, "FAILURE", 1);
ret= 0; goto ex;
}
}
}
}
if((flag & 4) && ((xorriso->do_aaip & 16) || !(xorriso->ino_behavior & 2))) {
@ -2679,9 +2700,13 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
struct iso_hfsplus_xinfo_data *hfsplus_xinfo;
size_t value_length;
char *value;
uint64_t lfa_flags, chattr_flags;
int max_bit;
char *lfa_text= NULL;
action= Findjob_get_action_parms(job, &target, &text_2, &user, &group,
&mode_and, &mode_or, &type, &date, &subjob, 0);
&mode_and, &mode_or, &type, &date, &subjob,
&chattr_flags, 0);
if(action<0)
action= 0;
job->match_count++;
@ -2986,6 +3011,29 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
} else if(action == 59) { /* set_to_mtime */
ret= Xorriso_set_to_mtime(xorriso, show_path, node, 0);
} else if(action == 60) { /* lsattrd */
ret= Xorriso_get_lfa_flags(xorriso, node, show_path, &lfa_flags, &max_bit,
0);
if(ret >= 0) {
lfa_text= NULL;
ret= Xorriso_encode_lfa_flags(xorriso, lfa_flags, &lfa_text, 1);
if(ret > 0) {
sprintf(xorriso->result_line, "%-22s ", lfa_text);
Xorriso_esc_filepath(xorriso, show_path, xorriso->result_line, 1);
strcat(xorriso->result_line, "\n");
Xorriso_result(xorriso, 0);
}
if(lfa_text != NULL)
free(lfa_text);
ret= 1;
} else if(ret == 0) {
ret= 1;
}
} else if(action == 61) { /* chattr */
ret= Xorriso_set_lfa_flags(xorriso, node, show_path, "",
chattr_flags, type, 1);
} else { /* includes : 15 in_iso */
Xorriso_esc_filepath(xorriso, show_path, xorriso->result_line, 0);
strcat(xorriso->result_line, "\n");
@ -3055,9 +3103,10 @@ return:
3 = immediate decision : does match
*/
{
int value=0, ret, bless_idx, size_mode, lba_count, i, mask;
int value=0, ret, bless_idx, size_mode, lba_count, i, mask, max_bit;
off_t range_lba, end_lba, *file_end_lbas= NULL, *file_start_lbas= NULL;
off_t start_lba;
uint64_t lfa_flags, node_flags;
void *arg1, *arg2;
char ft, *decision, md5[16], bless_code[17];
regmatch_t name_match;
@ -3340,6 +3389,17 @@ return:
value= 0;
}
break; case 28: /* -has_lfa_flags uint64_t lfa_flags */
lfa_flags= *((uint64_t *) ftest->arg1);
ret= Xorriso_get_lfa_flags(xorriso, node, path, &node_flags, &max_bit, 0);
if(ret <= 0) {
if(ret < 0)
Xorriso_process_msg_queues(xorriso, 0);
value= 0;
goto ex;
}
value= ((node_flags & lfa_flags) == lfa_flags);
break; default:
/* >>> complain about unknown test type */;
@ -4614,3 +4674,85 @@ ex:;
return(ret);
}
int Xorriso_decode_chattr_arg(struct XorrisO *xorriso, char *chattr_text,
uint64_t *lfa_flags, int *operator, int flag)
{
int ret;
if(chattr_text[0] == '=') {
*operator= 0;
} else if(chattr_text[0] == '+') {
*operator= 1;
} else if(chattr_text[0] == '-') {
*operator= 2;
} else if(chattr_text[0] == '.') {
*operator= 3;
} else {
Xorriso_msgs_submit(xorriso, 0,
"-chattr argument does not begin by '=', '+', '-', or '.'",
0, "SORRY", 0);
return(0);
}
ret= Xorriso_decode_lfa_flags(xorriso, chattr_text + 1, lfa_flags, 0);
if(ret <= 0)
return(ret);
return(1);
}
/* @param in_node if not NULL: the node to manipulate
@path if in_node is NULL: path to node
in any case: path to report with errors
@param operator chattr operation mode 0='=', 1='+', 2='-' , 3='.'
@param flag bit0= use lfa_flags and operator rather than chattr_text
*/
int Xorriso_set_lfa_flags(struct XorrisO *xorriso, void *in_node, char *path,
char *chattr_text, uint64_t lfa_flags, int operator,
int flag)
{
int ret, max_bit;
uint64_t set_flags;
IsoNode *node;
if(in_node != NULL) {
node= (IsoNode *) in_node;
} else {
ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0);
if(ret <= 0)
return(ret);
}
if(!(flag & 1)) {
ret= Xorriso_decode_chattr_arg(xorriso, chattr_text, &lfa_flags, &operator,
0);
if(ret <= 0)
return(ret);
}
if(operator == 0) {
set_flags= lfa_flags;
} else {
ret= Xorriso_get_lfa_flags(xorriso, node, path, &set_flags, &max_bit, 0);
if(ret < 0)
return(ret);
if(operator == 1) {
set_flags|= lfa_flags;
} else if(operator == 2) {
set_flags&= ~lfa_flags;
} else if(operator == 3) {
set_flags&= lfa_flags;
}
}
ret= iso_node_set_lfa_flags(node, set_flags, 0);
if(ret < 0) {
Xorriso_process_msg_queues(xorriso, 0);
Xorriso_report_iso_error(xorriso, path, ret,
"Error when setting chattr flags of ISO node",
0, "SORRY", 1);
return(-1);
}
Xorriso_set_change_pending(xorriso, 0);
return(1);
}

View File

@ -1733,16 +1733,19 @@ int Xorriso_truncate_path_comps(struct XorrisO *xorriso, char *path,
bit1= do not print count of nodes
bit2= du format
bit3= print directories as themselves (ls -d)
bit4= lsattr format
bit5= do not look for truncated versions of path component
*/
int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd,
int filec, char **filev, off_t boss_mem, int flag)
{
int i, ret, was_error= 0, dfilec= 0, pass, passes, hidden_state= 0;
int is_ls= 0, is_lsl= 0, max_bit;
uint64_t lfa_flags;
IsoNode *node;
IsoImage *volume;
char *path= NULL, *link_target= NULL, *rpt, **dfilev= NULL;
char *a_text= NULL, *d_text= NULL, *namept;
char *a_text= NULL, *d_text= NULL, *namept, *lfa_text= NULL;
off_t size;
struct stat stbuf;
@ -1775,7 +1778,10 @@ int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd,
}
}
if((flag&8) && !(flag&(2|4))) {
is_ls= !(flag & (4 | 16));
is_lsl= is_ls && (flag & 1);
if((flag&8) && !(flag & (2 | 4 | 16))) {
sprintf(xorriso->info_text, "Valid ISO nodes found: %d\n", filec-was_error);
Xorriso_info(xorriso,1);
if(filec-was_error<=0)
@ -1814,7 +1820,7 @@ int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd,
Xorriso_result(xorriso,0);
}
Xorriso_ls_filev(xorriso, path,
dfilec, dfilev, boss_mem, (flag & 1) | 2 | 8);
dfilec, dfilev, boss_mem, (flag & (1 | 16)) | 2 | 8);
}
if(dfilec>0)
Sfile_destroy_argv(&dfilec, &dfilev, 0);
@ -1823,7 +1829,7 @@ int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd,
if(pass>0)
continue;
link_target[0]= 0;
if((flag&5)==1) { /* -ls_l */
if(is_lsl) { /* -ls_l */
iso_node_get_acl_text(node, &a_text, &d_text, 16);
hidden_state= Xorriso_node_eff_hidden(xorriso, node, 0);
ret= Xorriso_format_ls_l(xorriso, &stbuf,
@ -1851,9 +1857,35 @@ int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd,
sprintf(rpt, "%-7.f ",(double) (size/1024));
else
sprintf(rpt, "%7.f ",(double) (size/1024));
} else if(flag & 16) { /* -lsattr */
ret= iso_node_get_lfa_flags(node, &lfa_flags, &max_bit, 0);
if(ret < 0) {
Xorriso_report_iso_error(xorriso, path, ret,
"Error when obtaining lsattr flags of ISO node",
0, "WARNING", 1 | 2);
{ret= -1; goto ex;}
} else if(ret >= 0) {
if(ret == 0)
lfa_flags= 0;
ret= iso_util_encode_lfa_flags(lfa_flags, &lfa_text, 1);
if(ret == (int) ISO_LFA_UNKNOWN_BIT) {
sprintf(xorriso->info_text,
"Cannot convert all flag bits for -lsattr : 0x%lX",
(unsigned long) lfa_flags);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
} else if(ret < 0) {
Xorriso_report_iso_error(xorriso, path, ret,
"Error when converting lsattr flags to text",
0, "WARNING", 1 | 2);
{ret= -1; goto ex;}
}
sprintf(rpt, "%-22s ", lfa_text);
if(lfa_text != NULL)
free(lfa_text);
}
}
Xorriso_truncate_path_comps(xorriso, filev[i], path, &namept, 0);
if(link_target[0] && (flag&5)==1) {
if(link_target[0] && is_lsl) {
Xorriso_esc_filepath(xorriso, namept, xorriso->result_line, 1);
strcat(xorriso->result_line, " -> ");
Xorriso_esc_filepath(xorriso, link_target, xorriso->result_line, 1 | 2);
@ -2882,3 +2914,51 @@ int Xorriso_warn_if_not_bootcat(struct XorrisO *xorriso, char *prefix,
return(0);
}
/*
@param in_node if not NULL and not flag bit1: omit path resolution
@param flag bit1= path is disk_path
bit5= in case of symbolic link on disk: inquire link target
@return <0 = ok , 0= no lfa_flags at node , <0 = libisofs error
*/
int Xorriso_get_lfa_flags(struct XorrisO *xorriso, void *in_node, char *path,
uint64_t *lfa_flags, int *max_bit, int flag)
{
int ret, os_errno;
IsoNode *node;
*lfa_flags= 0;
if(flag & 2)
goto from_disk;
node= (IsoNode *) in_node;
if(node == NULL) {
ret= Xorriso_get_node_by_path(xorriso, path, NULL, &node, 0);
if(ret <= 0)
return(ret);
}
ret= iso_node_get_lfa_flags(node, lfa_flags, max_bit, 0);
if(ret < 0) {
Xorriso_process_msg_queues(xorriso, 0);
Xorriso_report_iso_error(xorriso, path, ret,
"Error when obtaining lsattr flags of ISO node",
0, "WARNING", 1);
return(-1);
}
if(ret == 0)
return(0);
return(1);
from_disk:;
ret= iso_local_get_lfa_flags(path, lfa_flags, max_bit, &os_errno, flag & 32);
if(ret < 0) {
Xorriso_process_msg_queues(xorriso, 0);
Xorriso_report_iso_error(xorriso, path, ret,
"Error when obtaining lsattr flags of disk file",
os_errno, "WARNING", 1);
return(-1);
}
return(1);
}

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -915,6 +915,8 @@ int Xorriso_list_extras(struct XorrisO *xorriso, char *mode, int flag)
Xorriso_result(xorriso, 0);
sprintf(xorriso->result_line, "Local xattr : -xattr\n");
Xorriso_result(xorriso, 0);
sprintf(xorriso->result_line, "Local chattr : -lfa_flags\n");
Xorriso_result(xorriso, 0);
sprintf(xorriso->result_line, "Jigdo files : -jigdo\n");
Xorriso_result(xorriso, 0);
sprintf(xorriso->result_line, "zisofs : -zisofs\n");
@ -931,11 +933,13 @@ int Xorriso_list_extras(struct XorrisO *xorriso, char *mode, int flag)
"List of xorriso extra features. yes = enabled , no = disabled\n");
Xorriso_list_extras_result(xorriso, mode, "list_extras", 0);
ret= iso_local_attr_support(3);
ret= iso_local_attr_support(7);
sprintf(xorriso->result_line, "Local ACL : %s\n", ret & 1 ? "yes" : "no");
Xorriso_list_extras_result(xorriso, mode, "acl", 0);
sprintf(xorriso->result_line, "Local xattr : %s\n", ret & 2 ? "yes" : "no");
Xorriso_list_extras_result(xorriso, mode, "xattr", 0);
sprintf(xorriso->result_line, "Local chattr : %s\n", ret & 4 ? "yes" : "no");
Xorriso_list_extras_result(xorriso, mode, "lfa_flags", 0);
sprintf(xorriso->result_line, "Jigdo files : %s\n",
#ifdef Xorriso_with_libjtE

View File

@ -1808,6 +1808,63 @@ int Xorriso_option_charset(struct XorrisO *xorriso, char *name, int flag)
}
/* Commands -chattr alias -chattri and -chattr_r alias chattr_ri */
/* @param flag bit0=recursive -chattr_r
*/
int Xorriso_option_chattri(struct XorrisO *xorriso, char *chattr_text,
int argc, char **argv, int *idx, int flag)
{
int i, ret, was_failure= 0, end_idx, fret, operator;
int optc= 0;
uint64_t lfa_flags;
char **optv= NULL;
struct FindjoB *job= NULL;
struct stat dir_stbuf;
ret= Xorriso_opt_args(xorriso, "-chattr", argc, argv, *idx, &end_idx, &optc,
&optv, 0);
if(ret <= 0)
goto ex;
ret= Xorriso_decode_chattr_arg(xorriso, chattr_text, &lfa_flags, &operator,
0);
if(ret <= 0)
goto ex;
for(i= 0; i<optc; i++) {
if(flag&1) {
ret= Findjob_new(&job, optv[i], 0);
if(ret<=0) {
Xorriso_no_findjob(xorriso, "-chattr_r", 0);
{ret= -1; goto ex;}
}
Findjob_set_action_chattr(job, 61, lfa_flags, operator, 0);
ret= Xorriso_findi(xorriso, job, NULL, (off_t) 0,
NULL, optv[i], &dir_stbuf, 0, 0);
Findjob_destroy(&job, 0);
} else {
ret= Xorriso_set_lfa_flags(xorriso, NULL, optv[i], "",
lfa_flags, operator, 1);
}
if(ret>0 && !xorriso->request_to_abort)
continue; /* regular bottom of loop */
was_failure= 1;
fret= Xorriso_eval_problem_status(xorriso, ret, 1|2);
if(fret>=0)
continue;
ret= 0; goto ex;
}
ret= 1;
ex:;
(*idx)= end_idx;
Xorriso_opt_args(xorriso, "-chattr", argc, argv, *idx, &end_idx,
&optc, &optv, 256);
Findjob_destroy(&job, 0);
if(ret<=0)
return(ret);
return(!was_failure);
}
/* Options -check_md5 and -check_md5_r
@param flag bit0= issue summary message
bit1= do not reset pacifier, no final pacifier message

View File

@ -835,8 +835,9 @@ static int Xorriso_truncate_const_find_name(struct XorrisO *xorriso,
int Xorriso_option_find(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag)
{
int ret, i, end_idx, type= 0, action, deleter= 0, count;
int ret, i, end_idx, type= 0, action, deleter= 0, count, operator;
off_t start_lba, block_count;
uint64_t lfa_flags;
int list_extattr_head= 0, bsl_mem, disk_path, name_space, prefix_code;
struct FindjoB *job, *first_job= NULL, *new_job;
char *start_path, *path= NULL, *cpt, *other_path_start= NULL, *cd_pt;
@ -946,6 +947,14 @@ off_t_overflow:;
Findjob_set_aaip_filter(job, 1, 0);
} else if(strcmp(argv[i], "-has_no_aaip")==0) {
Findjob_set_aaip_filter(job, -1, 0);
} else if(strcmp(argv[i], "-has_lfa_flags")==0) {
if(i + 1 >= end_idx)
goto not_enough_arguments;
i++;
ret= Xorriso_decode_lfa_flags(xorriso, argv[i], &lfa_flags, 0);
if(ret <= 0)
goto sorry_ex;
Findjob_set_uint64_filter(job, 28, lfa_flags, 0);
} else if(strcmp(argv[i], "-has_filter")==0) {
Findjob_set_filter_filter(job, 1, 0);
} else if(strcmp(argv[i], "-has_no_filter")==0) {
@ -1471,6 +1480,17 @@ not_enough_exec_arguments:;
Findjob_set_action_target(job, 51, NULL, 0);
} else if(strcmp(cpt, "show_stream_id") == 0) {
Findjob_set_action_target(job, 52, NULL, 0);
} else if(strcmp(cpt, "lsattrd") == 0) {
Findjob_set_action_target(job, 60, NULL, 0);
} else if(strcmp(cpt, "chattr") == 0) {
if(i + 1 >= end_idx)
goto not_enough_exec_arguments;
i++;
ret= Xorriso_decode_chattr_arg(xorriso, argv[i], &lfa_flags, &operator,
0);
if(ret <= 0)
goto sorry_ex;
Findjob_set_action_chattr(job, 61, lfa_flags, operator, 0);
} else {
sprintf(xorriso->info_text, "-find -exec: unknown action ");
Text_shellsafe(argv[i], xorriso->info_text, 1);
@ -1919,10 +1939,14 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" Enable or disable reading and writing of ACLs.",
" -xattr \"on\"|\"user\"|\"any\"|\"off\"",
" Enable or disable reading and writing of xattr.",
" -lfa_flags mode[:mode ...]",
" Enable or disable reading and restoring of Linux chattr",
" flags.",
" -md5 \"on\"|\"all\"|\"off\"",
" 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",
" -ecma119_map \"unmapped\"|\"stripped\"|\"uppercase\"|\"lowercase\"",
" Choose conversion of file names if neither Rock Ridge",
" nor Joliet is present in the loaded ISO session.",
@ -2192,6 +2216,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -setfattr_list disk_path",
" Read output of getfattr from file disk_path. Replace the",
" xattr of the iso_rr_path given by line \"# file:\".",
" -chattr \"+\"|\"-\"|\"=\"|\".\"mode iso_rr_path [***]",
" Set or unset Linux chattr flags of the given files.",
" -alter_date type timestring iso_rr_path [***]",
" Alter the date entries of a file in the ISO image. type is",
" one of \"a\", \"m\", \"b\" for:",
@ -2221,7 +2247,9 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" list_extattr, get_md5, check_md5, make_md5,",
" set_hfs_crtp, get_hfs_crtp, set_hfs_bless, get_hfs_bless,",
" set_filter, show_stream, show_stream_id, mkisofs_r,",
" hide, print_outname, estimate_size, find",
" hide, print_outname, estimate_size, in_iso, not_in_iso",
" add_missing, empty_iso_dir, is_full_in_iso, sort_weight",
" update_merge, rm_merge, clear_merge, lsattrd, chattr, find",
" params are their parameters except iso_rr_path.",
" -mkdir iso_rr_path [...]",
" Create empty directories if they do not exist yet.",
@ -2375,6 +2403,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -lsdx pattern [***] like -lsx but listing directories as single items.",
" -lslx pattern [***] like -lsx but also telling some file attributes.",
" -lsdlx pattern [***] like -lsdx but also telling some file attributes.",
" -lsattr pattern [***] lists Linux chattr flags of the given files.",
" -lsattrd pattern [***] like -lsattr but listing directories as single items.",
" -getfacl pattern [***] list eventual ACLs of the given files.",
" -getfacl_r pattern [***] like -getfacl but listing whole file trees.",
" -getfattr pattern [***] list eventual xattr of the given files.",

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -147,6 +147,92 @@ ex:;
}
/* Command -lfa_flags */
int Xorriso_option_lfa_flags(struct XorrisO *xorriso, char *mode, int flag)
{
int ret, lfa_flags_mem, l;
char *npt, *cpt, *mask= NULL;
uint64_t mask_flags;
lfa_flags_mem= xorriso->lfa_flags_setting;
npt= cpt= mode;
for(; npt!=NULL; cpt= npt+1) {
npt= strchr(cpt,':');
if(npt==NULL)
l= strlen(cpt);
else
l= npt-cpt;
if(l == 0)
continue;
if(l == 3 && strncmp(cpt, "off", l) == 0) {
xorriso->lfa_flags_setting&= ~1;
} else if((l == 2 && strncmp(cpt, "on", l) == 0)) {
xorriso->lfa_flags_setting|= 1;
} else if((l == 7 && strncmp(cpt, "restore", l) == 0)) {
xorriso->lfa_flags_setting|= (1 << 12);
} else if((l == 10 && strncmp(cpt, "no_restore", l) == 0)) {
xorriso->lfa_flags_setting&= ~(1 << 12);
} else if((l == 4 && strncmp(cpt, "read", l) == 0)) {
xorriso->lfa_flags_setting|= (1 << 11);
} else if((l == 7 && strncmp(cpt, "no_read", l) == 0)) {
xorriso->lfa_flags_setting&= ~(1 << 11);
} else if(l == 10 && strncmp(cpt, "restore_su", l) == 0) {
xorriso->lfa_flags_setting&= ~2;
xorriso->lfa_flags_setting&= ~(1 << 13);
} else if(l == 13 && strncmp(cpt, "no_restore_su", l) == 0) {
xorriso->lfa_flags_setting&= ~2;
xorriso->lfa_flags_setting|= 1 << 13;
} else if(l == 15 && strncmp(cpt, "restore_su_auto", l) == 0) {
xorriso->lfa_flags_setting|= 2;
} else if(l == 18 && strncmp(cpt, "restore_only_known", l) == 0) {
xorriso->lfa_flags_setting|= 1 << 14;
} else if(l == 15 && strncmp(cpt, "restore_unknown", l) == 0) {
xorriso->lfa_flags_setting&= ~(1 << 14);
} else if(l >= 13 && strncmp(cpt, "restore_mask=", 13) == 0) {
if(l == 13) {
xorriso->lfa_restore_mask= ~((uint64_t) 0);
} else {
Xorriso_alloc_meM(mask, char, l - 13 + 1);
strncpy(mask, cpt + 13, l - 13);
mask[l - 13]= 0;
ret= Xorriso_decode_lfa_flags(xorriso, mask, &mask_flags, 0);
if(ret > 0) {
xorriso->lfa_restore_mask= mask_flags;
} else {
sprintf(xorriso->info_text,
"Cannot apply -lfa_flags restore_mask='%s'", mask);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
}
}
} else if(l == 7 && strncmp(cpt, "default", l) == 0) {
xorriso->lfa_flags_setting= xorriso->lfa_flags_default;
xorriso->lfa_restore_mask= ~((uint64_t) 0);
} else {
sprintf(xorriso->info_text, "-lfa_flags: unknown mode in '%s'", mode);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
xorriso->lfa_flags_setting= lfa_flags_mem;
{ret= 0; goto ex;}
}
}
if(xorriso->lfa_flags_setting & 2) {
if(geteuid() == 0)
xorriso->lfa_flags_setting&= ~(1 << 13);
else
xorriso->lfa_flags_setting|= 1 << 13;
}
xorriso->do_aaip&= ~(15 << 11);
if(xorriso->lfa_flags_setting & 1)
xorriso->do_aaip|= xorriso->lfa_flags_setting & (15 << 11);
ret= Xorriso_set_ignore_aclea(xorriso, 0);
if(ret <= 0)
goto ex;
ret= 1;
ex:;
Xorriso_free_meM(mask);
return(ret);
}
/* Option -list_arg_sorting */
int Xorriso_option_list_arg_sorting(struct XorrisO *xorriso, int flag)
{
@ -365,10 +451,12 @@ logfile_wrong_form:;
/* Options -ls alias -lsi and -lsl alias -lsli
and -lsd alias -lsdi and -lsdl alias -lsdli
and -du alias -dui and -dus alias -dusi
and -lsattr alias -lsattri and -lsattrd alias -lsattrdi
@param flag bit0= long format (-lsl , -du, not -dus, not -ls)
bit1= do not expand patterns but use literally
bit2= -du rather than -ls
bit3= list directories as themselves (-lsd)
bit4= -lsattr rather than -ls
*/
int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag)
@ -442,7 +530,7 @@ no_memory:;
}
if(flag&2) {
ret= Xorriso_ls_filev(xorriso, xorriso->wdi, nump, argv + (*idx), mem,
flag&(1|4|8));
flag & (1 | 4 | 8 | 16));
} else if(nump==1 && strcmp(patterns[0],"*")==0 && !(flag&4)){
/* save temporary memory by calling simpler function */
ret= Xorriso_ls(xorriso, (flag&1)|4);
@ -452,7 +540,7 @@ no_memory:;
if(ret<=0)
{ret= 0; goto ex;}
ret= Xorriso_ls_filev(xorriso, xorriso->wdi, filec, filev, mem,
flag&(1|4|8));
flag & (1 | 4 | 8 | 16));
}
if(ret<=0)
{ret= 0; goto ex;}

View File

@ -2266,7 +2266,7 @@ int Xorriso_option_write_type(struct XorrisO *xorriso, char *mode, int flag)
}
/* Option -xattr "on"|"off" */
/* Option -xattr "on"|"any"|"off" */
int Xorriso_option_xattr(struct XorrisO *xorriso, char *mode, int flag)
{
int ret;

View File

@ -592,6 +592,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
"iso_nowtime","iso_rr_pattern","file_name_limit","follow","format","fs",
"gid","grow_blindly","hardlinks",
"hfsplus","history","indev","in_charset","joliet","joliet_map",
"lfa_flags",
"list_delimiter","list_extras","list_profiles","local_charset",
"mark","md5","mount_opts","modesty_on_drive",
"not_leaf","not_list","not_mgt",
@ -632,6 +633,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
};
static char argn_commands[][40]= {
"add","alter_date","alter_date_r","as",
"chattr","chattr_r","chattr_ri","chattri",
"check_md5","check_md5_r","check_media","check_media_defaults",
"chgrp","chgrpi","chgrp_r","chgrp_ri","chmod","chmodi",
"chmod_r","chmod_ri","chown","chowni","chown_r","chown_ri",
@ -640,7 +642,8 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
"file_size_limit","find","findi","finds","findx",
"getfacl","getfacli","getfacl_r","getfacl_ri",
"getfattr","getfattri","getfattr_r","getfattr_ri","hide",
"launch_frontend","ls","lsi","lsl","lsli","lsd","lsdi","lsdl","lsdli",
"launch_frontend","lsattr","lsattri","lsattrd","lsaddrdi",
"ls","lsi","lsl","lsli","lsd","lsdi","lsdl","lsdli",
"lsx","lslx","lsdx","lsdlx","map_l","mv","mvi","mkdir","mkdiri",
"not_paths","rm","rmi","rm_r","rm_ri","rmdir","rmdiri",
"update_l","update_li","update_lx","update_lxi",
@ -742,8 +745,8 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
"* Influencing the behavior of image loading:",
"read_speed", "load", "displacement", "read_fs",
"assert_volid", "in_charset",
"auto_charset", "hardlinks", "acl", "xattr", "md5", "for_backup",
"assert_volid", "in_charset", "auto_charset",
"for_backup", "hardlinks", "acl", "xattr", "md5", "lfa_flags",
"ecma119_map", "joliet_map",
"disk_dev_ino", "rom_toc_scan", "calm_drive", "ban_stdio_write",
"data_cache_size",
@ -778,6 +781,7 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
"* Navigation in ISO image and disk filesystem (2):",
"ls", "lsd", "lsl", "lsdl", "lsx", "lsdx", "lslx", "lsdlx",
"lsattr", "lsattri", "lsattrd", "lsaddrdi",
"getfacl", "getfacl_r", "getfattr", "getfattr_r", "du", "dus",
"dux", "dusx", "findx",
"compare", "compare_r", "compare_l", "show_stream", "show_stream_r",
@ -787,7 +791,7 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
"rm", "rm_r", "rmdir", "move", "mv",
"chown", "chown_r", "chgrp", "chgrp_r", "chmod", "chmod_r", "setfacl",
"setfacl_r", "setfacl_list", "setfattr", "setfattr_r", "setfattr_list",
"alter_date", "alter_date_r", "hide",
"chattr", "chattr_r", "alter_date", "alter_date_r", "hide",
"* Filters for data file content:",
"external_filter", "unregister_filter", "close_filter_list",
@ -1180,6 +1184,14 @@ next_command:;
(*idx)++;
ret= Xorriso_option_charset(xorriso, arg1, 3);
} else if(strcmp(cmd, "chattr") == 0 || strcmp(cmd, "chattri") == 0) {
(*idx)++;
ret= Xorriso_option_chattri(xorriso, arg1, argc, argv, idx, 0);
} else if(strcmp(cmd, "chattr_r") == 0 || strcmp(cmd, "chattr_ri") == 0) {
(*idx)++;
ret= Xorriso_option_chattri(xorriso, arg1, argc, argv, idx, 1);
} else if(strcmp(cmd,"check_md5")==0) {
ret= Xorriso_option_check_md5(xorriso, argc, argv, idx, 0);
@ -1424,6 +1436,8 @@ next_command:;
Xorriso_option_acl(xorriso, "on", 0);
Xorriso_option_xattr(xorriso, "any", 0);
Xorriso_option_md5(xorriso, "on", 0);
Xorriso_option_lfa_flags(xorriso,
"default:on:restore_mask=aAcCdDijmPsStTux", 0);
ret= 1;
} else if(strcmp(cmd,"format")==0) {
@ -1505,6 +1519,10 @@ next_command:;
} else if(strcmp(cmd, "launch_frontend") == 0) {
ret= Xorriso_option_launch_frontend(xorriso, argc, argv, idx, 0);
} else if(strcmp(cmd,"lfa_flags")==0) {
(*idx)++;
ret= Xorriso_option_lfa_flags(xorriso, arg1, 0);
} else if(strcmp(cmd, "list_arg_sorting") == 0) {
ret= Xorriso_option_list_arg_sorting(xorriso, 0);
@ -1542,6 +1560,11 @@ next_command:;
(*idx)+= 2;
ret= Xorriso_option_logfile(xorriso, arg1, arg2, 0);
} else if(strcmp(cmd,"lsattr")==0 || strcmp(cmd,"lsattri")==0 ||
strcmp(cmd,"lsattrd")==0 || strcmp(cmd,"lsattrdi")==0) {
ret= Xorriso_option_lsi(xorriso, argc, argv, idx,
16 | (cmd[6] == 'd') << 3);
} else if(strcmp(cmd,"ls")==0 || strcmp(cmd,"lsi")==0 ||
strcmp(cmd,"lsl")==0 || strcmp(cmd,"lsli")==0) {
ret= Xorriso_option_lsi(xorriso, argc, argv, idx, (cmd[2]=='l'));

View File

@ -319,6 +319,8 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path,
size_t num_attrs= 0, *value_lengths= NULL;
char **names= NULL, **values= NULL;
int *errnos= NULL;
uint64_t lfa_flags;
int max_bit, os_errno;
ret= lstat(disk_path, &stbuf);
if(ret==-1) {
@ -339,6 +341,7 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path,
ret= iso_node_get_attrs(node, &num_attrs, &names, &value_lengths, &values,
(!!(xorriso->do_aaip & 2)) | (!(xorriso->do_aaip & (8 | 16))) << 2);
if (ret < 0) {
Xorriso_process_msg_queues(xorriso, 0);
strcpy(xorriso->info_text, "Error with obtaining ACL and xattr for ");
Text_shellsafe(disk_path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
@ -459,8 +462,32 @@ cannot_set_perm:;
goto cannot_set_perm;
}
}
}
if(xorriso->do_aaip & (1 << 12)) {
ret= iso_node_get_lfa_flags(node, &lfa_flags, &max_bit, 0);
if (ret < 0) {
Xorriso_process_msg_queues(xorriso, 0);
strcpy(xorriso->info_text,
"Error with obtaining file attribut flags for ");
Text_shellsafe(disk_path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
} else if(ret > 0) {
ret= iso_local_set_lfa_flags(disk_path, lfa_flags, max_bit,
xorriso->lfa_restore_mask, &os_errno,
(!!(xorriso->do_aaip & (1 << 13))) |
((!!(xorriso->do_aaip & (1 << 14))) << 1));
if(ret < 0) {
/* >>> Need adjustable graceful error handling */;
Xorriso_process_msg_queues(xorriso, 0);
{ret= 0; goto ex;}
}
}
}
ret= 1;
ex:;
iso_node_get_attrs(node, &num_attrs, &names, &value_lengths, &values,1 << 15);

View File

@ -2781,7 +2781,7 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
int part_table_implicit= 0;
char *line, *sfe= NULL, mode[80], *form, *treatment;
char *in_pt, *out_pt, *nl_charset, *local_charset, *mode_pt;
char *dev_filter= NULL, *xorriso_id= NULL;
char *dev_filter= NULL, *xorriso_id= NULL, *lfa_text= NULL;
static char channel_prefixes[4][4]= {".","R","I","M"};
static char load_names[][20]= {"auto", "session", "track", "lba", "volid"};
static int max_load_mode= 4;
@ -3775,12 +3775,61 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
sprintf(line,"-acl %s\n", (xorriso->do_aaip & 1 ? "on" : "off"));
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= ((xorriso->do_aaip & (2 | 8)) == 0);
sprintf(line,"-xattr %s\n", (xorriso->do_aaip & 4 ?
xorriso->do_aaip & 1024 ? "any" : "user"
: "off"));
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (xorriso->lfa_flags_setting == xorriso->lfa_flags_default);
strcpy(line, "-lfa_flags ");
if(xorriso->lfa_flags_setting & 1)
strcat(line, "on");
else
strcat(line, "off");
if(xorriso->lfa_flags_setting & (1 << 11))
strcat(line, ":read");
else
strcat(line, ":no_read");
if(xorriso->lfa_flags_setting & (1 << 12))
strcat(line, ":restore");
else
strcat(line, ":no_restore");
if(xorriso->lfa_flags_setting & (1 << 13))
strcat(line, ":no_restore_su");
else
strcat(line, ":restore_su");
if(xorriso->lfa_flags_setting & 2)
strcat(line, ":restore_su_auto");
if(xorriso->lfa_flags_setting & (1 << 14))
strcat(line, ":restore_only_known");
else
strcat(line, ":restore_unknown");
strcat(line, "\n");
Xorriso_status_result(xorriso,filter,fp,flag&2);
strcpy(line, "-lfa_flags ");
if(xorriso->lfa_restore_mask == ~((uint64_t) 0)) {
strcat(line, "restore_mask=");
} else {
ret= Xorriso_encode_lfa_flags(xorriso, xorriso->lfa_restore_mask,
&lfa_text, 0);
if(ret > 0) {
strcat(line, "restore_mask=");
if(lfa_text[0] != 0)
strcat(line, lfa_text);
else
strcat(line, "-");
}
if(lfa_text != NULL)
free(lfa_text);
}
strcat(line, "\n");
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= ((xorriso->do_aaip & (16 | 32 | 64)) == 0);
sprintf(line,"-disk_dev_ino %s\n",
(xorriso->do_aaip & 16 ? (xorriso->do_aaip & 128 ? "ino_only" : "on" )

View File

@ -912,7 +912,7 @@ int Xorriso_make_iso_write_opts(struct XorrisO *xorriso, IsoImage *image,
((!!xorriso->do_iso1999) * isoburn_igopt_iso1999) |
(( !(xorriso->ino_behavior & 2)) * isoburn_igopt_hardlinks) |
(( (!(xorriso->ino_behavior & 2)) ||
(xorriso->do_aaip & (2 | 8 | 16 | 256)) ||
(xorriso->do_aaip & (2 | 8 | 16 | 256 | (1 << 11))) ||
(xorriso->do_md5 & (2 | 4)) ||
xorriso->do_hfsplus
) * isoburn_igopt_aaip) |

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, Jun 29, 2024"
.TH XORRISO 1 "Version 1.5.7, Jul 20, 2024"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -491,6 +491,17 @@ or to print them.
.br
Recording and restoring of xattr from and to local files works currently
only on GNU/Linux and FreeBSD, where they are known as extattr.
.PP
\fBLinux file attributes\fR are binary flags which can be set by program
chattr(1) and listed by program lsattr(1). See their man pages and the
definitions FS_*_FL in Linux header file <linux/fs.h>.
Not all defined flags get reported by lsattr and accepted by chattr, but their
number grew over the years.
.br
\fBxorriso\fR records the flags of disk files if enabled by command
\fB\-lfa_flags\fR. Its command \-lsattr lists 22 flags the same way as the
program lsattr does. They can be set by xorriso command \-chattr and can be
enabled by \-lfa_flags for restoring when their files get restored to disk.
.SS
.B Command processing:
.br
@ -1043,6 +1054,55 @@ write the attributes.
Note that it is not possible to set xattr of namespace "isofs." by xorriso
xattr manipulation commands.
.TP
\fB\-lfa_flags\fR mode[:mode...]
Enable, disable, or influence processing of Linux file attributes as described
in man 1 chattr.
.br
Mode "on" enables actual processing of the attributes. Mode "off" disables it.
The other modes define the behavior in case of "on".
.br
Mode "read" enables obtaining of these attributes from disk files,
storing them in the emerging ISO 9660 filesystem as AAIP data, importing
them when an ISO filesystem gets loaded and bears such stored attributes,
and comparing them during comparisons between files on disk and in ISO.
.br
Mode "no_read" disables processing of the attributes from disk files. If no
other settings like \-acl "on" or \-xattr "on" require storing and importing
of AAIP data, then previously recorded file attributes can get kept out of
the next appended session.
.br
Mode "restore" enables restoring of attributes when their file gets restored
and comparing them during comparisons between files on disk and in ISO.
Several modes below modify the behavior during restoring of attributes.
.br
Mode "no_restore" disables restoring of attributes.
.br
Mode "restore_su" enables restoring of the attributes "iaj" which are only
changeable by the bearer of superuser capabilities. "no_restore_su" disables
restoring of these attributes. "restore_su_auto" enables it only if the
effective user id is 0.
.br
Mode "restore_only_known" restricts restoring to the known settable attribute
flags "aAcCdDFijmPsStTux". "restore_unknown" enables the attempt to restore
unknown flags or even those which are known to be unchangeable, if they are
not disabled by other modes.
.br
Mode "restore_mask=..." enables particular attributes for restoring. All others
will not be restored. The list of desired attribute letters follows the '='
character. An empty list enables all attributes, if they are not disabled by
other modes. The single character "\-" bans all attributes from restoring,
like "off" does. Example:
.br
\-lfa_flags restore_mask=SdCiaj
.br
Mode "default" reinstates the default settings:
.br
\-lfa_flags off:read:restore:restore_su_auto:restore_only_known
.br
\-lfa_flags restore_mask=
.br
Use "default:on" to get default settings with enabled processing.
.TP
\fB\-md5\fR "on"|"all"|"off"|"load_check_off"
Enable or disable processing of MD5 checksums for the overall session and for
each single data file. If enabled then images with checksum tags get loaded
@ -1083,17 +1143,24 @@ actions get_md5, check_md5, and via \-check_media.
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
\-hardlinks on \-acl on \-xattr any \-md5 on
\-lfa_flags default:on:restore_mask=aAcCdDijmPsStTux
.br
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 privileges to record or restore
such attributes. At recording time, xorriso will try to tolerate missing
privileges and just record what is readable.
But at restore time, missing privileges will cause failure events.
But at restore time, missing privileges or preconditions will cause failure
events.
.br
Command \-xattr "user" after command \-for_backup excludes non\-user attributes
from being recorded or restored.
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.
.TP
\fB\-ecma119_map\fR "stripped"|"unmapped"|"lowercase"|"uppercase"
Choose the conversion of file names when a session gets loaded, if they stem
@ -1870,7 +1937,7 @@ This indicates that the entry goes to the "default" ACL rather than to the
u::rwx,g::rx,o::,d:u::rwx,d:g::rx,d:o::,d:u:lisa:rwx,d:m::rwx
.TP
\fB\-setfacl_r\fR acl_text iso_rr_path [***]
Like \-setfacl but affecting all files below eventual directories.
Like \-setfacl but affecting all files below given directories.
.TP
\fB\-setfacl_list\fR disk_path
Read the output of \-getfacl_r or shell command getfacl \-R and apply it to the
@ -1901,7 +1968,7 @@ See also command \-backslash_codes. Other than with command \-setfattr_list,
the byte value 0 cannot be expressed via \-setfattr.
.TP
\fB\-setfattr_r\fR [-]name value iso_rr_path [***]
Like \-setfattr but affecting all files below eventual directories.
Like \-setfattr but affecting all files below given directories.
.TP
\fB\-setfattr_list\fR disk_path
Read the output format of \-getfattr_r or shell command getfattr \-Rd and apply
@ -1927,6 +1994,34 @@ whitespace after the end quote will be ignored. Non\-printables bytes and quotes
must be represented as \\XYZ by their octal 8\-bit code XYZ.
Use code \\000 for 0\-bytes.
.TP
\fB\-chattr\fR mode iso_rr_path [***]
Set or unset Linux file attributes like program chattr(1) would do to disk
files.
.br
The first letter of the mode string determines what to do. The other letters
are symbolic attribute flag letters out of the set "aAcCdDeEFhiIjNmPsStTuVxZ"
as described in man 1 chattr.
There is no restriction which attributes can be set or unset. But at restore
time, unusual or unsuitable attributes may cause problems.
.br
First letter '+' causes the given attribute flags to be set. All other
attributes stay as they are.
.br
First letter '\-' causes the given attribute flags to be unset. All other
attributes stay as they are. (Note that '\-' is also accepted as symbolic
attribute letter which has no effect.)
.br
First letter '.' causes all attribute flags except the given ones to be unset.
The given ones stay as they are. This is not a feature of program chattr(1).
.br
First letter '=' causes the given attribute flags to be set. All other
get unset.
.br
Example: \-chattr +sDu /my/file /my/other_file \-\-
.TP
\fB\-chattr_r\fR mode iso_rr_path [***]
Like \-chattr but affecting all files below given directories.
.TP
\fB\-alter_date\fR type timestring iso_rr_path [***]
Alter the date entries of files in the ISO image. type may be one of
the following:
@ -2117,6 +2212,16 @@ Matches files which have xattr name\-value pairs from user namespace.
\fB\-has_aaip\fR :
Matches files which have ACL or any xattr.
.br
\fB\-has_lfa_flags\fR flag_letters :
Matches files which have Linux file attributes attached and have all flags set
which correspond to the characters in the string flag_letters. The characters
may be zero or more out of the set "aAcCdDeEFhiIjNmPsStTuVxZ".
The character '\-' will be ignored. The flag_letters string "\-" matches any
attribute set, but not a file with no Linux file attributes attached.
E.g. look for files with both flags 'i' (immutable) and 'd' (no dump) set:
.br
\-has_lfa_flags di
.br
\fB\-has_any_xattr\fR :
Matches files which have any xattr other than ACL.
.br
@ -2345,10 +2450,18 @@ terminal\-safe but should work in script files.
Mode "r" uses no quotation marks. Not safe.
Mode "b" prints backslash encoding. Not suitable for shell parsing.
.br
E.g. \-exec list_extattr e \-\-
E.g.: \-exec list_extattr e \-\-
.br
Command \-backslash_codes does not affect the output.
.br
\fBlsattrd\fR
shows the Linux file attribute flags like command \-lsattrd does.
.br
\fBchattr\fR
applies \-chattr with the given mode.
.br
E.g.: \-exec chattr +sDu \-\-
.br
\fBget_md5\fR
prints the MD5 sum, if recorded, together with file path.
.br
@ -4904,6 +5017,15 @@ namespace "user", "any" only omits namespace "isofs".
Like \-gefattr but listing recursively the whole file trees underneath of
directories.
.TP
\fB\-lsattr\fR iso_rr_pattern [***]
Print the Linux file attributes of the given files like program lsattr(1)
would do with disk files. The meaning of the shown flag letters are described
in man 1 chattr with the exception of '\-', which is shown as placeholder for
an unset flag.
.br
The given files will get a line printed even if they have no Linux file
attributes attached. In this case all flags will be shown as '\-'.
.TP
\fB\-du\fR iso_rr_pattern [***]
Recursively list size of directories and files in the ISO image
which match one of the patterns.
@ -6780,11 +6902,13 @@ Other programs which burn sessions to optical media
.BR wodim(1),
.BR cdrskin(1)
.TP
ACL and xattr
ACL, xattr, Linux file attributes
.BR getfacl(1),
.BR setfacl(1),
.BR getfattr(1),
.BR setfattr(1)
.BR setfattr(1),
.BR lsattr(1),
.BR chattr(1)
.TP
MD5 checksums
.BR md5sum(1)

View File

@ -1359,6 +1359,13 @@ int Xorriso_option_changes_pending(struct XorrisO *xorriso, char *state,
/* @since 0.3.0 */
int Xorriso_option_charset(struct XorrisO *xorriso, char *name, int flag);
/* Commands -chattr alias -chattri and -chattr_r alias -chattr_ri */
/* @param flag bit0=recursive -chattr_r
*/
/* @since 1.5.8 */
int Xorriso_option_chattri(struct XorrisO *xorriso, char *chattr_text,
int argc, char **argv, int *idx, int flag);
/* Command -check_md5 and -check_md5_r
@param flag bit0= issue summary message
bit1= do not reset pacifier, no final pacifier message
@ -1622,10 +1629,14 @@ int Xorriso_option_follow(struct XorrisO *xorriso, char *mode, int flag);
Xorriso_option_acl(xorriso, "on", 0);
Xorriso_option_xattr(xorriso, "any", 0);
Xorriso_option_md5(xorriso, "on", 0);
Xorriso_option_lfa_flags(xorriso,
"default:on:restore_mask=aAcCdDijmPsStTux", 0);
*/
/* @since 0.4.0 */
/* xattr "any"
@since 1.5.0
lfa_flags "default:on:restore_mask=aAcCdDijmPsStTux"
@since 1.5.8
*/
/* Command -fs */
@ -1698,6 +1709,10 @@ int Xorriso_option_joliet_map(struct XorrisO *xorriso, char *mode, int flag);
int Xorriso_option_launch_frontend(struct XorrisO *xorriso,
int argc, char **argv, int *idx, int flag);
/* Command -lfa_flags */
/* @sice 1.5.8 */
int Xorriso_option_lfa_flags(struct XorrisO *xorriso, char *mode, int flag);
/* Command -list_arg_sorting */
/* @since 1.2.2 */
int Xorriso_option_list_arg_sorting(struct XorrisO *xorriso, int flag);
@ -1745,10 +1760,13 @@ int Xorriso_option_logfile(struct XorrisO *xorriso, char *channel,
/* Command -ls alias -lsi and -lsl alias -lsli
and -lsd alias -lsdi and -lsdl alias -lsdli
and -du alias -dui and -dus alias -dusi
and -lsattr alias -lsattr and -lsattrd alias -lsattrdi
@param flag bit0= long format (-lsl , -du, not -dus, not -ls)
bit1= do not expand patterns but use literally
bit2= -du rather than -ls
bit3= list directories as themselves (-lsd)
bit4= -lsattr rather than -ls
@since 1.5.8
*/
/* @since 0.1.0 */
int Xorriso_option_lsi(struct XorrisO *xorriso, int argc, char **argv,

View File

@ -426,6 +426,17 @@ to print them.
Recording and restoring of xattr from and to local files works currently
only on GNU/Linux and FreeBSD, where they are known as extattr.
*Linux file attributes* are binary flags which can be set by program
chattr(1) and listed by program lsattr(1). See their man pages and the
definitions FS_*_FL in Linux header file <linux/fs.h>. Not all defined
flags get reported by lsattr and accepted by chattr, but their number
grew over the years.
'xorriso' records the flags of disk files if enabled by command
*-lfa_flags*. Its command -lsattr lists 22 flags the same way as the
program lsattr does. They can be set by xorriso command -chattr and can
be enabled by -lfa_flags for restoring when their files get restored to
disk.

File: xorriso.info, Node: Processing, Next: Dialog, Prev: Extras, Up: Top
@ -937,6 +948,44 @@ activate them only after image loading.
to read or write the attributes.
Note that it is not possible to set xattr of namespace "isofs." by
xorriso xattr manipulation commands.
-lfa_flags mode[:mode...]
Enable, disable, or influence processing of Linux file attributes
as described in man 1 chattr.
Mode "on" enables actual processing of the attributes. Mode "off"
disables it. The other modes define the behavior in case of "on".
Mode "read" enables obtaining of these attributes from disk files,
storing them in the emerging ISO 9660 filesystem as AAIP data,
importing them when an ISO filesystem gets loaded and bears such
stored attributes, and comparing them during comparisons between
files on disk and in ISO.
Mode "no_read" disables processing of the attributes from disk
files. If no other settings like -acl "on" or -xattr "on" require
storing and importing of AAIP data, then previously recorded file
attributes can get kept out of the next appended session.
Mode "restore" enables restoring of attributes when their file gets
restored and comparing them during comparisons between files on
disk and in ISO. Several modes below modify the behavior during
restoring of attributes.
Mode "no_restore" disables restoring of attributes.
Mode "restore_su" enables restoring of the attributes "iaj" which
are only changeable by the bearer of superuser capabilities.
"no_restore_su" disables restoring of these attributes.
"restore_su_auto" enables it only if the effective user id is 0.
Mode "restore_only_known" restricts restoring to the known settable
attribute flags "aAcCdDFijmPsStTux". "restore_unknown" enables the
attempt to restore unknown flags or even those which are known to
be unchangeable, if they are not disabled by other modes.
Mode "restore_mask=..." enables particular attributes for
restoring. All others will not be restored. The list of desired
attribute letters follows the '=' character. An empty list enables
all attributes, if they are not disabled by other modes. The
single character "-" bans all attributes from restoring, like "off"
does. Example:
-lfa_flags restore_mask=SdCiaj
Mode "default" reinstates the default settings:
-lfa_flags off:read:restore:restore_su_auto:restore_only_known
-lfa_flags restore_mask=
Use "default:on" to get default settings with enabled processing.
-md5 "on"|"all"|"off"|"load_check_off"
Enable or disable processing of MD5 checksums for the overall
session and for each single data file. If enabled then images with
@ -972,16 +1021,22 @@ 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
-hardlinks on -acl on -xattr any -md5 on -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
privileges to record or restore such attributes. At recording
time, xorriso will try to tolerate missing privileges and just
record what is readable. But at restore time, missing privileges
will cause failure events.
Command -xattr "user" after command -for_backup excludes non-user
attributes from being recorded or restored.
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.
-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.
@ -1625,7 +1680,7 @@ whether they stem from the loaded image or were newly inserted.
rather than to the "access" ACL. Example:
u::rwx,g::rx,o::,d:u::rwx,d:g::rx,d:o::,d:u:lisa:rwx,d:m::rwx
-setfacl_r acl_text iso_rr_path [***]
Like -setfacl but affecting all files below eventual directories.
Like -setfacl but affecting all files below given directories.
-setfacl_list disk_path
Read the output of -getfacl_r or shell command getfacl -R and apply
it to the iso_rr_paths as given in lines beginning with "# file:".
@ -1651,7 +1706,7 @@ whether they stem from the loaded image or were newly inserted.
See also command -backslash_codes. Other than with command
-setfattr_list, the byte value 0 cannot be expressed via -setfattr.
-setfattr_r [-]name value iso_rr_path [***]
Like -setfattr but affecting all files below eventual directories.
Like -setfattr but affecting all files below given directories.
-setfattr_list disk_path
Read the output format of -getfattr_r or shell command getfattr -Rd
and apply it to the iso_rr_paths as given in lines beginning with
@ -1671,6 +1726,27 @@ whether they stem from the loaded image or were newly inserted.
the end quote will be ignored. Non-printables bytes and quotes
must be represented as \XYZ by their octal 8-bit code XYZ. Use code
\000 for 0-bytes.
-chattr mode iso_rr_path [***]
Set or unset Linux file attributes like program chattr(1) would do
to disk files.
The first letter of the mode string determines what to do. The
other letters are symbolic attribute flag letters out of the set
"aAcCdDeEFhiIjNmPsStTuVxZ" as described in man 1 chattr. There is
no restriction which attributes can be set or unset. But at
restore time, unusual or unsuitable attributes may cause problems.
First letter '+' causes the given attribute flags to be set. All
other attributes stay as they are.
First letter '-' causes the given attribute flags to be unset. All
other attributes stay as they are. (Note that '-' is also accepted
as symbolic attribute letter which has no effect.)
First letter '.' causes all attribute flags except the given ones
to be unset. The given ones stay as they are. This is not a
feature of program chattr(1).
First letter '=' causes the given attribute flags to be set. All
other get unset.
Example: -chattr +sDu /my/file /my/other_file -
-chattr_r mode iso_rr_path [***]
Like -chattr but affecting all files below given directories.
-alter_date type timestring iso_rr_path [***]
Alter the date entries of files in the ISO image. type may be one
of the following:
@ -1819,6 +1895,16 @@ File: xorriso.info, Node: CmdFind, Next: Filter, Prev: Manip, Up: Commands
namespace.
-has_aaip :
Matches files which have ACL or any xattr.
-has_lfa_flags flag_letters :
Matches files which have Linux file attributes attached and
have all flags set which correspond to the characters in the
string flag_letters. The characters may be zero or more out
of the set "aAcCdDeEFhiIjNmPsStTuVxZ". The character '-' will
be ignored. The flag_letters string "-" matches any attribute
set, but not a file with no Linux file attributes attached.
E.g. look for files with both flags 'i' (immutable) and 'd'
(no dump) set:
-has_lfa_flags di
-has_any_xattr :
Matches files which have any xattr other than ACL.
-has_md5 :
@ -2013,8 +2099,14 @@ File: xorriso.info, Node: CmdFind, Next: Filter, Prev: Manip, Up: Commands
script files. Mode "r" uses no quotation marks. Not safe.
Mode "b" prints backslash encoding. Not suitable for shell
parsing.
E.g. -exec list_extattr e -
E.g.: -exec list_extattr e -
Command -backslash_codes does not affect the output.
lsattrd
shows the Linux file attribute flags like command -lsattrd
does.
chattr
applies -chattr with the given mode.
E.g.: -exec chattr +sDu -
get_md5
prints the MD5 sum, if recorded, together with file path.
check_md5
@ -4122,6 +4214,14 @@ File: xorriso.info, Node: Navigate, Next: Verify, Prev: Inquiry, Up: Command
-getfattr_r iso_rr_pattern [***]
Like -gefattr but listing recursively the whole file trees
underneath of directories.
-lsattr iso_rr_pattern [***]
Print the Linux file attributes of the given files like program
lsattr(1) would do with disk files. The meaning of the shown flag
letters are described in man 1 chattr with the exception of '-',
which is shown as placeholder for an unset flag.
The given files will get a line printed even if they have no Linux
file attributes attached. In this case all flags will be shown as
'-'.
-du iso_rr_pattern [***]
Recursively list size of directories and files in the ISO image
which match one of the patterns. similar to shell command du -k.
@ -5725,8 +5825,9 @@ Other programs which produce ISO 9660 images
mkisofs(8), genisoimage(1)
Other programs which burn sessions to optical media
growisofs(1), cdrecord(1), wodim(1), cdrskin(1)
ACL and xattr
getfacl(1), setfacl(1), getfattr(1), setfattr(1)
ACL, xattr, Linux file attributes
getfacl(1), setfacl(1), getfattr(1), setfattr(1), lsattr(1),
chattr(1)
MD5 checksums
md5sum(1)
On FreeBSD some commands differ:
@ -5795,8 +5896,8 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -acl controls handling of ACLs: Loading. (line 189)
* -add inserts one or more paths: Insert. (line 44)
* -add_plainly inserts one or more paths: Insert. (line 68)
* -alter_date sets timestamps in ISO image: Manip. (line 139)
* -alter_date_r sets timestamps in ISO image: Manip. (line 174)
* -alter_date sets timestamps in ISO image: Manip. (line 160)
* -alter_date_r sets timestamps in ISO image: Manip. (line 195)
* -append_partition adds arbitrary file after image end: Bootable.
(line 470)
* -application_id sets application id: SetWrite. (line 218)
@ -5806,15 +5907,17 @@ 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 369)
* -ban_stdio_write demands real drive: Loading. (line 413)
* -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 359)
* -calm_drive reduces drive activity: Loading. (line 403)
* -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)
* -charset sets input/output character set: Charset. (line 54)
* -chattr sets Linux file attributes in ISO image: Manip. (line 139)
* -chattr_r sets Linux file attributes in ISO image: Manip. (line 158)
* -check_md5 verifies file checksum: Verify. (line 184)
* -check_md5_r verifies file tree checksums: Verify. (line 198)
* -check_media reads media block by block: Verify. (line 21)
@ -5831,9 +5934,9 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -close_filter_list bans filter registration: Filter. (line 50)
* -commit writes pending ISO image: Writing. (line 27)
* -commit_eject writes and ejects: Writing. (line 53)
* -compare reports ISO/disk differences: Navigate. (line 131)
* -compare_l reports ISO/disk differences: Navigate. (line 147)
* -compare_r reports ISO/disk differences: Navigate. (line 143)
* -compare reports ISO/disk differences: Navigate. (line 139)
* -compare_l reports ISO/disk differences: Navigate. (line 155)
* -compare_r reports ISO/disk differences: Navigate. (line 151)
* -compliance controls standard compliance: SetWrite. (line 62)
* -concat copies ISO file content: Restore. (line 148)
* -copyright_file sets copyright file name: SetWrite. (line 266)
@ -5844,25 +5947,25 @@ 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 385)
* -data_cache_size adjusts read cache size: Loading. (line 429)
* -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 279)
* -disk_dev_ino fast incremental backup: Loading. (line 323)
* -disk_pattern controls pattern expansion: Insert. (line 34)
* -displacement compensate altered image start address: Loading.
(line 102)
* -drive_access control device file locking: AqDrive. (line 72)
* -drive_class controls drive accessability: AqDrive. (line 43)
* -du show directory size in ISO image: Navigate. (line 78)
* -du show directory size in ISO image: Navigate. (line 86)
* -dummy controls write simulation: SetWrite. (line 497)
* -dus show directory size in ISO image: Navigate. (line 81)
* -dusx show directory size on disk: Navigate. (line 88)
* -dux show directory size on disk: Navigate. (line 84)
* -dus show directory size in ISO image: Navigate. (line 89)
* -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 373)
* -ecma119_map names w/o Rock Ridge, Joliet: Loading. (line 252)
* -early_stdio_test classifies stdio drives: Loading. (line 417)
* -ecma119_map names w/o Rock Ridge, Joliet: Loading. (line 296)
* -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)
@ -5875,13 +5978,13 @@ 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 299)
* -file_name_limit curbs length of file names: Loading. (line 343)
* -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 91)
* -findx traverses disk tree: Navigate. (line 99)
* -follow softlinks and mount points: SetInsert. (line 77)
* -format formats media: Writing. (line 87)
* -for_backup -acl,-xattr,-hardlinks,-md5: Loading. (line 238)
* -for_backup acl,xattr,hardlinks,md5,lfa_flags: Loading. (line 276)
* -fs sets size of fifo: SetWrite. (line 500)
* -getfacl shows ACL in ISO image: Navigate. (line 60)
* -getfacl_r shows ACL in ISO image: Navigate. (line 66)
@ -5892,18 +5995,20 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -hardlinks controls handling of hard links: Loading. (line 152)
* -help prints help text: Scripting. (line 19)
* -hfsplus enables production of HFS+ partition: SetWrite. (line 14)
* -hide excludes file names from directory trees: Manip. (line 177)
* -hide excludes file names from directory trees: Manip. (line 198)
* -history brings text into readline history: Scripting. (line 42)
* -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 273)
(line 317)
* -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 265)
* -joliet_map Joliet names: Loading. (line 309)
* -launch_frontend starts frontend program at pipes: Frontend.
(line 141)
* -lfa_flags controls handling of Linux file attributes: Loading.
(line 207)
* -list_arg_sorting prints sorting order of -x: ArgSort. (line 26)
* -list_delimiter replaces '--': Scripting. (line 55)
* -list_extras lists compile time extra features: Scripting. (line 24)
@ -5915,6 +6020,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -local_charset sets terminal character set: Charset. (line 57)
* -logfile logs output channels to file: Frontend. (line 19)
* -ls lists files in ISO image: Navigate. (line 24)
* -lsattr shows Linux file attributes in ISO image: Navigate. (line 78)
* -lsd lists files in ISO image: Navigate. (line 31)
* -lsdl lists files in ISO image: Navigate. (line 42)
* -lsdlx lists files on disk: Navigate. (line 57)
@ -5926,7 +6032,7 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -map_l inserts paths from disk file: Insert. (line 96)
* -map_single inserts path: Insert. (line 93)
* -mark sets synchronizing message: Frontend. (line 23)
* -md5 controls handling of MD5 sums: Loading. (line 207)
* -md5 controls handling of MD5 sums: Loading. (line 245)
* -mkdir creates ISO directory: Insert. (line 188)
* -modesty_on_drive keep drive buffer hungry: SetWrite. (line 440)
* -mount issues mount command for ISO session: Restore. (line 204)
@ -5983,7 +6089,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 331)
* -rom_toc_scan searches for sessions: Loading. (line 375)
* -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)
@ -5998,8 +6104,8 @@ File: xorriso.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
* -setfattr_r sets xattr in ISO image: Manip. (line 118)
* -set_filter applies filter to file: Filter. (line 58)
* -set_filter_r applies filter to file tree: Filter. (line 84)
* -show_stream shows data source and filters: Navigate. (line 151)
* -show_stream_r shows data source and filters: Navigate. (line 169)
* -show_stream shows data source and filters: Navigate. (line 159)
* -show_stream_r shows data source and filters: Navigate. (line 177)
* -sh_style_result makes results look more like shell: Scripting.
(line 61)
* -signal_handling controls handling of system signals: Exception.
@ -6061,8 +6167,8 @@ 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 279)
* Backup, enable features, -for_backup: Loading. (line 238)
* Backup, enable fast incremental, -disk_dev_ino: Loading. (line 323)
* Backup, enable features, -for_backup: Loading. (line 276)
* Backup, scdbackup checksum tag, -scdbackup: Emulation. (line 179)
* Blank media, _definition: Media. (line 34)
* Blank, format, Immed bit, -use_immed_bit: SetWrite. (line 478)
@ -6101,8 +6207,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 373)
* Drive, demand real MMC, -ban_stdio_write: Loading. (line 369)
* Drive, classify stdio, -early_stdio_test: Loading. (line 417)
* Drive, demand real MMC, -ban_stdio_write: Loading. (line 413)
* Drive, eject tray, -eject: Writing. (line 50)
* Drive, for input and output, -dev: AqDrive. (line 12)
* Drive, for input, -indev: AqDrive. (line 23)
@ -6110,7 +6216,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 359)
* Drive, reduce activity, -calm_drive: Loading. (line 403)
* Drive, report SCSI commands, -scsi_log: Scripting. (line 143)
* Drive, write and eject, -commit_eject: Writing. (line 53)
* Drive, _definition: Drives. (line 6)
@ -6126,16 +6232,16 @@ 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 299)
* File names, if Joliet is loaded: Loading. (line 265)
* File names, if neither Rock Ridge nor Joliet: Loading. (line 252)
* File names, curb length, -file_name_limit: Loading. (line 343)
* File names, if Joliet is loaded: Loading. (line 309)
* File names, if neither Rock Ridge nor Joliet: Loading. (line 296)
* 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)
* Filter, ban registration, -close_filter_list: Filter. (line 50)
* Filter, register, -external_filter: Filter. (line 20)
* Filter, show chain, -show_stream: Navigate. (line 151)
* Filter, show chains of tree, -show_stream_r: Navigate. (line 169)
* Filter, show chain, -show_stream: Navigate. (line 159)
* Filter, show chains of tree, -show_stream_r: Navigate. (line 177)
* Filter, unregister, -unregister_filter: Filter. (line 47)
* Filter, zisofs parameters, -zisofs: SetWrite. (line 317)
* Filter, _definition: Filter. (line 6)
@ -6152,9 +6258,9 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Hard links, control handling, -hardlinks: Loading. (line 152)
* HFS+ allocation block size: Bootable. (line 458)
* HFS+ serial number: Bootable. (line 455)
* hidden, set in ISO image, -hide: Manip. (line 177)
* hidden, set in ISO image, -hide: Manip. (line 198)
* HP-PA boot sector, production: Bootable. (line 430)
* Image reading, cache size, -data_cache_size: Loading. (line 385)
* Image reading, cache size, -data_cache_size: Loading. (line 429)
* 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)
@ -6206,14 +6312,21 @@ 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 273)
* libisofs, fixed "now" time: Loading. (line 317)
* Linux device type, -scsi_dev_family: AqDrive. (line 95)
* Linux file attributes, control handling, -lfa_flags: Loading.
(line 207)
* Linux file attributes, set in ISO image, -chattr: Manip. (line 139)
* Linux file attributes, set in ISO image, -chattr_r: Manip. (line 158)
* Linux file attributes, show in ISO image, -lsattr: Navigate.
(line 78)
* Linux file attributes, _definition: Extras. (line 84)
* List delimiter, _definition: Processing. (line 13)
* Local Character Set, _definition: Charset. (line 11)
* MBR bootable/active flag, enforce: Bootable. (line 388)
* MBR, set, -boot_image system_area=: Bootable. (line 227)
* MBR, _definition: Extras. (line 27)
* MD5, control handling, -md5: Loading. (line 207)
* MD5, control handling, -md5: Loading. (line 245)
* Media, erase, -blank: Writing. (line 57)
* Media, format, -format: Writing. (line 87)
* Media, list formats, -list_formats: Writing. (line 128)
@ -6223,10 +6336,10 @@ File: xorriso.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Modifying, _definition: Methods. (line 28)
* Multi-session media, _definition: Media. (line 7)
* Multi-session, _definition: Model. (line 18)
* Navigate, directory size in ISO image, -du: Navigate. (line 78)
* Navigate, directory size in ISO image, -dus: Navigate. (line 81)
* Navigate, directory size in on disk, -dusx: Navigate. (line 88)
* Navigate, directory size in on disk, -dux: Navigate. (line 84)
* Navigate, directory size in ISO image, -du: Navigate. (line 86)
* Navigate, directory size in ISO image, -dus: Navigate. (line 89)
* Navigate, directory size in on disk, -dusx: Navigate. (line 96)
* Navigate, directory size in on disk, -dux: Navigate. (line 92)
* Navigate, list disk files, -lsdlx: Navigate. (line 57)
* Navigate, list disk files, -lsdx: Navigate. (line 51)
* Navigate, list disk files, -lslx: Navigate. (line 54)
@ -6322,19 +6435,19 @@ 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 331)
* Table-of-content, search sessions, -rom_toc_scan: Loading. (line 375)
* 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 139)
* Timestamps, set in ISO image, -alter_date_r: Manip. (line 174)
* Tree, disk, traverse, -findx: Navigate. (line 91)
* Timestamps, set in ISO image, -alter_date: Manip. (line 160)
* Timestamps, set in ISO image, -alter_date_r: Manip. (line 195)
* Tree, disk, traverse, -findx: Navigate. (line 99)
* Tree, ISO, traverse and alter, -find: CmdFind. (line 7)
* Unsuitable media states, _definition: Media. (line 25)
* UTF-16, for Joliet paths, -compliance: SetWrite. (line 114)
* Verify, check blocks, -check_media: Verify. (line 21)
* Verify, compare ISO and disk file, -compare: Navigate. (line 131)
* Verify, compare ISO and disk tree, -compare_r: Navigate. (line 143)
* Verify, compare ISO and disk, -compare_l: Navigate. (line 147)
* Verify, compare ISO and disk file, -compare: Navigate. (line 139)
* Verify, compare ISO and disk tree, -compare_r: Navigate. (line 151)
* Verify, compare ISO and disk, -compare_l: Navigate. (line 155)
* Verify, file checksum, -check_md5: Verify. (line 184)
* Verify, file tree checksums, -check_md5_r: Verify. (line 198)
* Verify, preset -check_media, -check_media_defaults: Verify. (line 40)
@ -6376,54 +6489,54 @@ Node: Media6344
Node: Methods9265
Node: Drives11851
Node: Extras15803
Node: Processing20515
Node: Dialog24352
Node: Commands26041
Node: ArgSort27718
Node: AqDrive29212
Node: Loading36369
Node: Insert59667
Node: SetInsert71862
Node: Manip82036
Node: CmdFind92146
Node: Filter112170
Node: Writing116792
Node: SetWrite129286
Node: Bootable160561
Node: Jigdo191843
Node: Charset196846
Node: Exception200175
Node: DialogCtl206304
Node: Inquiry208906
Node: Navigate221439
Node: Verify230146
Node: Restore241295
Node: Emulation253502
Node: Scripting263958
Node: Frontend271741
Node: Examples281367
Node: ExDevices282545
Node: ExCreate283206
Node: ExDialog284506
Node: ExGrowing285777
Node: ExModifying286586
Node: ExBootable287096
Node: ExCharset287651
Node: ExPseudo288547
Node: ExCdrecord289474
Node: ExMkisofs289794
Node: ExGrowisofs291691
Node: ExException292844
Node: ExTime293302
Node: ExIncBackup293760
Node: ExRestore297786
Node: ExRecovery298732
Node: Files299304
Node: Environ300638
Node: Seealso301386
Node: Bugreport302103
Node: Legal302694
Node: CommandIdx303706
Node: ConceptIdx321677
Node: Processing21108
Node: Dialog24945
Node: Commands26634
Node: ArgSort28311
Node: AqDrive29805
Node: Loading36962
Node: Insert62966
Node: SetInsert75161
Node: Manip85335
Node: CmdFind96644
Node: Filter117447
Node: Writing122069
Node: SetWrite134563
Node: Bootable165838
Node: Jigdo197120
Node: Charset202123
Node: Exception205452
Node: DialogCtl211581
Node: Inquiry214183
Node: Navigate226716
Node: Verify235871
Node: Restore247020
Node: Emulation259227
Node: Scripting269683
Node: Frontend277466
Node: Examples287092
Node: ExDevices288270
Node: ExCreate288931
Node: ExDialog290231
Node: ExGrowing291502
Node: ExModifying292311
Node: ExBootable292821
Node: ExCharset293376
Node: ExPseudo294272
Node: ExCdrecord295199
Node: ExMkisofs295519
Node: ExGrowisofs297416
Node: ExException298569
Node: ExTime299027
Node: ExIncBackup299485
Node: ExRestore303511
Node: ExRecovery304457
Node: Files305029
Node: Environ306363
Node: Seealso307111
Node: Bugreport307875
Node: Legal308466
Node: CommandIdx309478
Node: ConceptIdx327807

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, Jun 29, 2024"
@c man .TH XORRISO 1 "Version 1.5.7, Jul 20, 2024"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -641,6 +641,19 @@ or to print them.
@*
Recording and restoring of xattr from and to local files works currently
only on GNU/Linux and FreeBSD, where they are known as extattr.
@c man .PP
@sp 1
@cindex Linux file attributes, _definition
@strong{Linux file attributes} are binary flags which can be set by program
chattr(1) and listed by program lsattr(1). See their man pages and the
definitions FS_*_FL in Linux header file <linux/fs.h>.
Not all defined flags get reported by lsattr and accepted by chattr, but their
number grew over the years.
@*
@command{xorriso} records the flags of disk files if enabled by command
@strong{-lfa_flags}. Its command -lsattr lists 22 flags the same way as the
program lsattr does. They can be set by xorriso command -chattr and can be
enabled by -lfa_flags for restoring when their files get restored to disk.
@c man .SS
@node Processing, Dialog, Extras, Top
@chapter Command processing
@ -1291,6 +1304,57 @@ write the attributes.
Note that it is not possible to set xattr of namespace "isofs." by xorriso
xattr manipulation commands.
@c man .TP
@item -lfa_flags mode[:mode...]
@kindex -lfa_flags controls handling of Linux file attributes
@cindex Linux file attributes, control handling, -lfa_flags
Enable, disable, or influence processing of Linux file attributes as described
in man 1 chattr.
@*
Mode "on" enables actual processing of the attributes. Mode "off" disables it.
The other modes define the behavior in case of "on".
@*
Mode "read" enables obtaining of these attributes from disk files,
storing them in the emerging ISO 9660 filesystem as AAIP data, importing
them when an ISO filesystem gets loaded and bears such stored attributes,
and comparing them during comparisons between files on disk and in ISO.
@*
Mode "no_read" disables processing of the attributes from disk files. If no
other settings like -acl "on" or -xattr "on" require storing and importing
of AAIP data, then previously recorded file attributes can get kept out of
the next appended session.
@*
Mode "restore" enables restoring of attributes when their file gets restored
and comparing them during comparisons between files on disk and in ISO.
Several modes below modify the behavior during restoring of attributes.
@*
Mode "no_restore" disables restoring of attributes.
@*
Mode "restore_su" enables restoring of the attributes "iaj" which are only
changeable by the bearer of superuser capabilities. "no_restore_su" disables
restoring of these attributes. "restore_su_auto" enables it only if the
effective user id is 0.
@*
Mode "restore_only_known" restricts restoring to the known settable attribute
flags "aAcCdDFijmPsStTux". "restore_unknown" enables the attempt to restore
unknown flags or even those which are known to be unchangeable, if they are
not disabled by other modes.
@*
Mode "restore_mask=..." enables particular attributes for restoring. All others
will not be restored. The list of desired attribute letters follows the '='
character. An empty list enables all attributes, if they are not disabled by
other modes. The single character "-" bans all attributes from restoring,
like "off" does. Example:
@*
-lfa_flags restore_mask=SdCiaj
@*
Mode "default" reinstates the default settings:
@*
-lfa_flags off:read:restore:restore_su_auto:restore_only_known
@*
-lfa_flags restore_mask=
@*
Use "default:on" to get default settings with enabled processing.
@c man .TP
@item -md5 "on"|"all"|"off"|"load_check_off"
@kindex -md5 controls handling of MD5 sums
@cindex MD5, control handling, -md5
@ -1330,22 +1394,29 @@ Checksums can be exploited via commands -check_md5, -check_md5_r, via find
actions get_md5, check_md5, and via -check_media.
@c man .TP
@item -for_backup
@kindex -for_backup -acl,-xattr,-hardlinks,-md5
@kindex -for_backup acl,xattr,hardlinks,md5,lfa_flags
@cindex Backup, enable features, -for_backup
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
-hardlinks on -acl on -xattr any -md5 on
-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 privileges to record or restore
such attributes. At recording time, xorriso will try to tolerate missing
privileges and just record what is readable.
But at restore time, missing privileges will cause failure events.
But at restore time, missing privileges or preconditions will cause failure
events.
@*
Command -xattr "user" after command -for_backup excludes non-user attributes
from being recorded or restored.
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.
@c man .TP
@item -ecma119_map "stripped"|"unmapped"|"lowercase"|"uppercase"
@kindex -ecma119_map names w/o Rock Ridge, Joliet
@ -2250,7 +2321,7 @@ This indicates that the entry goes to the "default" ACL rather than to the
@item -setfacl_r acl_text iso_rr_path [***]
@kindex -setfacl_r sets ACL in ISO image
@cindex ACL, set in ISO image, -setfacl_r
Like -setfacl but affecting all files below eventual directories.
Like -setfacl but affecting all files below given directories.
@c man .TP
@item -setfacl_list disk_path
@kindex -setfacl_list sets ACL in ISO image
@ -2287,7 +2358,7 @@ the byte value 0 cannot be expressed via -setfattr.
@item -setfattr_r [-]name value iso_rr_path [***]
@kindex -setfattr_r sets xattr in ISO image
@cindex xattr, set in ISO image, -setfattr_r
Like -setfattr but affecting all files below eventual directories.
Like -setfattr but affecting all files below given directories.
@c man .TP
@item -setfattr_list disk_path
@kindex -setfattr_list sets xattr in ISO image
@ -2315,6 +2386,38 @@ whitespace after the end quote will be ignored. Non-printables bytes and quotes
must be represented as \XYZ by their octal 8-bit code XYZ.
Use code \000 for 0-bytes.
@c man .TP
@item -chattr mode iso_rr_path [***]
@kindex -chattr sets Linux file attributes in ISO image
@cindex Linux file attributes, set in ISO image, -chattr
Set or unset Linux file attributes like program chattr(1) would do to disk
files.
@*
The first letter of the mode string determines what to do. The other letters
are symbolic attribute flag letters out of the set "aAcCdDeEFhiIjNmPsStTuVxZ"
as described in man 1 chattr.
There is no restriction which attributes can be set or unset. But at restore
time, unusual or unsuitable attributes may cause problems.
@*
First letter '+' causes the given attribute flags to be set. All other
attributes stay as they are.
@*
First letter '-' causes the given attribute flags to be unset. All other
attributes stay as they are. (Note that '-' is also accepted as symbolic
attribute letter which has no effect.)
@*
First letter '.' causes all attribute flags except the given ones to be unset.
The given ones stay as they are. This is not a feature of program chattr(1).
@*
First letter '=' causes the given attribute flags to be set. All other
get unset.
@*
Example: -chattr +sDu /my/file /my/other_file --
@c man .TP
@item -chattr_r mode iso_rr_path [***]
@kindex -chattr_r sets Linux file attributes in ISO image
@cindex Linux file attributes, set in ISO image, -chattr_r
Like -chattr but affecting all files below given directories.
@c man .TP
@item -alter_date type timestring iso_rr_path [***]
@kindex -alter_date sets timestamps in ISO image
@cindex Timestamps, set in ISO image, -alter_date
@ -2519,6 +2622,16 @@ Matches files which have xattr name-value pairs from user namespace.
@item -has_aaip :
Matches files which have ACL or any xattr.
@*
@item -has_lfa_flags flag_letters :
Matches files which have Linux file attributes attached and have all flags set
which correspond to the characters in the string flag_letters. The characters
may be zero or more out of the set "aAcCdDeEFhiIjNmPsStTuVxZ".
The character '-' will be ignored. The flag_letters string "-" matches any
attribute set, but not a file with no Linux file attributes attached.
E.g. look for files with both flags 'i' (immutable) and 'd' (no dump) set:
@*
-has_lfa_flags di
@*
@item -has_any_xattr :
Matches files which have any xattr other than ACL.
@*
@ -2767,10 +2880,18 @@ terminal-safe but should work in script files.
Mode "r" uses no quotation marks. Not safe.
Mode "b" prints backslash encoding. Not suitable for shell parsing.
@*
E.g. -exec list_extattr e --
E.g.: -exec list_extattr e --
@*
Command -backslash_codes does not affect the output.
@*
@item lsattrd
shows the Linux file attribute flags like command -lsattrd does.
@*
@item chattr
applies -chattr with the given mode.
@*
E.g.: -exec chattr +sDu --
@*
@item get_md5
prints the MD5 sum, if recorded, together with file path.
@*
@ -5605,6 +5726,17 @@ namespace "user", "any" only omits namespace "isofs".
Like -gefattr but listing recursively the whole file trees underneath of
directories.
@c man .TP
@item -lsattr iso_rr_pattern [***]
@kindex -lsattr shows Linux file attributes in ISO image
@cindex Linux file attributes, show in ISO image, -lsattr
Print the Linux file attributes of the given files like program lsattr(1)
would do with disk files. The meaning of the shown flag letters are described
in man 1 chattr with the exception of '-', which is shown as placeholder for
an unset flag.
@*
The given files will get a line printed even if they have no Linux file
attributes attached. In this case all flags will be shown as '-'.
@c man .TP
@item -du iso_rr_pattern [***]
@kindex -du show directory size in ISO image
@cindex Navigate, directory size in ISO image, -du
@ -7813,11 +7945,13 @@ Startup files and program options can override the effect of SOURCE_DATE_EPOCH.
@c man .BR wodim(1),
@c man .BR cdrskin(1)
@c man .TP
@c man ACL and xattr
@c man ACL, xattr, Linux file attributes
@c man .BR getfacl(1),
@c man .BR setfacl(1),
@c man .BR getfattr(1),
@c man .BR setfattr(1)
@c man .BR setfattr(1),
@c man .BR lsattr(1),
@c man .BR chattr(1)
@c man .TP
@c man MD5 checksums
@c man .BR md5sum(1)
@ -7846,11 +7980,13 @@ growisofs(1),
cdrecord(1),
wodim(1),
cdrskin(1)
@item ACL and xattr
@item ACL, xattr, Linux file attributes
getfacl(1),
setfacl(1),
getfattr(1),
setfattr(1)
setfattr(1),
lsattr(1),
chattr(1)
@item MD5 checksums
md5sum(1)
@item On FreeBSD some commands differ:

View File

@ -173,6 +173,25 @@ struct XorrisO { /* the global context of xorriso */
namespaces, not only "user."
if bit3: export to local filesystem all xattr
namespaces, not only "user."
bit11= read lfa_flags (chattr) from local file objects and
write them into the ISO filesystem
bit12= restore lfa_flags when restoring file
bit13= do not restore known superuser lfa_flags
bit14= restore only known lfa_flags
*/
int lfa_flags_setting; /* Current settings of command -lfa_flags
bit0= on
bit1= auto_su
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
to 0.
*/
int lfa_flags_default; /* Default for lfa_flags_setting */
uint64_t lfa_restore_mask; /* At most the flag bits which are set here will
be restored when a file gets restored to disk
*/
int do_md5; /* bit0= read MD5 array

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.07.17.194323"
#define Xorriso_timestamP "2024.07.20.211130"

View File

@ -692,6 +692,21 @@ int Xorriso_warn_if_not_exist(struct XorrisO *xorriso, char *prefix,
int Xorriso_warn_if_not_bootcat(struct XorrisO *xorriso, char *prefix,
char *purpose, char *path, int flag);
int Xorriso_decode_lfa_flags(struct XorrisO *xorriso, char *flags_text,
uint64_t *lfa_flags, int flag);
int Xorriso_encode_lfa_flags(struct XorrisO *xorriso, uint64_t lfa_flags,
char **flags_text, int flag);
int Xorriso_decode_chattr_arg(struct XorrisO *xorriso, char *lfa_text,
uint64_t *lfa_flags, int *operator, int flag);
int Xorriso_get_lfa_flags(struct XorrisO *xorriso, void *node, char *path,
uint64_t *lfa_flags, int *max_bit, int flag);
int Xorriso_set_lfa_flags(struct XorrisO *xorriso, void *in_node, char *path,
char *lfa_text, uint64_t lfa_flags, int operator,
int flag);
#endif /* Xorrisoburn_includeD */