mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 22:46:52 +02:00
fix password check in pguserpassword
remove magic number
This commit is contained in:
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user