Skip to content

Commit ad538d8

Browse files
committed
Disallow LOAD to non-superusers. Per report from John Heasman.
1 parent 0ffe9f7 commit ad538d8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/tcop/utility.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.231 2004/12/31 22:01:16 pgsql Exp $
13+
* $PostgreSQL: pgsql/src/backend/tcop/utility.c,v 1.232 2005/01/24 17:46:16 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -803,6 +803,10 @@ ProcessUtility(Node *parsetree,
803803
{
804804
LoadStmt *stmt = (LoadStmt *) parsetree;
805805

806+
if (!superuser())
807+
ereport(ERROR,
808+
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
809+
errmsg("must be superuser to do LOAD")));
806810
closeAllVfds(); /* probably not necessary... */
807811
load_file(stmt->filename);
808812
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy