New commands -projid, -get_projid, -get_projid_r, -set_projid, -set_projid_r, -find test -has_projid, -find actions get_projid, set_projid, get_projid_minmax

This commit is contained in:
2024-11-03 20:04:54 +01:00
parent 923bfa0be9
commit 32bfa95973
25 changed files with 1168 additions and 214 deletions

View File

@ -584,6 +584,8 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path,
int *errnos= NULL;
uint64_t lfa_flags= 0, mask= 0, push_mask= 0;
int max_bit, os_errno;
uint32_t projid;
off_t off_t_projid;
static uint64_t lfa_C= 0xffffffff, lfa_i= 0, lfa_a= 0, lfa_F= 0;
if(lfa_C == 0xffffffff) {
@ -770,6 +772,28 @@ cannot_set_perm:;
}
}
if(xorriso->do_aaip & (1 << 17)) {
ret= Xorriso_get_projid(xorriso, node, NULL, &projid, 0);
if(ret < 0)
goto ex;
ret= Numbermapper_map(xorriso->projid_mapper, (off_t) projid, &off_t_projid,
0);
if(ret < 0)
goto ex;
projid= off_t_projid;
if(projid != 0 || (xorriso->do_aaip & (1 << 18))) {
ret= iso_local_set_projid(disk_path, projid, &os_errno, 0);
if(ret < 0) {
Xorriso_process_msg_queues(xorriso, 0);
strcpy(xorriso->info_text,
"Error with setting XFS-style project id for ");
Text_shellsafe(disk_path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
}
}
ret= 1 + !!lfa_ia_pushed;
ex:;
iso_node_get_attrs(node, &num_attrs, &names, &value_lengths, &values,1 << 15);