X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=socket-dir-fixes.patch;fp=socket-dir-fixes.patch;h=b824b0bf79b952b95ae1b62776c8293e9aee12dc;hb=35c12f8a045babc31faf502f400a9ce81b43b8fd;hp=0000000000000000000000000000000000000000;hpb=de9be0f9c847766566c3077aac4dd67eaa168669;p=packages%2Fpostgresql.git diff --git a/socket-dir-fixes.patch b/socket-dir-fixes.patch new file mode 100644 index 0000000..b824b0b --- /dev/null +++ b/socket-dir-fixes.patch @@ -0,0 +1,35 @@ +diff -urpa postgresql-9.6.10.orig/src/bin/pg_upgrade/option.c postgresql-9.6.10/src/bin/pg_upgrade/option.c +--- postgresql-9.6.10.orig/src/bin/pg_upgrade/option.c 2018-08-22 20:58:08.789332330 +0000 ++++ postgresql-9.6.10/src/bin/pg_upgrade/option.c 2018-08-22 21:05:48.468327154 +0000 +@@ -462,6 +462,11 @@ get_sock_dir(ClusterInfo *cluster, bool + cluster->sockdir = pg_malloc(MAXPGPATH); + if (!getcwd(cluster->sockdir, MAXPGPATH)) + pg_fatal("cannot find current directory\n"); ++#ifndef UNIX_PATH_MAX ++#define UNIX_PATH_MAX 108 ++#endif ++ if (strlen(cluster->sockdir) >= UNIX_PATH_MAX - sizeof(".s.PGSQL.50432")) ++ strcpy(cluster->sockdir, "/tmp"); /* fall back to tmp */ + } + else + { +@@ -487,7 +492,6 @@ get_sock_dir(ClusterInfo *cluster, bool + { + if (fgets(line, sizeof(line), fp) == NULL) + pg_fatal("Cannot read line %d from %s: %m\n", lineno, filename); +- + /* potentially overwrite user-supplied value */ + if (lineno == LOCK_FILE_LINE_PORT) + sscanf(line, "%hu", &old_cluster.port); +diff -urpa postgresql-9.6.10.orig/src/include/pg_config_manual.h postgresql-9.6.10/src/include/pg_config_manual.h +--- postgresql-9.6.10.orig/src/include/pg_config_manual.h 2018-08-22 20:58:08.658332331 +0000 ++++ postgresql-9.6.10/src/include/pg_config_manual.h 2018-08-22 20:58:43.807331936 +0000 +@@ -182,7 +182,7 @@ + * here's where to twiddle it. You can also override this at runtime + * with the postmaster's -k switch. + */ +-#define DEFAULT_PGSOCKET_DIR "/tmp" ++#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql" + + /* + * This is the default event source for Windows event log.