Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dc7a000

Browse files
committed
Add permission check for CHECKPOINT.
1 parent 80caa74 commit dc7a000

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

doc/src/sgml/ref/checkpoint.sgml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/checkpoint.sgml,v 1.2 2001/01/24 21:56:23 petere Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/checkpoint.sgml,v 1.3 2001/01/27 10:19:52 petere Exp $ -->
22

33
<refentry id="sql-checkpoint">
44
<docinfo>
@@ -40,6 +40,11 @@ CHECKPOINT
4040
<citetitle>PostgreSQL Administrator's Guide</citetitle> for more
4141
information about the WAL system.
4242
</para>
43+
44+
<para>
45+
Only superusers may call <command>CHECKPOINT</command>. The command is
46+
not intended for use during normal operation.
47+
</para>
4348
</refsect1>
4449

4550
<refsect1>

src/backend/tcop/utility.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.106 2001/01/24 19:43:11 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.107 2001/01/27 10:19:52 petere Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
1717
#include "postgres.h"
1818

1919
#include "access/heapam.h"
2020
#include "catalog/catalog.h"
21+
#include "catalog/pg_shadow.h"
2122
#include "commands/async.h"
2223
#include "commands/cluster.h"
2324
#include "commands/command.h"
@@ -851,6 +852,8 @@ ProcessUtility(Node *parsetree,
851852
{
852853
set_ps_display(commandTag = "CHECKPOINT");
853854

855+
if (!superuser())
856+
elog(ERROR, "permission denied");
854857
CreateCheckPoint(false);
855858
}
856859
break;

0 commit comments

Comments
 (0)