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

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

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);