initdb failure on win32

Started by Thomas Hallgrenover 21 years ago5 messages
#1Thomas Hallgren
thhal@mailblocks.com

I'm trying to run initdb on win32, freshly compiled from CVS HEAD, but I
get the following error:

creating template1 database in data/base/1 ... failed to get token
information: 122

Any ideas?

Regards,

Thomas Hallgren

#2Magnus Hagander
mha@sollentuna.net
In reply to: Thomas Hallgren (#1)
Re: initdb failure on win32

Yes, one :-)

Is your account by any chance a member of a large number of groups? If
so, how many?

There is a fixed buffer of 1024 bytes. I have a feeling ythat one has to
be changed to dynamic.

//Magnus

Show quoted text

-----Original Message-----
From: Thomas Hallgren [mailto:thhal@mailblocks.com]
Sent: den 17 augusti 2004 20:27
To: pgsql-hackers@postgresql.org
Subject: [HACKERS] initdb failure on win32

I'm trying to run initdb on win32, freshly compiled from CVS
HEAD, but I
get the following error:

creating template1 database in data/base/1 ... failed to get token
information: 122

Any ideas?

Regards,

Thomas Hallgren

---------------------------(end of
broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#3Thomas Hallgren
thhal@mailblocks.com
In reply to: Magnus Hagander (#2)
Re: initdb failure on win32

Magnus,

There is a fixed buffer of 1024 bytes. I have a feeling ythat one has to
be changed to dynamic.

You're quite right. The 'InfoBufferSize' denotes 1122 bytes after this call.

if(!GetTokenInformation(AccessToken,TokenGroups,InfoBuffer,1024,&InfoBufferSize))

Regards,

Thomas Hallgren

#4Magnus Hagander
mha@sollentuna.net
In reply to: Thomas Hallgren (#3)
Re: initdb failure on win32

There is a fixed buffer of 1024 bytes. I have a feeling

ythat one has

to be changed to dynamic.

You're quite right. The 'InfoBufferSize' denotes 1122 bytes
after this call.

if(!GetTokenInformation(AccessToken,TokenGroups,InfoBuffer,102
4,&InfoBufferSize))

Ah.
Your stop-gap fix is to double the size of the buffer.

I'll try to get a patch in for dynamic buffer handling in the next
couple of days as the real fix.

Just to be sure: Bruce, open item please for "Use dynamic buffer for
token buffer in win32 admin check"

//Magnus

#5Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Magnus Hagander (#4)
Re: initdb failure on win32

Magnus Hagander wrote:

There is a fixed buffer of 1024 bytes. I have a feeling

ythat one has

to be changed to dynamic.

You're quite right. The 'InfoBufferSize' denotes 1122 bytes
after this call.

if(!GetTokenInformation(AccessToken,TokenGroups,InfoBuffer,102
4,&InfoBufferSize))

Ah.
Your stop-gap fix is to double the size of the buffer.

I'll try to get a patch in for dynamic buffer handling in the next
couple of days as the real fix.

Just to be sure: Bruce, open item please for "Use dynamic buffer for
token buffer in win32 admin check"

OK, text updated.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073