New commands -lfa_flags, -lsattr, -lsattrd, -chattr, -chattr_r, -find test -has_lfa_flags, -find actions lsattrd, chattr
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user