diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-08-17 02:59:20 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-08-17 02:59:20 +0000 |
commit | da45a0bdb7580b7b9cec62f6999605083dcec162 (patch) | |
tree | fd40d31c441933caf2051c68886be65ac60f0e38 /src/backend/commands/user.c | |
parent | a61e15a5664536896f9d3a7454962d91a13d83bd (diff) | |
download | postgresql-da45a0bdb7580b7b9cec62f6999605083dcec162.tar.gz postgresql-da45a0bdb7580b7b9cec62f6999605083dcec162.zip |
Add 4-byte MD5 salt.
Diffstat (limited to 'src/backend/commands/user.c')
-rw-r--r-- | src/backend/commands/user.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index 3b730a3a0d8..d830dfdfc90 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.81 2001/08/15 21:08:20 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.82 2001/08/17 02:59:19 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -351,7 +351,8 @@ CreateUser(CreateUserStmt *stmt) DirectFunctionCall1(textin, CStringGetDatum(password)); else { - if (!EncryptMD5(password, stmt->user, encrypted_password)) + if (!EncryptMD5(password, stmt->user, strlen(stmt->user), + encrypted_password)) elog(ERROR, "CREATE USER: password encryption failed"); new_record[Anum_pg_shadow_passwd - 1] = DirectFunctionCall1(textin, CStringGetDatum(encrypted_password)); @@ -583,7 +584,8 @@ AlterUser(AlterUserStmt *stmt) DirectFunctionCall1(textin, CStringGetDatum(password)); else { - if (!EncryptMD5(password, stmt->user, encrypted_password)) + if (!EncryptMD5(password, stmt->user, strlen(stmt->user), + encrypted_password)) elog(ERROR, "CREATE USER: password encryption failed"); new_record[Anum_pg_shadow_passwd - 1] = DirectFunctionCall1(textin, CStringGetDatum(encrypted_password)); |