fix password check in pguserpassword

remove magic number
This commit is contained in:
Murat Kabilov 2017-05-26 18:13:48 +02:00
parent 009db16c7c
commit 1111964fee
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ func NameFromMeta(meta v1.ObjectMeta) spec.NamespacedName {
}
func PGUserPassword(user spec.PgUser) string {
if (len(user.Password) == md5.Size && user.Password[:3] == md5prefix) || user.Password == "" {
if (len(user.Password) == md5.Size*2+len(md5prefix) && user.Password[:3] == md5prefix) || user.Password == "" {
// Avoid processing already encrypted or empty passwords
return user.Password
}