Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP4:Update
pacemaker.26756
bsc#1198409-0002-Fix-tools-prevent-possible-crm...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc#1198409-0002-Fix-tools-prevent-possible-crm_resource-segfaults-if.patch of Package pacemaker.26756
From a1c3b2ea6c54ac18635fa5c5d5e5d95f580bb067 Mon Sep 17 00:00:00 2001 From: "Gao,Yan" <ygao@suse.com> Date: Thu, 14 Apr 2022 12:23:20 +0200 Subject: [PATCH 2/3] Fix: tools: prevent possible crm_resource segfaults if multiple commands are specified The argument callbacks assume they have the originally initialized options and update the values accordingly. While we still accept multiple commands for backward compatibility, the relevant options should be reset whenever an existing command is overridden. Otherwise the options would result into havoc and possibly cause segfaults of problematically composed commands such as `crm_resource -l -a`. --- tools/crm_resource.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/crm_resource.c b/tools/crm_resource.c index 8b050a8b5..d2ea9ff24 100644 --- a/tools/crm_resource.c +++ b/tools/crm_resource.c @@ -132,7 +132,12 @@ struct { options.rsc_cmd = (cmd); \ } while (0) #else -#define SET_COMMAND(cmd) do { options.rsc_cmd = (cmd); } while (0) +#define SET_COMMAND(cmd) do { \ + if (options.rsc_cmd != cmd_none) { \ + reset_options(); \ + } \ + options.rsc_cmd = (cmd); \ + } while (0) #endif gboolean agent_provider_cb(const gchar *option_name, const gchar *optarg, gpointer data, GError **error); @@ -626,6 +631,18 @@ static GOptionEntry addl_entries[] = { { NULL } }; +static void +reset_options(void) { + options.require_crmd = FALSE; + options.require_node = FALSE; + + options.require_cib = TRUE, + options.require_dataset = TRUE, + options.require_resource = TRUE, + + options.find_flags = 0; +} + gboolean agent_provider_cb(const gchar *option_name, const gchar *optarg, gpointer data, GError **error) { options.cmdline_config = TRUE; -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor