X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=socket-dir-fixes.patch;fp=socket-dir-fixes.patch;h=a146243b5d994e34d47b75ce48a94aba59c02f91;hb=cfa05b3d9692a9e73b3d9763b7e45d0e0a4bde05;hp=0000000000000000000000000000000000000000;hpb=d1f67cdbd3e8149376b4e06e28fc0e9c76906724;p=packages%2Fpostgresql.git diff --git a/socket-dir-fixes.patch b/socket-dir-fixes.patch new file mode 100644 index 0000000..a146243 --- /dev/null +++ b/socket-dir-fixes.patch @@ -0,0 +1,35 @@ +diff -urpa postgresql-9.5.14.orig/src/bin/pg_upgrade/option.c postgresql-9.5.14/src/bin/pg_upgrade/option.c +--- postgresql-9.5.14.orig/src/bin/pg_upgrade/option.c 2018-08-23 13:18:56.785669756 +0000 ++++ postgresql-9.5.14/src/bin/pg_upgrade/option.c 2018-08-23 13:32:12.040660802 +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.5.14.orig/src/include/pg_config_manual.h postgresql-9.5.14/src/include/pg_config_manual.h +--- postgresql-9.5.14.orig/src/include/pg_config_manual.h 2018-08-23 13:18:56.652669757 +0000 ++++ postgresql-9.5.14/src/include/pg_config_manual.h 2018-08-23 13:32:12.040660802 +0000 +@@ -169,7 +169,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.