Re: [HACKERS] Window2012R2: initdb error: "The current directory is invalid."

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Huong Dangminh <huo-dangminh(at)ys(dot)jp(dot)nec(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>, Hiroshi Yanagisawa <hir-yanagisawa(at)ut(dot)jp(dot)nec(dot)com>
Subject: Re: [HACKERS] Window2012R2: initdb error: "The current directory is invalid."
Date: 2016-01-20 08:30:12
Message-ID: CAMsr+YF7yzFhRjHt28-XWKaOO6h87_H8qvroFsdFkwDVHeoqQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On 20 January 2016 at 16:22, Huong Dangminh <huo-dangminh(at)ys(dot)jp(dot)nec(dot)com>
wrote:

>
> initdb was executed with "Administrator" privileges, but
> then initdb do popen() with none "Administrator" privileges
> (by child process).
>

That makes sense. It intentionally drops privileges.

You probably have to set the ACLs up so that it can still see and write to
the directory even after it has dropped privileges. That will include
setting ACLs on the parent directories so that it can see inside them.
Explicitly granting rights to the admin user you're running as is probably
sufficient but I'm not sure.

The best thing to do is probably to run initdb with non-administrator
rights and grant permissions directly.

This is the same kind of problem you get on linux systems if you 'cd' to
some root-only directory then 'sudo -u somenormaluser ls'. You get an error
saying the current directory isn't readable or similar.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message John R Pierce 2016-01-20 08:42:48 Re: [HACKERS] Window2012R2: initdb error: "The current directory is invalid."
Previous Message Huong Dangminh 2016-01-20 08:22:08 Re: [HACKERS] Window2012R2: initdb error: "The current directory is invalid."

Browse pgsql-hackers by date

  From Date Subject
Next Message Shulgin, Oleksandr 2016-01-20 08:35:55 Re: Stream consistent snapshot via a logical decoding plugin as a series of INSERTs
Previous Message Craig Ringer 2016-01-20 08:26:15 Re: Stream consistent snapshot via a logical decoding plugin as a series of INSERTs