Re: 9.2RC1 wraps this Thursday ...

From: Amit kapila <amit(dot)kapila(at)huawei(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.2RC1 wraps this Thursday ...
Date: 2012-08-22 13:07:25
Message-ID: 6C0B27F7206C9E4CA54AE035729E9C382852D5D8@szxeml509-mbs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: Tom Lane [tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Tuesday, August 21, 2012 10:31 PM
Amit Kapila <amit(dot)kapila(at)huawei(dot)com> writes:
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
>> * pg_ctl crashes on Win32 when neither PGDATA nor -D specified

>>> isn't there a way to actually test if we're in a restricted process?

>> Do you mean to say that it should check if pg_ctl runs as an administrative
>> user then do the re-fork in restricted mode.

> Something like that. The proposed patch depends on there not being a
> conflicting environment variable, which seems rather fragile to me.
> Can't we test the same condition that postgres.exe itself would test?

To implement the postgre.exe way we have following options:
1. Duplicate the function pgwin32_is_admin and related function to pg_ctl, as currently it is not exposed.
2. Make that visible to pg_ctl, but for that it need to link with postgre lib.
3. Move the functions to some common place may be src/port.
4. any other better way?

Curretly I have implemented the patch with Approach-1, but I believe Approach-3 would have been better.
However I was not sure which is the best place to move functions, so I have implemented with Approach-1.

Please let me know if the attached patch is acceptable. I shall wait today night for your confirmation and shall let you know before
I leave my work place in which case I shall complete tommorow morning but not sure whether that much delay is acceptable.

With Regards,
Amit Kapila.

Attachment Content-Type Size
defect_pg_ctl_admin_win32.patch text/plain 4.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-08-22 13:29:48 Re: 9.2RC1 wraps this Thursday ...
Previous Message Ashutosh Bapat 2012-08-22 12:48:52 Expressions without type