Re: 9.2 beta2 - pg_ctl crashes on Win32 when neither PGDATA nor -D specified

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Edmund Horner <ejrh00(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: 9.2 beta2 - pg_ctl crashes on Win32 when neither PGDATA nor -D specified
Date: 2012-06-13 15:08:20
Message-ID: CA+OCxoxYk_G+XBjMPVxx2tn11m8-phH1jga+y5M_=WtM7qWU+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Jun 13, 2012 at 3:51 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> On Mon, Jun 11, 2012 at 10:23:00PM -0400, Tom Lane wrote:
>> Hm, that patch seems to be several bricks shy of a load.  I will fix
>> two obvious bugs in it:
>>
>> (1) not dump core on boxes where printf("%s", NULL) dumps core;
>>
>> (2) not try to call adjust_data_dir before complaining for lack of
>> a -D switch; since adjust_data_dir does not do anything to the value
>> of pg_config, it's just silly to do things in that order.
>>
>> However,
>>
>> > I note that "postgres -C data_directory" will refuse to run on the
>> > command line because I've got admin privileges in Windows, and that
>> > pg_ctl normally starts postgres.exe using CreateRestrictedProcess.
>> > But it does not do so for the popen call in adjust_data_dir.
>>
>> if that actually is a third bug, as seems likely, somebody with access
>> to a windows environment will need to deal with it.
>
> I think you have to use RUNAS when using 'pg_ctl' or 'postgres' on Windows.

pg_ctl should work as an administrative user, as it'll irrevocably
drop unwanted privileges. postgres won't though.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2012-06-13 15:14:14 Re: 9.2 beta2 - pg_ctl crashes on Win32 when neither PGDATA nor -D specified
Previous Message Bruce Momjian 2012-06-13 14:51:01 Re: 9.2 beta2 - pg_ctl crashes on Win32 when neither PGDATA nor -D specified