From cb00b7faa5849d8460198f7ced1cfdd0a92cfe53 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 12 Dec 1999 05:57:36 +0000 Subject: I'm in TODO mood today ... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- src/backend/commands/user.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/backend/commands/user.c') 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. -- cgit v1.2.3