]> TLD Linux GIT Repositories - packages/postgresql.git/blob - socket-dir-fixes.patch
5b63aba4f760f4f97f046c84c04b4bdd0ba6c35a
[packages/postgresql.git] / socket-dir-fixes.patch
1 --- postgresql-15.2/src/bin/pg_upgrade/option.c 2023-03-07 23:37:50.271950638 +0100
2 +++ postgresql-15.2/src/bin/pg_upgrade/option.c 2023-03-07 23:40:28.343899006 +0100
3 @@ -445,8 +445,14 @@
4  get_sock_dir(ClusterInfo *cluster, bool live_check)
5  {
6  #if defined(HAVE_UNIX_SOCKETS) && !defined(WIN32)
7 -       if (!live_check)
8 +       if (!live_check) {
9                 cluster->sockdir = user_opts.socketdir;
10 +#ifndef UNIX_PATH_MAX
11 +#define UNIX_PATH_MAX 108
12 +#endif
13 +               if (strlen(cluster->sockdir) >= UNIX_PATH_MAX - sizeof(".s.PGSQL.50432"))
14 +                       strcpy(cluster->sockdir, "/tmp"); /* fall back to tmp */
15 +       }
16         else
17         {
18                 /*
19 --- postgresql-15.2/src/include/pg_config_manual.h      2023-03-07 23:37:50.153949183 +0100
20 +++ postgresql-15.2/src/include/pg_config_manual.h      2023-03-07 23:38:28.898426739 +0100
21 @@ -224,7 +224,7 @@
22   * support them yet.
23   */
24  #ifndef WIN32
25 -#define DEFAULT_PGSOCKET_DIR  "/tmp"
26 +#define DEFAULT_PGSOCKET_DIR  "/var/run/postgresql"
27  #else
28  #define DEFAULT_PGSOCKET_DIR ""
29  #endif