@@ -337,14 +337,14 @@ checkDataDir(void)
337337 *
338338 * XXX can we safely enable this check on Windows?
339339 */
340- // #if !defined(WIN32) && !defined(__CYGWIN__)
341- // if (stat_buf.st_uid != geteuid())
342- // ereport(FATAL,
343- // (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
344- // errmsg("data directory \"%s\" has wrong ownership",
345- // DataDir),
346- // errhint("The server must be started by the user that owns the data directory.")));
347- // #endif
340+ #if !defined(WIN32 ) && !defined(__CYGWIN__ ) && !defined( EMSCRIPTEN )
341+ if (stat_buf .st_uid != geteuid ())
342+ ereport (FATAL ,
343+ (errcode (ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE ),
344+ errmsg ("data directory \"%s\" has wrong ownership" ,
345+ DataDir ),
346+ errhint ("The server must be started by the user that owns the data directory." )));
347+ #endif
348348
349349 /*
350350 * Check if the directory has correct permissions. If not, reject.
@@ -357,14 +357,14 @@ checkDataDir(void)
357357 * be proper support for Unix-y file permissions. Need to think of a
358358 * reasonable check to apply on Windows.
359359 */
360- // #if !defined(WIN32) && !defined(__CYGWIN__)
361- // if (stat_buf.st_mode & PG_MODE_MASK_GROUP)
362- // ereport(FATAL,
363- // (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
364- // errmsg("data directory \"%s\" has invalid permissions",
365- // DataDir),
366- // errdetail("Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).")));
367- // #endif
360+ #if !defined(WIN32 ) && !defined(__CYGWIN__ ) && !defined( EMSCRIPTEN )
361+ if (stat_buf .st_mode & PG_MODE_MASK_GROUP )
362+ ereport (FATAL ,
363+ (errcode (ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE ),
364+ errmsg ("data directory \"%s\" has invalid permissions" ,
365+ DataDir ),
366+ errdetail ("Permissions should be u=rwx (0700) or u=rwx,g=rx (0750)." )));
367+ #endif
368368
369369 /*
370370 * Reset creation modes and mask based on the mode of the data directory.
0 commit comments