mirror of
https://github.com/postgres/postgres.git
synced 2025-08-05 07:41:25 +03:00
Disallow LOAD to non-superusers. Per report from John Heasman.
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.208 2003/10/02 06:34:04 petere Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.208.2.1 2005/01/24 17:46:41 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@@ -814,6 +814,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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user