Skip site navigation (1) Skip section navigation (2)

pg_resetxlog as root

From: Neil Conway <neilc(at)samurai(dot)com>
To: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: pg_resetxlog as root
Date: 2004-12-12 22:56:57
Message-ID: 1102892217.23208.7.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-patches
We should prevent pg_resetxlog from being run as root: it writes new
files to $PGDATA, so running the tool as root will result in those files
being owned by root, which makes the data directory unusable.

Attached is a trivial patch that makes this change for Unix. I suppose a
similar fix is needed for Win32? If so, pgwin32_is_admin() would be the
natural routine to call, but that is currently in src/backend/port -- we
would need to move it to src/port, probably. Comments?

-Neil


Attachment: resetxlog_root-1.patch
Description: text/x-patch (1.1 KB)

pgsql-patches by date

Next:From: Dave PageDate: 2004-12-12 23:59:52
Subject: Re: pg_resetxlog as root
Previous:From: Peter EisentrautDate: 2004-12-12 15:34:36
Subject: Re: [HACKERS] regression script/makefile exit failure

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group