]> TLD Linux GIT Repositories - packages/postgresql.git/blob - socket-dir-fixes.patch
- updated to 16.2
[packages/postgresql.git] / socket-dir-fixes.patch
1 diff -ur postgresql-16.1.orig/src/bin/pg_upgrade/option.c postgresql-16.1/src/bin/pg_upgrade/option.c
2 --- postgresql-16.1.orig/src/bin/pg_upgrade/option.c    2023-11-06 23:04:27.000000000 +0100
3 +++ postgresql-16.1/src/bin/pg_upgrade/option.c 2023-12-13 21:51:21.445407619 +0100
4 @@ -456,8 +456,14 @@
5  get_sock_dir(ClusterInfo *cluster, bool live_check)
6  {
7  #if !defined(WIN32)
8 -       if (!live_check)
9 +       if (!live_check) {
10                 cluster->sockdir = user_opts.socketdir;
11 +#ifndef UNIX_PATH_MAX
12 +#define UNIX_PATH_MAX 108
13 +#endif
14 +               if (strlen(cluster->sockdir) >= UNIX_PATH_MAX - sizeof(".s.PGSQL.50432"))
15 +                       strcpy(cluster->sockdir, "/tmp"); /* fall back to tmp */
16 +       }
17         else
18         {
19                 /*
20 diff -ur postgresql-16.1.orig/src/include/pg_config_manual.h postgresql-16.1/src/include/pg_config_manual.h
21 --- postgresql-16.1.orig/src/include/pg_config_manual.h 2023-11-06 23:04:27.000000000 +0100
22 +++ postgresql-16.1/src/include/pg_config_manual.h      2023-12-13 21:49:50.563249439 +0100
23 @@ -206,7 +206,7 @@
24   * support them yet.
25   */
26  #ifndef WIN32
27 -#define DEFAULT_PGSOCKET_DIR  "/tmp"
28 +#define DEFAULT_PGSOCKET_DIR  "/var/run/postgresql"
29  #else
30  #define DEFAULT_PGSOCKET_DIR ""
31  #endif