Disallow LOAD to non-superusers. Per report from John Heasman.
authorTom Lane <[email protected]>
Mon, 24 Jan 2005 17:46:41 +0000 (17:46 +0000)
committerTom Lane <[email protected]>
Mon, 24 Jan 2005 17:46:41 +0000 (17:46 +0000)
src/backend/tcop/utility.c

index 05f5d1d044826a2a628515dba4308a8e7452184e..1af128bfd2168996ae22d5c35edcb1c9f8781f8f 100644 (file)
@@ -814,6 +814,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);
                        }