mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Remove support for password_encryption='off' / 'plain'.
Storing passwords in plaintext hasn't been a good idea for a very long time, if ever. Now seems like a good time to finally forbid it, since we're messing with this in PostgreSQL 10 anyway. Remove the CREATE/ALTER USER UNENCRYPTED PASSSWORD 'foo' syntax, since storing passwords unencrypted is no longer supported. ENCRYPTED PASSWORD 'foo' is still accepted, but ENCRYPTED is now just a noise-word, it does the same as just PASSWORD 'foo'. Likewise, remove the --unencrypted option from createuser, but accept --encrypted as a no-op for backward compatibility. AFAICS, --encrypted was a no-op even before this patch, because createuser encrypted the password before sending it to the server even if --encrypted was not specified. It added the ENCRYPTED keyword to the SQL command, but since the password was already in encrypted form, it didn't make any difference. The documentation was not clear on whether that was intended or not, but it's moot now. Also, while password_encryption='on' is still accepted as an alias for 'md5', it is now marked as hidden, so that it is not listed as an accepted value in error hints, for example. That's not directly related to removing 'plain', but it seems better this way. Reviewed by Michael Paquier Discussion: https://www.postgresql.org/message-id/16e9b768-fd78-0b12-cfc1-7b6b7f238fde@iki.fi
This commit is contained in:
@ -405,20 +405,16 @@ static const struct config_enum_entry force_parallel_mode_options[] = {
|
||||
|
||||
/*
|
||||
* password_encryption used to be a boolean, so accept all the likely
|
||||
* variants of "on" and "off", too.
|
||||
* variants of "on", too. "off" used to store passwords in plaintext,
|
||||
* but we don't support that anymore.
|
||||
*/
|
||||
static const struct config_enum_entry password_encryption_options[] = {
|
||||
{"plain", PASSWORD_TYPE_PLAINTEXT, false},
|
||||
{"md5", PASSWORD_TYPE_MD5, false},
|
||||
{"scram-sha-256", PASSWORD_TYPE_SCRAM_SHA_256, false},
|
||||
{"off", PASSWORD_TYPE_PLAINTEXT, false},
|
||||
{"on", PASSWORD_TYPE_MD5, false},
|
||||
{"on", PASSWORD_TYPE_MD5, true},
|
||||
{"true", PASSWORD_TYPE_MD5, true},
|
||||
{"false", PASSWORD_TYPE_PLAINTEXT, true},
|
||||
{"yes", PASSWORD_TYPE_MD5, true},
|
||||
{"no", PASSWORD_TYPE_PLAINTEXT, true},
|
||||
{"1", PASSWORD_TYPE_MD5, true},
|
||||
{"0", PASSWORD_TYPE_PLAINTEXT, true},
|
||||
{NULL, 0, false}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user