From 6dc249610a87aa8b9dcc8baf4e64d2e14d02f548 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 6 Sep 2000 14:15:31 +0000 Subject: Code cleanup of user name and user id handling in the backend. The current user is now defined in terms of the user id, the user name is only computed upon request (for display purposes). This is kind of the opposite of the previous state, which would maintain the user name and compute the user id for permission checks. Besides perhaps saving a few cycles (integer vs string), this now creates a single point of attack for changing the user id during a connection, for purposes of "setuid" functions, etc. --- src/backend/commands/rename.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/backend/commands/rename.c') diff --git a/src/backend/commands/rename.c b/src/backend/commands/rename.c index 2daebf7c5e1..0519df323da 100644 --- a/src/backend/commands/rename.c +++ b/src/backend/commands/rename.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.46 2000/06/20 06:41:13 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.47 2000/09/06 14:15:16 petere Exp $ * *------------------------------------------------------------------------- */ @@ -53,7 +53,6 @@ void renameatt(char *relname, char *oldattname, char *newattname, - char *userName, int recurse) { Relation targetrelation; @@ -74,7 +73,7 @@ renameatt(char *relname, relname); #ifndef NO_SECURITY if (!IsBootstrapProcessingMode() && - !pg_ownercheck(userName, relname, RELNAME)) + !pg_ownercheck(GetUserId(), relname, RELNAME)) elog(ERROR, "renameatt: you do not own class \"%s\"", relname); #endif @@ -129,7 +128,7 @@ renameatt(char *relname, NameStr(((Form_pg_class) GETSTRUCT(reltup))->relname), NAMEDATALEN); /* note we need not recurse again! */ - renameatt(childname, oldattname, newattname, userName, 0); + renameatt(childname, oldattname, newattname, 0); } } -- cgit v1.2.3