New -lfa_flags mode restore_error=
This commit is contained in:
@ -307,12 +307,18 @@ int Xorriso_report_chattr_outcome(struct XorrisO *xorriso, char *disk_path,
|
||||
uint64_t lfa_flags, uint64_t lfa_mask,
|
||||
int iso_ret, int os_errno, int flag)
|
||||
{
|
||||
int ret;
|
||||
char msg[101], *lfa_text= NULL;
|
||||
int ret, eps_ret, sev;
|
||||
char msg[101], *lfa_text= NULL, severity[20];
|
||||
|
||||
if(iso_ret == 1)
|
||||
{ret= 1; goto ex;}
|
||||
|
||||
if(strcmp(xorriso->lfa_restore_err_sev, "silent") == 0 ||
|
||||
strcmp(xorriso->lfa_restore_err_sev, "all") == 0)
|
||||
{ret= 2; goto ex;}
|
||||
Xorriso__to_upper(xorriso->lfa_restore_err_sev, severity, sizeof(severity),
|
||||
0);
|
||||
|
||||
ret= iso_util_encode_lfa_flags(lfa_flags & lfa_mask, &lfa_text, 0);
|
||||
if(lfa_text == NULL)
|
||||
lfa_text= strdup("-unknown-attributes-");
|
||||
@ -321,8 +327,14 @@ int Xorriso_report_chattr_outcome(struct XorrisO *xorriso, char *disk_path,
|
||||
if(lfa_text != NULL)
|
||||
strcat(msg, lfa_text);
|
||||
strcat(msg, "'");
|
||||
|
||||
/* Adjust severity to event_pt.
|
||||
Number 0x7f000000 comes from libisofs.h, iso_error_get_severity */
|
||||
Xorriso__text_to_sev(severity, &sev, 0);
|
||||
iso_ret&= ~0x7f000000;
|
||||
iso_ret|= sev;
|
||||
Xorriso_report_iso_error(xorriso, disk_path, iso_ret, msg, os_errno,
|
||||
"FAILURE", 2);
|
||||
severity, 2);
|
||||
ret= 0; goto ex;
|
||||
} else if(iso_ret == 2) {
|
||||
sprintf(xorriso->info_text,
|
||||
@ -337,9 +349,14 @@ int Xorriso_report_chattr_outcome(struct XorrisO *xorriso, char *disk_path,
|
||||
iso_ret, lfa_text);
|
||||
}
|
||||
Text_shellsafe(disk_path, xorriso->info_text, 1);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, severity, 0);
|
||||
ret= 0;
|
||||
ex:;
|
||||
if(ret == 0) {
|
||||
eps_ret= Xorriso_eval_problem_status(xorriso, 0, 1);
|
||||
if(eps_ret >= 0)
|
||||
ret= 2;
|
||||
}
|
||||
if(lfa_text != NULL)
|
||||
free(lfa_text);
|
||||
return(ret);
|
||||
@ -367,7 +384,7 @@ int Xorriso_set_local_chattr_i(struct XorrisO *xorriso, char *disk_path,
|
||||
if(lfa_i == 0xffffffff)
|
||||
lfa_i= Xorriso__lfa_bits("i");
|
||||
|
||||
ret= iso_local_set_lfa_flags(disk_path, lfa_i, max_bit, lfa_i, &os_errno, 0);
|
||||
ret= iso_local_set_lfa_flags(disk_path, lfa_i, max_bit, lfa_i, &os_errno, 4);
|
||||
ret= Xorriso_report_chattr_outcome(xorriso, disk_path, lfa_i, lfa_i,
|
||||
ret, os_errno, 0);
|
||||
if(ret <= 0)
|
||||
@ -443,7 +460,7 @@ int Xorriso_early_chattr_CF(struct XorrisO *xorriso, IsoNode *node,
|
||||
if(set_mask == 0)
|
||||
return(4);
|
||||
ret= iso_local_set_lfa_flags(disk_path, lfa_flags, max_bit, set_mask,
|
||||
os_errno, 0);
|
||||
os_errno, 4);
|
||||
ret= Xorriso_report_chattr_outcome(xorriso, disk_path, lfa_flags, set_mask,
|
||||
ret, *os_errno, 0);
|
||||
if(ret <= 0)
|
||||
@ -652,10 +669,7 @@ cannot_set_perm:;
|
||||
if(xorriso->do_aaip & (1 << 12)) {
|
||||
if(mask != 0) {
|
||||
ret= iso_local_set_lfa_flags(disk_path, lfa_flags, max_bit, mask,
|
||||
&os_errno, 0);
|
||||
|
||||
/* >>> Need adjustable graceful error handling */;
|
||||
|
||||
&os_errno, 4);
|
||||
ret= Xorriso_report_chattr_outcome(xorriso, disk_path, lfa_flags,
|
||||
mask, ret, os_errno, 0);
|
||||
if(ret <= 0)
|
||||
@ -1672,9 +1686,12 @@ int Xorriso_restore_disk_object(struct XorrisO *xorriso,
|
||||
if(ret == 2)
|
||||
{ret= 3; goto ex;}
|
||||
}
|
||||
if(first_part_node != NULL && !no_props)
|
||||
Xorriso_restore_properties(xorriso, disk_path, first_part_node,
|
||||
!!(flag&64));
|
||||
if(first_part_node != NULL && !no_props) {
|
||||
ret= Xorriso_restore_properties(xorriso, disk_path, first_part_node,
|
||||
!!(flag&64));
|
||||
if(ret <= 0)
|
||||
goto restoring_failed;
|
||||
}
|
||||
goto went_well;
|
||||
}
|
||||
|
||||
@ -2304,8 +2321,10 @@ int Xorriso_restore(struct XorrisO *xorriso,
|
||||
}
|
||||
} else {
|
||||
/* keep rwx for the owner, delay lfa_flags 'i' if present */
|
||||
Xorriso_restore_implicit_properties(xorriso, disk_path, path,
|
||||
img_path, 4);
|
||||
ret= Xorriso_restore_implicit_properties(xorriso, disk_path, path,
|
||||
img_path, 4);
|
||||
if(ret <= 0)
|
||||
goto ex;
|
||||
}
|
||||
new_dir_made= 1;
|
||||
} else if((source_is_dir && !source_is_split)) {
|
||||
@ -2342,7 +2361,12 @@ attach_source:;
|
||||
}
|
||||
if(new_dir_made && !(flag&64)) {
|
||||
/* set timestamps which Permstack_pop() will not set */
|
||||
Xorriso_restore_properties(xorriso, disk_path, node, 2);
|
||||
ret= Xorriso_restore_properties(xorriso, disk_path, node, 2);
|
||||
if(ret <= 0) {
|
||||
hret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2);
|
||||
if(hret < 0)
|
||||
goto ex;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(dir_create || node_count) {
|
||||
|
Reference in New Issue
Block a user