Add permission check for CHECKPOINT.
This commit is contained in:
parent
80caa741ab
commit
dc7a0009f0
@ -1,4 +1,4 @@
|
|||||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/checkpoint.sgml,v 1.2 2001/01/24 21:56:23 petere Exp $ -->
|
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/checkpoint.sgml,v 1.3 2001/01/27 10:19:52 petere Exp $ -->
|
||||||
|
|
||||||
<refentry id="sql-checkpoint">
|
<refentry id="sql-checkpoint">
|
||||||
<docinfo>
|
<docinfo>
|
||||||
@ -40,6 +40,11 @@ CHECKPOINT
|
|||||||
<citetitle>PostgreSQL Administrator's Guide</citetitle> for more
|
<citetitle>PostgreSQL Administrator's Guide</citetitle> for more
|
||||||
information about the WAL system.
|
information about the WAL system.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Only superusers may call <command>CHECKPOINT</command>. The command is
|
||||||
|
not intended for use during normal operation.
|
||||||
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.106 2001/01/24 19:43:11 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.107 2001/01/27 10:19:52 petere Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "access/heapam.h"
|
#include "access/heapam.h"
|
||||||
#include "catalog/catalog.h"
|
#include "catalog/catalog.h"
|
||||||
|
#include "catalog/pg_shadow.h"
|
||||||
#include "commands/async.h"
|
#include "commands/async.h"
|
||||||
#include "commands/cluster.h"
|
#include "commands/cluster.h"
|
||||||
#include "commands/command.h"
|
#include "commands/command.h"
|
||||||
@ -851,6 +852,8 @@ ProcessUtility(Node *parsetree,
|
|||||||
{
|
{
|
||||||
set_ps_display(commandTag = "CHECKPOINT");
|
set_ps_display(commandTag = "CHECKPOINT");
|
||||||
|
|
||||||
|
if (!superuser())
|
||||||
|
elog(ERROR, "permission denied");
|
||||||
CreateCheckPoint(false);
|
CreateCheckPoint(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user