|
|
|
@ -2647,15 +2647,16 @@ return:
|
|
|
|
|
3 = immediate decision : does match
|
|
|
|
|
*/
|
|
|
|
|
{
|
|
|
|
|
int value=0, ret, start_lba, end_lba;
|
|
|
|
|
int value=0, ret, start_lba, end_lba, bless_idx;
|
|
|
|
|
int lba_count, *file_end_lbas= NULL, *file_start_lbas= NULL, i, mask;
|
|
|
|
|
void *arg1, *arg2;
|
|
|
|
|
char ft, *decision, md5[16];
|
|
|
|
|
char ft, *decision, md5[16], bless_code[17];
|
|
|
|
|
regmatch_t name_match;
|
|
|
|
|
off_t damage_start, damage_end, size;
|
|
|
|
|
void *xinfo_dummy;
|
|
|
|
|
IsoNode *node;
|
|
|
|
|
IsoStream *stream;
|
|
|
|
|
struct iso_hfsplus_xinfo_data *hfsplus_xinfo;
|
|
|
|
|
|
|
|
|
|
if(ftest == NULL)
|
|
|
|
|
return(1);
|
|
|
|
@ -2835,6 +2836,32 @@ return:
|
|
|
|
|
if((!!(mask & 3)) ^ (!!(ret & LIBISO_HIDE_ON_HFSPLUS)))
|
|
|
|
|
value= 0;
|
|
|
|
|
|
|
|
|
|
break; case 18: /* -has_hfs_crtp char *creator char *type */
|
|
|
|
|
ret= iso_node_get_xinfo(node, iso_hfsplus_xinfo_func,
|
|
|
|
|
(void **) &hfsplus_xinfo);
|
|
|
|
|
value= 0;
|
|
|
|
|
if(ret < 0) {
|
|
|
|
|
Xorriso_process_msg_queues(xorriso, 0);
|
|
|
|
|
ret= 0;
|
|
|
|
|
} else if(ret == 1) {
|
|
|
|
|
if((strlen(arg1) == 1 ||
|
|
|
|
|
(strncmp(arg1, (char *) hfsplus_xinfo->creator_code, 4) == 0 &&
|
|
|
|
|
strlen(arg1) == 4)) &&
|
|
|
|
|
(strlen(arg2) == 1 ||
|
|
|
|
|
(strncmp(arg2, (char *) hfsplus_xinfo->type_code, 4) == 0 &&
|
|
|
|
|
strlen(arg2) == 4)))
|
|
|
|
|
value= 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break; case 19: /* -has_hfs_bless int bless_index */
|
|
|
|
|
value= 0;
|
|
|
|
|
ret= Xorriso_get_blessing(xorriso, node, &bless_idx, bless_code, 0);
|
|
|
|
|
if (ret > 0) {
|
|
|
|
|
if(*((int *) arg1) == (int) ISO_HFSPLUS_BLESS_MAX ||
|
|
|
|
|
*((int *) arg1) == bless_idx)
|
|
|
|
|
value= 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break; default:
|
|
|
|
|
|
|
|
|
|
/* >>> complain about unknown test type */;
|
|
|
|
@ -3516,6 +3543,7 @@ set_error:;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* @param flag bit0= only check creator and hfs_type for compliance.
|
|
|
|
|
bit1= with bit0: check for search rather than for setting
|
|
|
|
|
*/
|
|
|
|
|
int Xorriso_hfsplus_file_creator_type(struct XorrisO *xorriso, char *path,
|
|
|
|
|
void *in_node,
|
|
|
|
@ -3533,6 +3561,15 @@ int Xorriso_hfsplus_file_creator_type(struct XorrisO *xorriso, char *path,
|
|
|
|
|
node= (IsoNode *) in_node;
|
|
|
|
|
if((creator[0] == 0 && hfs_type[0] == 0) ||
|
|
|
|
|
strcmp(creator, "--delete") == 0) {
|
|
|
|
|
if(flag & 2) {
|
|
|
|
|
strcpy(xorriso->info_text,
|
|
|
|
|
"HFS+ file creator code for deletion shall be used for searching");
|
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
|
|
|
|
strcpy(xorriso->info_text,
|
|
|
|
|
"Suitable are strings of length 4 or length 1");
|
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
if(flag & 1)
|
|
|
|
|
return(1);
|
|
|
|
|
ret= iso_node_remove_xinfo(node, iso_hfsplus_xinfo_func);
|
|
|
|
@ -3544,11 +3581,19 @@ int Xorriso_hfsplus_file_creator_type(struct XorrisO *xorriso, char *path,
|
|
|
|
|
goto failure;
|
|
|
|
|
}
|
|
|
|
|
return(1);
|
|
|
|
|
} else if(strlen(creator) != 4 || strlen(hfs_type) != 4) {
|
|
|
|
|
strcat(xorriso->info_text,
|
|
|
|
|
} else if((strlen(creator) != 4 && !(strlen(creator) == 1 &&
|
|
|
|
|
(flag & 3) == 3)) ||
|
|
|
|
|
(strlen(hfs_type) != 4 && !(strlen(hfs_type) == 1 &&
|
|
|
|
|
(flag & 3) == 3))) {
|
|
|
|
|
if(flag & 2) {
|
|
|
|
|
strcpy(xorriso->info_text,
|
|
|
|
|
"HFS+ file creator code or type code for searching are not exactly 1 or 4 characters long");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(xorriso->info_text,
|
|
|
|
|
"HFS+ file creator code or type code are not exactly 4 characters long");
|
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
if(flag & 1)
|
|
|
|
|
return(1);
|
|
|
|
@ -3599,7 +3644,8 @@ failure:
|
|
|
|
|
bit1= Revoke any blessing of the node, regardless of parameter
|
|
|
|
|
blessing. If node is NULL, then revoke all blessings in opts.
|
|
|
|
|
bit2= Only check parameter blessing.
|
|
|
|
|
Return 1 instead of issueing the blessing.
|
|
|
|
|
Return blessing index + 1 instead of issueing the blessing.
|
|
|
|
|
bit3= Allow blessing "any" and map to index ISO_HFSPLUS_BLESS_MAX
|
|
|
|
|
*/
|
|
|
|
|
int Xorriso_hfsplus_bless(struct XorrisO *xorriso, char *path,
|
|
|
|
|
void *in_node, char *blessing, int flag)
|
|
|
|
@ -3609,16 +3655,6 @@ int Xorriso_hfsplus_bless(struct XorrisO *xorriso, char *path,
|
|
|
|
|
IsoImage *volume= NULL;
|
|
|
|
|
enum IsoHfsplusBlessings bless_code = ISO_HFSPLUS_BLESS_MAX; /* = invalid */
|
|
|
|
|
|
|
|
|
|
if(in_node == NULL && path[0]) {
|
|
|
|
|
ret= Xorriso_node_from_path(xorriso, NULL, path, &node, 0);
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
return(ret);
|
|
|
|
|
} else
|
|
|
|
|
node= (IsoNode *) in_node;
|
|
|
|
|
ret= Xorriso_get_volume(xorriso, &volume, 0);
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
return(ret);
|
|
|
|
|
|
|
|
|
|
if(strcmp(blessing, "ppc_bootdir") == 0 ||
|
|
|
|
|
strcmp(blessing, "p") == 0 || strcmp(blessing, "P") == 0)
|
|
|
|
|
bless_code= ISO_HFSPLUS_BLESS_PPC_BOOTDIR;
|
|
|
|
@ -3634,15 +3670,28 @@ int Xorriso_hfsplus_bless(struct XorrisO *xorriso, char *path,
|
|
|
|
|
else if(strcmp(blessing, "osx_folder") == 0 ||
|
|
|
|
|
strcmp(blessing, "x") == 0 || strcmp(blessing, "X") == 0)
|
|
|
|
|
bless_code= ISO_HFSPLUS_BLESS_OSX_FOLDER;
|
|
|
|
|
else if((flag & 8) && (flag & 4) &&
|
|
|
|
|
(strcmp(blessing, "any") == 0 ||
|
|
|
|
|
strcmp(blessing, "a") == 0 || strcmp(blessing, "A") == 0))
|
|
|
|
|
bless_code= ISO_HFSPLUS_BLESS_MAX;
|
|
|
|
|
else {
|
|
|
|
|
sprintf(xorriso->info_text, "Unknown blessing type ");
|
|
|
|
|
Text_shellsafe(blessing, xorriso->info_text, 1);
|
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(flag & 4)
|
|
|
|
|
return(1);
|
|
|
|
|
return(1 + bless_code);
|
|
|
|
|
|
|
|
|
|
if(in_node == NULL && path[0]) {
|
|
|
|
|
ret= Xorriso_node_from_path(xorriso, NULL, path, &node, 0);
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
return(ret);
|
|
|
|
|
} else
|
|
|
|
|
node= (IsoNode *) in_node;
|
|
|
|
|
ret= Xorriso_get_volume(xorriso, &volume, 0);
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
return(ret);
|
|
|
|
|
|
|
|
|
|
ret= iso_image_hfsplus_bless(volume, bless_code, node, flag & 3);
|
|
|
|
|
Xorriso_process_msg_queues(xorriso, 0);
|
|
|
|
@ -3705,6 +3754,7 @@ int Xorriso_get_blessing(struct XorrisO *xorriso, IsoNode *node,
|
|
|
|
|
break; default:
|
|
|
|
|
strcpy(bless_code, "unknown_blessing");
|
|
|
|
|
}
|
|
|
|
|
*bless_idx= i;
|
|
|
|
|
return(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|