aboutsummaryrefslogtreecommitdiff
path: root/src/include/miscadmin.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-09-06 14:15:31 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-09-06 14:15:31 +0000
commit6dc249610a87aa8b9dcc8baf4e64d2e14d02f548 (patch)
tree6ca1b864625ecf91a2887c8031a9fa91b5f9c5c5 /src/include/miscadmin.h
parentdaf1e3a7026e367d630be3ac34ac0a9e7cf1340f (diff)
downloadpostgresql-6dc249610a87aa8b9dcc8baf4e64d2e14d02f548.tar.gz
postgresql-6dc249610a87aa8b9dcc8baf4e64d2e14d02f548.zip
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.
Diffstat (limited to 'src/include/miscadmin.h')
-rw-r--r--src/include/miscadmin.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 83ad67602cc..187f6f91b7f 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: miscadmin.h,v 1.64 2000/08/03 16:34:43 tgl Exp $
+ * $Id: miscadmin.h,v 1.65 2000/09/06 14:15:24 petere Exp $
*
* NOTES
* some of the information in this file will be moved to
@@ -51,8 +51,6 @@ extern long MyCancelKey;
extern char OutputFileName[];
-extern char *UserName;
-
/*
* done in storage/backendid.h for now.
*
@@ -130,9 +128,9 @@ extern void SetDatabaseName(const char *name);
extern void SetDatabasePath(const char *path);
extern char *GetPgUserName(void);
-extern void SetPgUserName(void);
-extern int GetUserId(void);
-extern void SetUserId(void);
+extern Oid GetUserId(void);
+extern void SetUserId(Oid userid);
+extern void SetUserIdFromUserName(const char *username);
extern int FindExec(char *full_path, const char *argv0, const char *binary_name);
extern int CheckPathAccess(char *path, char *name, int open_mode);
@@ -186,7 +184,7 @@ typedef int16 ExitStatus;
extern int lockingOff;
-extern void InitPostgres(const char *dbname);
+extern void InitPostgres(const char *dbname, const char *username);
extern void BaseInit(void);
/* one of the ways to get out of here */