Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdc7a000

Browse files
committed
Add permission check for CHECKPOINT.
1 parent80caa74 commitdc7a000

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/2419: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)

[8]ページ先頭

©2009-2025 Movatter.jp