Hi,

Per the last update release[1] I was going through some of our
documentation around creating clusters and noticed that we may want to
provide a bit more guidance around creating clusters on Windows:

https://www.postgresql.org/docs/current/creating-cluster.html

i.e.:

"Because the data directory contains all the data stored in the
database, it is essential that it be secured from unauthorized access.
initdb therefore revokes access permissions from everyone but the
PostgreSQL user, and optionally, group."

However, this does not explicitly state that initdb performs this
revocation only for *non-Windows systems* -- to lock down the data
directory after an initdb run on a Windows system, it requires manual
intervention.

I've attached a patch that explicitly states the above. I wrapped the
guidance in a "Warning" box given the data directory is exposed if not
locked down properly.

I would also recommend this is backpatched to 9.4. If in agreement on
the above methodology + wording, I can generate the backpatches.

Thanks,

Jonathan

[1] https://www.postgresql.org/about/news/1939/
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index e784268512..2ca49d2482 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -135,14 +135,23 @@ postgres$ <userinput>initdb -D 
/usr/local/pgsql/data</userinput>
   <para>
    Because the data directory contains all the data stored in the
    database, it is essential that it be secured from unauthorized
-   access. <command>initdb</command> therefore revokes access
-   permissions from everyone but the
+   access. On all operating systems other than Windows,
+   <command>initdb</command> revokes access permissions from everyone but the
    <productname>PostgreSQL</productname> user, and optionally, group.
    Group access, when enabled, is read-only.  This allows an unprivileged
    user in the same group as the cluster owner to take a backup of the
    cluster data or perform other operations that only require read access.
   </para>
 
+  <warning>
+   <para>
+   If you are running PostgreSQL on Windows and create your cluster using
+   <command>initdb</command>, you will need to set the permissions on the data
+   directory manually. You should revoke all user access to the data directory
+   except for the <productname>PostgreSQL</productname> user.
+   </para>
+  </warning>
+
   <para>
    Note that enabling or disabling group access on an existing cluster requires
    the cluster to be shut down and the appropriate mode to be set on all

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to