Re: PgSQL not as Administrator - probs on w

From: "Gary Doades" <gpd(at)gpdnet(dot)co(dot)uk>
To: pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: PgSQL not as Administrator - probs on w
Date: 2004-07-02 20:41:05
Message-ID: 40E5D671.5496.5941638@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

On 2 Jul 2004 at 17:42, Magnus Hagander wrote:

> The priv causing the problem is ReplaceProcessLevelToken. And the
> problem is not activagting it, the problem is that it's not granted at
> all by defualt.
> IIRC CreateProcessAsUser is the one being used by 2k/XP with the
> CreateProcessAndLogin() API (I may have misspelled that one, but
it's
> something like that)
>
> //Magnus
>

I think you can call LookupPrivilegeValue() using
SE_ASSIGNPRIMARYTOKEN_NAME

as the privilege constant and then call AdjustTokenPrivileges() on the
handle returned from LogonUser before doing the impersonation or
CreateProcessAsUser.

I don't have time to try right now, but I may have a go to see if this
works tomorrow. I don't have access to an NT machine though, so I
could only test to see that it gave no errors on 2000 pro XP.

Cheers,
Gary.

In response to

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message nitrogenycs 2004-07-04 01:26:07 initdb crash
Previous Message Gary Doades 2004-07-02 19:12:08 Re: PgSQL not as Administrator - probs on w