mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Revert "Secure Unix-domain sockets of "make check" temporary clusters."
About half of the buildfarm members use too-long directory names, strongly suggesting that this approach is a dead end.
This commit is contained in:
@ -109,7 +109,6 @@ static const char *progname;
|
||||
static char *logfilename;
|
||||
static FILE *logfile;
|
||||
static char *difffilename;
|
||||
static char *sockdir;
|
||||
|
||||
static _resultmap *resultmap = NULL;
|
||||
|
||||
@ -760,7 +759,8 @@ initialize_environment(void)
|
||||
* the wrong postmaster, or otherwise behave in nondefault ways. (Note
|
||||
* we also use psql's -X switch consistently, so that ~/.psqlrc files
|
||||
* won't mess things up.) Also, set PGPORT to the temp port, and set
|
||||
* PGHOST depending on whether we are using TCP or Unix sockets.
|
||||
* or unset PGHOST depending on whether we are using TCP or Unix
|
||||
* sockets.
|
||||
*/
|
||||
unsetenv("PGDATABASE");
|
||||
unsetenv("PGUSER");
|
||||
@ -772,24 +772,7 @@ initialize_environment(void)
|
||||
if (hostname != NULL)
|
||||
doputenv("PGHOST", hostname);
|
||||
else
|
||||
{
|
||||
sockdir = getenv("PG_REGRESS_SOCK_DIR");
|
||||
if (!sockdir)
|
||||
{
|
||||
/*
|
||||
* Since initdb creates the data directory with secure
|
||||
* permissions, we place the socket there. This ensures no
|
||||
* other OS user can open our socket to exploit our use of
|
||||
* trust authentication. Compared to using the compiled-in
|
||||
* DEFAULT_PGSOCKET_DIR, this also permits testing to work in
|
||||
* builds that relocate it to a directory not writable to the
|
||||
* build/test user.
|
||||
*/
|
||||
sockdir = malloc(strlen(temp_install) + sizeof("/data"));
|
||||
sprintf(sockdir, "%s/data", temp_install);
|
||||
}
|
||||
doputenv("PGHOST", sockdir);
|
||||
}
|
||||
unsetenv("PGHOST");
|
||||
unsetenv("PGHOSTADDR");
|
||||
if (port != -1)
|
||||
{
|
||||
@ -2266,11 +2249,10 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
|
||||
*/
|
||||
header(_("starting postmaster"));
|
||||
snprintf(buf, sizeof(buf),
|
||||
SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s "
|
||||
"-c \"listen_addresses=%s\" -k \"%s\" "
|
||||
"> \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE,
|
||||
bindir, temp_install, debug ? " -d 5" : "",
|
||||
hostname ? hostname : "", sockdir ? sockdir : "",
|
||||
SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE,
|
||||
bindir, temp_install,
|
||||
debug ? " -d 5" : "",
|
||||
hostname ? hostname : "",
|
||||
outputdir);
|
||||
postmaster_pid = spawn_process(buf);
|
||||
if (postmaster_pid == INVALID_PID)
|
||||
|
Reference in New Issue
Block a user