1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

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
This commit is contained in:
Bruce Momjian
1999-12-12 05:57:36 +00:00
parent 11023eb1f5
commit cb00b7faa5
4 changed files with 18 additions and 7 deletions

View File

@ -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.