aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/dbcommands.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-09-03 22:17:35 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-09-03 22:17:35 +0000
commitd61de58906249e8fb8e44d1ef454d029325526a3 (patch)
treedc5aafeca29a2b1265868c1f55624db1d47f9f3c /src/backend/commands/dbcommands.c
parentc7d07b5a456a57b48975dd582f70d4bcf966bb91 (diff)
downloadpostgresql-d61de58906249e8fb8e44d1ef454d029325526a3.tar.gz
postgresql-d61de58906249e8fb8e44d1ef454d029325526a3.zip
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).
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r--src/backend/commands/dbcommands.c9
1 files changed, 7 insertions, 2 deletions
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';