File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1111 *
1212 *
1313 * IDENTIFICATION
14- * $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.45 2003/12/18 22:49:26 tgl Exp $
14+ * $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.46 2004/06/25 15:07:52 tgl Exp $
1515 *
1616 * Since the server static private key ($DataDir/server.key)
1717 * will normally be stored unencrypted so that the database
@@ -650,13 +650,24 @@ initialize_SSL(void)
650650 (errcode_for_file_access (),
651651 errmsg ("could not access private key file \"%s\": %m" ,
652652 fnbuf )));
653+
654+ /*
655+ * Require no public access to key file.
656+ *
657+ * XXX temporarily suppress check when on Windows, because there may
658+ * not be proper support for Unix-y file permissions. Need to think
659+ * of a reasonable check to apply on Windows. (See also the data
660+ * directory permission check in postmaster.c)
661+ */
662+ #if !defined(__CYGWIN__ ) && !defined(WIN32 )
653663 if (!S_ISREG (buf .st_mode ) || (buf .st_mode & (S_IRWXG | S_IRWXO )) ||
654664 buf .st_uid != getuid ())
655665 ereport (FATAL ,
656666 (errcode (ERRCODE_CONFIG_FILE_ERROR ),
657667 errmsg ("unsafe permissions on private key file \"%s\"" ,
658668 fnbuf ),
659669 errdetail ("File must be owned by the database user and must have no permissions for \"group\" or \"other\"." )));
670+ #endif
660671
661672 if (!SSL_CTX_use_PrivateKey_file (SSL_context , fnbuf , SSL_FILETYPE_PEM ))
662673 ereport (FATAL ,
You can’t perform that action at this time.
0 commit comments