32e626790c
- Update to version 2.0.5+20201202.ba59be712 (Pacemaker-2.0.5): - xml: Revert to correct schema for alerts-3.5 - tools: match calloc() with free() in crm_resource - tools: "Connectivity is lost" may not be displayed even if the ping communication is lost. - Update to version 2.0.4+20201116.ae2c04b54: - tools: make cibsecret use bash - fencer: allow peer configuration requests - Update to version 2.0.4+20201027.31aa4f551: - pacemakerd: handle shutdown requests better - daemons,libcrmcommon: send status code with client acks - fencer: restrict certain IPC requests to privileged users (CVE-2020-25654, bsc#1177916) - pacemakerd: ignore shutdown requests from unprivileged users (CVE-2020-25654, bsc#1177916) - pacemakerd: check client for NULL before using it - executor: restrict certain IPC requests to Pacemaker daemons (CVE-2020-25654, bsc#1177916) - executor: return appropriate error code when no remote support - executor: mark controller connections to pacemaker-remoted as privileged - executor: show CRM_OP_REGISTER rc in debug message - Update to version 2.0.4+20201022.354625c62: - tools: revert some changes in crm_resource NULL checks - xml: Mark new crm_mon attributes as optional. - scheduler: fix build when DEFAULT_CONCURRENT_FENCING_TRUE is set - Update to version 2.0.4+20201019.878658661: - cib: create reply when needed for diff - cib: only build reply when needed - Update to version 2.0.4+20201014.b0ef36d82: OBS-URL: https://build.opensuse.org/request/show/853533 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=343
101 lines
3.7 KiB
Diff
101 lines
3.7 KiB
Diff
commit 1e01228825eb8d4449edfbb1a1fa0c38fab4d5e6
|
|
Author: Gao,Yan <ygao@suse.com>
|
|
Date: Thu Sep 6 15:14:58 2012 +0800
|
|
|
|
Medium: stonith: Expose IDs of stonith resources to stonith agents through "$CRM_meta_st_device_id" environment variable
|
|
|
|
Index: pacemaker-2.0.4+20201012.0cc17c01e/daemons/fenced/fenced_commands.c
|
|
===================================================================
|
|
--- pacemaker-2.0.4+20201012.0cc17c01e.orig/daemons/fenced/fenced_commands.c
|
|
+++ pacemaker-2.0.4+20201012.0cc17c01e/daemons/fenced/fenced_commands.c
|
|
@@ -931,6 +931,7 @@ build_device_from_xml(xmlNode * msg)
|
|
device->id, device->on_target_actions);
|
|
}
|
|
|
|
+ g_hash_table_insert(device->params, strdup(CRM_META "_" F_STONITH_DEVICE), strdup(device->id));
|
|
device->work = mainloop_add_trigger(G_PRIORITY_HIGH, stonith_device_dispatch, device);
|
|
/* TODO: Hook up priority */
|
|
|
|
Index: pacemaker-2.0.4+20201012.0cc17c01e/lib/fencing/st_client.c
|
|
===================================================================
|
|
--- pacemaker-2.0.4+20201012.0cc17c01e.orig/lib/fencing/st_client.c
|
|
+++ pacemaker-2.0.4+20201012.0cc17c01e/lib/fencing/st_client.c
|
|
@@ -39,6 +39,7 @@ struct stonith_action_s {
|
|
char *action;
|
|
char *victim;
|
|
GHashTable *args;
|
|
+ char *dev_id;
|
|
int timeout;
|
|
int async;
|
|
void *userdata;
|
|
@@ -593,6 +594,7 @@ stonith__destroy_action(stonith_action_t
|
|
}
|
|
free(action->output);
|
|
free(action->error);
|
|
+ free(action->dev_id);
|
|
free(action);
|
|
}
|
|
}
|
|
@@ -664,6 +666,8 @@ stonith_action_create(const char *agent,
|
|
if (device_args) {
|
|
char buffer[512];
|
|
const char *value = NULL;
|
|
+ const char *st_dev_id_key = CRM_META "_" F_STONITH_DEVICE;
|
|
+ const char *st_dev_id_value = NULL;
|
|
|
|
snprintf(buffer, sizeof(buffer), "pcmk_%s_retries", _action);
|
|
value = g_hash_table_lookup(device_args, buffer);
|
|
@@ -671,6 +675,11 @@ stonith_action_create(const char *agent,
|
|
if (value) {
|
|
action->max_retries = atoi(value);
|
|
}
|
|
+
|
|
+ st_dev_id_value = g_hash_table_lookup(device_args, st_dev_id_key);
|
|
+ if (st_dev_id_value) {
|
|
+ action->dev_id = strdup(st_dev_id_value);
|
|
+ }
|
|
}
|
|
|
|
return action;
|
|
@@ -812,6 +821,10 @@ internal_stonith_action_execute(stonith_
|
|
SVC_ACTION_NON_BLOCKED,
|
|
"SVC_ACTION_NON_BLOCKED");
|
|
|
|
+ if (action->dev_id) {
|
|
+ svc_action->rsc = strdup(action->dev_id);
|
|
+ }
|
|
+
|
|
/* keep retries from executing out of control and free previous results */
|
|
if (is_retry) {
|
|
free(action->output);
|
|
Index: pacemaker-2.0.4+20201012.0cc17c01e/lib/services/services_linux.c
|
|
===================================================================
|
|
--- pacemaker-2.0.4+20201012.0cc17c01e.orig/lib/services/services_linux.c
|
|
+++ pacemaker-2.0.4+20201012.0cc17c01e/lib/services/services_linux.c
|
|
@@ -28,6 +28,9 @@
|
|
#include "crm/common/mainloop.h"
|
|
#include "crm/services.h"
|
|
|
|
+#include "crm/stonith-ng.h"
|
|
+#include "crm/fencing/internal.h"
|
|
+
|
|
#include "services_private.h"
|
|
|
|
static void close_pipe(int fildes[]);
|
|
@@ -405,6 +408,15 @@ static void
|
|
add_action_env_vars(const svc_action_t *op)
|
|
{
|
|
void (*env_setter)(gpointer, gpointer, gpointer) = NULL;
|
|
+
|
|
+ if (pcmk__str_eq(op->standard, PCMK_RESOURCE_CLASS_STONITH, pcmk__str_casei)
|
|
+ && pcmk__str_eq(op->agent, "fence_legacy", pcmk__str_casei)
|
|
+ && op->rsc != NULL) {
|
|
+ const char *st_dev_id_key = CRM_META "_" F_STONITH_DEVICE;
|
|
+
|
|
+ setenv(st_dev_id_key, op->rsc, 1);
|
|
+ }
|
|
+
|
|
if (op->agent == NULL) {
|
|
env_setter = set_alert_env; /* we deal with alert handler */
|
|
|