RE: Permissions on CHECKPOINT

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
Cc: "'Oliver Elphick'" <olly(at)lfix(dot)co(dot)uk>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Permissions on CHECKPOINT
Date: 2001-01-25 16:49:51
Message-ID: Pine.LNX.4.30.0101251748420.1136-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net http://yi.org/peter-e/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Frank Joerdens 2001-01-25 18:22:55 Re: beta3 Solaris 7 (SPARC) port report [ Was: Looking for . . . ]
Previous Message Peter Eisentraut 2001-01-25 16:37:08 Re: Open 7.1 items