Enabled for -findx: tests -has_lfa_flags and -has_some_lfa_flags_of, action lsattrd

This commit is contained in:
2024-08-27 18:08:59 +02:00
parent 416e367d38
commit 51154520d8
7 changed files with 143 additions and 62 deletions

View File

@ -1155,14 +1155,14 @@ ex:;
int Xorriso_findx_action(struct XorrisO *xorriso, struct FindjoB *job,
char *abs_path, char *show_path, int depth, int flag)
{
int ret= 0, type, action= 0, dpl= 0, compare_result, uret;
int ret= 0, type, action= 0, dpl= 0, compare_result, uret, max_bit;
uid_t user= 0;
gid_t group= 0;
time_t date= 0;
mode_t mode_or= 0, mode_and= ~1;
uint64_t chattr_flags;
uint64_t chattr_flags, lfa_flags;
char *target, *text_2, *wdi_mem= NULL, *disk_prefix, *iso_path= NULL;
char *basename;
char *basename, *lfa_text= NULL;
struct FindjoB *subjob;
struct stat stbuf;
@ -1262,6 +1262,26 @@ int Xorriso_findx_action(struct XorrisO *xorriso, struct FindjoB *job,
stbuf.st_size, 0);
} else if(action == 44) { /* list_extattr */
ret= Xorriso_list_extattr(xorriso, NULL, abs_path, show_path, target, 2);
} else if(action == 60) { /* lsattrd */
ret= Xorriso_get_lfa_flags(xorriso, NULL, show_path, &lfa_flags, &max_bit,
2);
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 {
Xorriso_esc_filepath(xorriso,show_path, xorriso->result_line, 0);
strcat(xorriso->result_line, "\n");