mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-18 04:50:03 +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 {
|
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
|
// Avoid processing already encrypted or empty passwords
|
||||||
return user.Password
|
return user.Password
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user