]> TLD Linux GIT Repositories - packages/postgresql.git/blobdiff - socket-dir-fixes.patch
- versioned package, 9.3.24
[packages/postgresql.git] / socket-dir-fixes.patch
diff --git a/socket-dir-fixes.patch b/socket-dir-fixes.patch
new file mode 100644 (file)
index 0000000..de08eb1
--- /dev/null
@@ -0,0 +1,27 @@
+diff -urpa postgresql-9.3.24.orig/contrib/pg_upgrade/option.c postgresql-9.3.24/contrib/pg_upgrade/option.c
+--- postgresql-9.3.24.orig/contrib/pg_upgrade/option.c 2018-08-23 19:56:17.181401335 +0000
++++ postgresql-9.3.24/contrib/pg_upgrade/option.c      2018-08-23 19:59:38.729399066 +0000
+@@ -411,6 +411,11 @@ get_sock_dir(ClusterInfo *cluster, bool
+                       cluster->sockdir = pg_malloc(MAXPGPATH);
+                       if (!getcwd(cluster->sockdir, MAXPGPATH))
+                               pg_log(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
+               {
+diff -urpa postgresql-9.3.24.orig/src/include/pg_config_manual.h postgresql-9.3.24/src/include/pg_config_manual.h
+--- postgresql-9.3.24.orig/src/include/pg_config_manual.h      2018-08-23 19:56:17.195401335 +0000
++++ postgresql-9.3.24/src/include/pg_config_manual.h   2018-08-23 19:59:34.340399115 +0000
+@@ -152,7 +152,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"
+ /*
+  * The random() function is expected to yield values between 0 and