From 88dd0b3c7297d9033752d9aaf9e5a2e0c34ac5ec Mon Sep 17 00:00:00 2001 From: mxi1 Date: Tue, 15 Dec 2009 06:34:55 +0000 Subject: [PATCH] the author method is changed as we discussed last week; verify the password as encrypted pw firstly; if it fails, then treat the password as non-encyrpted password to verify one more time git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4772 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index e50dcfc6b..8e9b772e8 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -1300,12 +1300,18 @@ sub becomeuser { return undef; } $passent=$passent->{password}; - if ($passent =~ /^\$(2a|1)\$.*\$/) { #MD5 or Blowfish hash, calculate before comparison - $pass = crypt($pass,$passent); - } #Not bothering with old DES method, for now assume plaintext if not set - if ($pass eq $passent) { + my $encryptedpass = crypt($pass,$passent); + if ($encryptedpass eq $passent) { + return $id; + }elsif ($pass eq $passent) { return $id; } +# if ($passent =~ /^\$(2a|1)\$.*\$/) { #MD5 or Blowfish hash, calculate before comparison +# $pass = crypt($pass,$passent); +# } #Not bothering with old DES method, for now assume plaintext if not set +# if ($pass eq $passent) { +# return $id; +# } #If here, unable to validate given credential return undef; }