Skip to content
Snippets Groups Projects
Commit 1111964f authored by Murat Kabilov's avatar Murat Kabilov
Browse files

fix password check in pguserpassword

remove magic number
parent 009db16c
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment