RE: Permissions on CHECKPOINT - Mailing list pgsql-hackers

From Peter Eisentraut
Subject RE: Permissions on CHECKPOINT
Date
Msg-id Pine.LNX.4.30.0101251748420.1136-100000@peter.localdomain
Whole thread Raw
In response to RE: Permissions on CHECKPOINT  ("Mikheev, Vadim" <vmikheev@SECTORBASE.COM>)
Responses Re: Permissions on CHECKPOINT
List pgsql-hackers
Mikheev, Vadim writes:

> Yes, there should be permission checking - I'll add it later (in 7.1)
> if no one else.

Should be simple enough.  Is this okay:

Index: utility.c
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/backend/tcop/utility.c,v
retrieving revision 1.105
diff -c -r1.105 utility.c
*** utility.c   2001/01/05 06:34:20     1.105
--- utility.c   2001/01/25 16:40:40
***************
*** 18,23 ****
--- 18,24 ----
 #include "access/heapam.h" #include "catalog/catalog.h"
+ #include "catalog/pg_shadow.h" #include "commands/async.h" #include "commands/cluster.h" #include
"commands/command.h"
***************
*** 851,856 ****
--- 852,859 ----                       {                               set_ps_display(commandTag = "CHECKPOINT");

+                               if (!superuser())
+                                       elog(ERROR, "permission denied");
CreateCheckPoint(false);                      }                       break;
 


-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: new version of contrib-intarray
Next
From: Peter Eisentraut
Date:
Subject: Re: postgresql.conf and postgres options