pg_resetxlog as root - Mailing list pgsql-patches

From Neil Conway
Subject pg_resetxlog as root
Date
Msg-id 1102892217.23208.7.camel@localhost.localdomain
Whole thread Raw
List 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

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] regression script/makefile exit failure
Next
From: "Dave Page"
Date:
Subject: Re: pg_resetxlog as root