Skip to content

Commit 1111964

Browse files
author
Murat Kabilov
committed
fix password check in pguserpassword
remove magic number
1 parent 009db16 commit 1111964

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/util/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func NameFromMeta(meta v1.ObjectMeta) spec.NamespacedName {
4141
}
4242

4343
func PGUserPassword(user spec.PgUser) string {
44-
if (len(user.Password) == md5.Size && user.Password[:3] == md5prefix) || user.Password == "" {
44+
if (len(user.Password) == md5.Size*2+len(md5prefix) && user.Password[:3] == md5prefix) || user.Password == "" {
4545
// Avoid processing already encrypted or empty passwords
4646
return user.Password
4747
}

0 commit comments

Comments
 (0)