HomeClusterLabs Projects

Fix: tools: Fix crm_mon seg fault when curses is missing

Description

Fix: tools: Fix crm_mon seg fault when curses is missing

If Pacemaker is built without curses, crm_mon in console mode exits
immediately with a segmentation fault. There's no problem in one-shot
mode.

Early in main(), we fail to initialize the "console"-format
pcmk__output_t object. In clean_up(), we call out->finish() without
NULL-checking the output object.

We fix the issue as follows:

  • Add a NULL-check for the output object
  • Default to one-shot text mode if not CURSES_ENABLED. This was the original behavior, probably until 91112458.
  • Consolidate that cases where we fall back from "console" to "text".
  • Update the description (in build_arg_context()) to note that Pacemaker was built without curses, if appropriate.

Fixes CLBZ#5512

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Mar 28 2023, 4:12 PM
Parents
rP3d2ff3584f96: Refactor: tools: Don't ignore invalid format in reconcile_output_formats
Branches
Unknown
Tags
Unknown