* [Cluster-devel] [PATCH] Allow fence_scsi to use any valid hexadecimal key
@ 2011-03-15 19:49 Ryan O'Hara
2011-03-15 20:36 ` Lon Hohberger
0 siblings, 1 reply; 2+ messages in thread
From: Ryan O'Hara @ 2011-03-15 19:49 UTC (permalink / raw)
To: cluster-devel.redhat.com
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-15 20:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-15 19:49 [Cluster-devel] [PATCH] Allow fence_scsi to use any valid hexadecimal key Ryan O'Hara
2011-03-15 20:36 ` Lon Hohberger
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).