diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-12-12 05:57:36 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-12-12 05:57:36 +0000 |
commit | cb00b7faa5849d8460198f7ced1cfdd0a92cfe53 (patch) | |
tree | d389b1907364124e8c6703af287ed0e593d06446 /src/backend/commands/user.c | |
parent | 11023eb1f5bd4fe6ddff652957848437b5d16f14 (diff) | |
download | postgresql-cb00b7faa5849d8460198f7ced1cfdd0a92cfe53.tar.gz postgresql-cb00b7faa5849d8460198f7ced1cfdd0a92cfe53.zip |
I'm in TODO mood today ...
* Document/trigger/rule so changes to pg_shadow recreate pg_pwd
I did it with a trigger and it seems to work like a charm. The function
that already updates the file for create and alter user has been made a
built-in "SQL" function and a trigger is created at initdb time.
Comments around the pg_pwd updating function seem to be worried about
this
routine being called concurrently, but I really don't see a reason to
worry about this. Verify for yourself. I guess we never had a system
trigger before, so treat this with care, and feel free to adjust the
nomenclature as well.
--
Peter Eisentraut Sernanders väg 10:115
Diffstat (limited to 'src/backend/commands/user.c')
-rw-r--r-- | src/backend/commands/user.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index 2360cc3bb80..1cf07325473 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -5,7 +5,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: user.c,v 1.40 1999/11/30 04:29:56 momjian Exp $ + * $Id: user.c,v 1.41 1999/12/12 05:57:28 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -43,8 +43,13 @@ static void CheckPgUserAclNotNull(void); * pg_shadow is the standard way to do that. *--------------------------------------------------------------------- */ -static void -UpdatePgPwdFile(void) + +/* This is the old name. Now uses a lower case name to be able to call this + from SQL. */ +#define UpdatePgPwdFile() update_pg_pwd() + +void +update_pg_pwd() { char *filename, *tempname; @@ -71,7 +76,7 @@ UpdatePgPwdFile(void) false, /* from */ false, /* pipe */ tempname, /* filename */ - CRYPT_PWD_FILE_SEPCHAR, /* delim */ + CRYPT_PWD_FILE_SEPSTR, /* delim */ 0077); /* fileumask */ /* * And rename the temp file to its final name, deleting the old pg_pwd. |