From 1111964fee74bfaeed34437a7a54b69fade8cd2a Mon Sep 17 00:00:00 2001 From: Murat Kabilov Date: Fri, 26 May 2017 18:13:48 +0200 Subject: [PATCH] fix password check in pguserpassword remove magic number --- pkg/util/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/util.go b/pkg/util/util.go index 7f38b9a7e..e67a02294 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -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 }