From ad538d8bcd882f04ac1faa35ba2924ddbe9ffed3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 24 Jan 2005 17:46:16 +0000 Subject: [PATCH] Disallow LOAD to non-superusers. Per report from John Heasman. --- src/backend/tcop/utility.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 11fa2fc52d..81d557c54e 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.231 2004/12/31 22:01:16 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.232 2005/01/24 17:46:16 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -803,6 +803,10 @@ ProcessUtility(Node *parsetree, { LoadStmt *stmt = (LoadStmt *) parsetree; + if (!superuser()) + ereport(ERROR, + (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), + errmsg("must be superuser to do LOAD"))); closeAllVfds(); /* probably not necessary... */ load_file(stmt->filename); }