From: Ryan O'Hara <rohara@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] Allow fence_scsi to use any valid hexadecimal key
Date: Tue, 15 Mar 2011 14:49:01 -0500 [thread overview]
Message-ID: <1300218541-7064-1-git-send-email-rohara@redhat.com> (raw)
From: Jim Ramsay <jim_ramsay@dell.com>
The check for a non-zero key is using perl's implicit string-to-integer
conversion that only works on base 10 digits, which means that any key
starting with at least one digit [1-9] will come through as okay, but
any key starting with [A-F] will evaluate as 0 and fail the test.
An explicit conversion to integer via hex() is the solution.
I hit this in a cluster with a cluster ID of 43316 == 0xA934 and scsi
fencing configured, where starting the cman service would always fail at
the "Unfencing self" step.
Signed-off-by: Jim Ramsay <jim_ramsay@dell.com>
Signed-off-by: Ryan O'Hara <rohara@redhat.com>
Resolves: rhbz#653504
---
fence/agents/scsi/fence_scsi.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 9df5c0c..befb398 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -787,7 +787,7 @@ else {
## verify that key is not zero
##
-if ($key == 0) {
+if (hex($key) == 0) {
log_error ("key cannot be zero");
}
--
1.7.3.4
next reply other threads:[~2011-03-15 19:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-15 19:49 Ryan O'Hara [this message]
2011-03-15 20:36 ` [Cluster-devel] [PATCH] Allow fence_scsi to use any valid hexadecimal key Lon Hohberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1300218541-7064-1-git-send-email-rohara@redhat.com \
--to=rohara@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).