diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2000-09-19 18:18:04 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2000-09-19 18:18:04 +0000 |
commit | 457ac0331cd3e28ecc5d783e7504645837c41a1d (patch) | |
tree | ba4676d77b28de759955919a8dc14303fb7330bc /src/backend/commands/user.c | |
parent | e9c3f0255fb54600e1c03533cc2e72d78928634d (diff) | |
download | postgresql-457ac0331cd3e28ecc5d783e7504645837c41a1d.tar.gz postgresql-457ac0331cd3e28ecc5d783e7504645837c41a1d.zip |
Implement differentiation between CURRENT_USER and SESSION_USER as per SQL.
There is still no effective difference but it will kick in once setuid
functions exist (not included here). Make old getpgusername() alias for
current_user.
Diffstat (limited to 'src/backend/commands/user.c')
-rw-r--r-- | src/backend/commands/user.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index 25150818a72..cc57eb7068c 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.67 2000/08/27 21:50:17 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.68 2000/09/19 18:17:54 petere Exp $ * *------------------------------------------------------------------------- */ @@ -348,7 +348,7 @@ AlterUser(AlterUserStmt *stmt) /* must be superuser or just want to change your own password */ if (!superuser() && !(stmt->createdb == 0 && stmt->createuser == 0 && !stmt->validUntil - && stmt->password && strcmp(GetPgUserName(), stmt->user) == 0)) + && stmt->password && strcmp(GetUserName(GetUserId()), stmt->user) == 0)) elog(ERROR, "ALTER USER: permission denied"); /* changes to the flat password file cannot be rolled back */ |