fence-agents: master - Allow fence_scsi to use any valid hexadecimal key

rohara rohara at fedoraproject.org
Tue Mar 15 19:52:25 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=c1880d1153aaad96e206178fc7e6e32b720ef4fd
Commit:        c1880d1153aaad96e206178fc7e6e32b720ef4fd
Parent:        89d4cfcf9bccec2299d3ce837930f1f3624522b2
Author:        Jim Ramsay <jim_ramsay at dell.com>
AuthorDate:    Fri Mar 4 14:04:03 2011 -0500
Committer:     Ryan O'Hara <rohara at redhat.com>
CommitterDate: Tue Mar 15 14:46:19 2011 -0500

Allow fence_scsi to use any valid hexadecimal key

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 at dell.com>
Signed-off-by: Ryan O'Hara <rohara at 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");
 }
 


More information about the cluster-commits mailing list