File bsc#1209586-0001-Fix-libcrmcommon-allow-crm_attribute-to-try-OCF_RESO.patch of Package pacemaker.38493
From b7ed96cf0642c89e8908afa65b4734349db0f0d9 Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Mon, 20 Mar 2023 14:05:56 +0100
Subject: [PATCH] Fix: libcrmcommon: allow crm_attribute to try
OCF_RESOURCE_INSTANCE environment variable if -p is specified with an empty
string
, rather than set/get a meaningless promotion score. And in case
OCF_RESOURCE_INSTANCE is also an empty string, return usage error.
---
lib/common/attrs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/common/attrs.c b/lib/common/attrs.c
index 0bce9f50f..2be03b424 100644
--- a/lib/common/attrs.c
+++ b/lib/common/attrs.c
@@ -79,9 +79,9 @@ pcmk__node_attr_target(const char *name)
char *
pcmk_promotion_score_name(const char *rsc_id)
{
- if (rsc_id == NULL) {
+ if (pcmk__str_empty(rsc_id)) {
rsc_id = getenv("OCF_RESOURCE_INSTANCE");
- if (rsc_id == NULL) {
+ if (pcmk__str_empty(rsc_id)) {
return NULL;
}
}
--
2.35.3