From d61de58906249e8fb8e44d1ef454d029325526a3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 3 Sep 2002 22:17:35 +0000 Subject: Arrange for the default permissions on a database to allow temp table creation to world, but disallow temp table creation in template1. Per latest round of pghackers discussion. I did not force initdb, but the permissions lockdown on template1 will not take effect unless you do one (or manually REVOKE TEMP ON DATABASE template1 FROM public). --- src/backend/commands/dbcommands.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/dbcommands.c') diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index e62eaabb31f..f5bacf6b3c7 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.103 2002/09/03 21:45:41 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.104 2002/09/03 22:17:34 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -328,7 +328,12 @@ createdb(const CreatedbStmt *stmt) /* do not set datpath to null, GetRawDatabaseInfo won't cope */ new_record[Anum_pg_database_datpath - 1] = DirectFunctionCall1(textin, CStringGetDatum(dbpath ? dbpath : "")); - + /* + * We deliberately set datconfig and datacl to defaults (NULL), rather + * than copying them from the template database. Copying datacl would + * be a bad idea when the owner is not the same as the template's owner. + * It's more debatable whether datconfig should be copied. + */ new_record_nulls[Anum_pg_database_datconfig - 1] = 'n'; new_record_nulls[Anum_pg_database_datacl - 1] = 'n'; -- cgit v1.2.3