|
|
|
@ -452,19 +452,24 @@ int Xorriso_option_unregister_filter(struct XorrisO *xorriso, char *name,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Option -report_about */
|
|
|
|
|
int Xorriso_option_report_about(struct XorrisO *xorriso, char *severity,
|
|
|
|
|
int Xorriso_option_report_about(struct XorrisO *xorriso, char *in_severity,
|
|
|
|
|
int flag)
|
|
|
|
|
{
|
|
|
|
|
int ret, sev;
|
|
|
|
|
char severity[20], *official;
|
|
|
|
|
|
|
|
|
|
Xorriso__to_upper(in_severity, severity, (int) sizeof(severity), 0);
|
|
|
|
|
ret= Xorriso__text_to_sev(severity, &sev, 0);
|
|
|
|
|
if(ret<=0) {
|
|
|
|
|
sprintf(xorriso->info_text, "-report_about: Not a known severity name : ");
|
|
|
|
|
Text_shellsafe(severity, xorriso->info_text, 1);
|
|
|
|
|
Text_shellsafe(in_severity, xorriso->info_text, 1);
|
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
|
|
|
|
|
return(ret);
|
|
|
|
|
}
|
|
|
|
|
if(Sfile_str(xorriso->report_about_text,severity,0)<=0)
|
|
|
|
|
ret= Xorriso__sev_to_text(sev, &official, 0);
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
official= severity;
|
|
|
|
|
if(Sfile_str(xorriso->report_about_text, official, 0) <= 0)
|
|
|
|
|
return(-1);
|
|
|
|
|
xorriso->report_about_severity= sev;
|
|
|
|
|
return(1);
|
|
|
|
@ -472,26 +477,31 @@ int Xorriso_option_report_about(struct XorrisO *xorriso, char *severity,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Option -return_with */
|
|
|
|
|
int Xorriso_option_return_with(struct XorrisO *xorriso, char *severity,
|
|
|
|
|
int Xorriso_option_return_with(struct XorrisO *xorriso, char *in_severity,
|
|
|
|
|
int exit_value, int flag)
|
|
|
|
|
{
|
|
|
|
|
int ret, sev;
|
|
|
|
|
char severity[20], *official;
|
|
|
|
|
|
|
|
|
|
Xorriso__to_upper(in_severity, severity, (int) sizeof(severity), 0);
|
|
|
|
|
ret= Xorriso__text_to_sev(severity, &sev, 0);
|
|
|
|
|
if(ret<=0) {
|
|
|
|
|
sprintf(xorriso->info_text,
|
|
|
|
|
"-return_with: Not a known severity name : ");
|
|
|
|
|
Text_shellsafe(severity, xorriso->info_text, 1);
|
|
|
|
|
Text_shellsafe(in_severity, xorriso->info_text, 1);
|
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
|
|
|
|
return(ret);
|
|
|
|
|
}
|
|
|
|
|
ret= Xorriso__sev_to_text(sev, &official, 0);
|
|
|
|
|
if(ret <= 0)
|
|
|
|
|
official= severity;
|
|
|
|
|
if(exit_value && (exit_value < 32 || exit_value > 63)) {
|
|
|
|
|
sprintf(xorriso->info_text,
|
|
|
|
|
"-return_with: Not an allowed exit_value. Use 0, or 32 to 63.");
|
|
|
|
|
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
|
|
|
|
return(0);
|
|
|
|
|
}
|
|
|
|
|
if(Sfile_str(xorriso->return_with_text,severity,0)<=0)
|
|
|
|
|
if(Sfile_str(xorriso->return_with_text, official, 0) <= 0)
|
|
|
|
|
return(-1);
|
|
|
|
|
xorriso->return_with_severity= sev;
|
|
|
|
|
xorriso->return_with_value= exit_value;
|
|
|
|
|