From e45670bd14bd2e9b7e108aed647050b69887e312 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Thu, 16 Feb 2017 15:04:13 -0600
Subject: [PATCH] Fix: tools: avoid NULL dereference in crm_resource debug
message
Also clarify crm_resource --cleanup help text
---
tools/crm_resource.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tools/crm_resource.c b/tools/crm_resource.c
index c4ee78e..aee2e03 100644
--- a/tools/crm_resource.c
+++ b/tools/crm_resource.c
@@ -128,7 +128,12 @@ static struct crm_option long_options[] = {
{"constraints",0, 0, 'a', "\tDisplay the (co)location constraints that apply to a resource"},
{"-spacer-", 1, 0, '-', "\nCommands:"},
- {"cleanup", 0, 0, 'C', "\t\tDelete the resource history and re-check the current state. Optional: --resource"},
+ {"cleanup", 0, 0, 'C',
+ "\t\tDelete resource's history and re-check its current state. "
+ "Optional: --resource (if not specified, all resources), "
+ "--node (if not specified, all nodes), "
+ "--force (if not specified, resource's group or clone will also be cleaned)"
+ },
{"set-parameter", 1, 0, 'p', "Set the named parameter for a resource. See also -m, --meta"},
{"get-parameter", 1, 0, 'g', "Display the named parameter for a resource. See also -m, --meta"},
{"delete-parameter",1, 0, 'd', "Delete the named parameter for a resource. See also -m, --meta"},
@@ -943,8 +948,9 @@ main(int argc, char **argv)
rsc = uber_parent(rsc);
}
- crm_debug("Re-checking the state of %s for %s on %s", rsc->id, rsc_id, host_uname);
if(rsc) {
+ crm_debug("Re-checking the state of %s (%s requested) on %s",
+ rsc->id, rsc_id, host_uname);
crmd_replies_needed = 0;
rc = cli_resource_delete(cib_conn, crmd_channel, host_uname, rsc, &data_set);
} else {
--
1.8.3.1