File pacemaker-crm_mon-CGI-bail-out-properly.patch of Package pacemaker.14737
commit 1c080fb873ad54a795f414bcd9ef63e268295b31
Author: Jan Pokorný <jpokorny@redhat.com>
Date: Fri Jul 14 16:09:35 2017 +0200
Low: crm_mon: make CGI bail out properly and w/o help screen
diff --git a/tools/crm_mon.c b/tools/crm_mon.c
index e5a0b406c..9b8a83a4c 100644
--- a/tools/crm_mon.c
+++ b/tools/crm_mon.c
@@ -702,7 +702,13 @@ main(int argc, char **argv)
printf("%s ", argv[optind++]);
printf("\n");
}
+
if (argerr) {
+ if (output_format == mon_output_cgi) {
+ fprintf(stdout, "Content-Type: text/plain\n"
+ "Status: 500\n\n");
+ return EX_USAGE;
+ }
return crm_help('?', EX_USAGE);
}