1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-18 12:22:09 +03:00

Disallow LOAD to non-superusers. Per report from John Heasman.

This commit is contained in:
Tom Lane
2005-01-24 17:46:29 +00:00
parent f50e08a998
commit 49b35eb14b

View File

@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * 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.231.4.1 2005/01/24 17:46:29 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@@ -803,6 +803,10 @@ ProcessUtility(Node *parsetree,
{ {
LoadStmt *stmt = (LoadStmt *) parsetree; LoadStmt *stmt = (LoadStmt *) parsetree;
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("must be superuser to do LOAD")));
closeAllVfds(); /* probably not necessary... */ closeAllVfds(); /* probably not necessary... */
load_file(stmt->filename); load_file(stmt->filename);
} }