]> TLD Linux GIT Repositories - packages/postgresql.git/blob - socket-dir-fixes.patch
- updated to 9.5.24
[packages/postgresql.git] / socket-dir-fixes.patch
1 diff -urpa postgresql-9.5.14.orig/src/bin/pg_upgrade/option.c postgresql-9.5.14/src/bin/pg_upgrade/option.c
2 --- postgresql-9.5.14.orig/src/bin/pg_upgrade/option.c  2018-08-23 13:18:56.785669756 +0000
3 +++ postgresql-9.5.14/src/bin/pg_upgrade/option.c       2018-08-23 13:32:12.040660802 +0000
4 @@ -462,6 +462,11 @@ get_sock_dir(ClusterInfo *cluster, bool
5                         cluster->sockdir = pg_malloc(MAXPGPATH);
6                         if (!getcwd(cluster->sockdir, MAXPGPATH))
7                                 pg_fatal("cannot find current directory\n");
8 +#ifndef UNIX_PATH_MAX
9 +#define UNIX_PATH_MAX 108
10 +#endif
11 +                       if (strlen(cluster->sockdir) >= UNIX_PATH_MAX - sizeof(".s.PGSQL.50432"))
12 +                               strcpy(cluster->sockdir, "/tmp"); /* fall back to tmp */
13                 }
14                 else
15                 {
16 @@ -487,7 +492,6 @@ get_sock_dir(ClusterInfo *cluster, bool
17                         {
18                                 if (fgets(line, sizeof(line), fp) == NULL)
19                                         pg_fatal("Cannot read line %d from %s: %m\n", lineno, filename);
20 -
21                                 /* potentially overwrite user-supplied value */
22                                 if (lineno == LOCK_FILE_LINE_PORT)
23                                         sscanf(line, "%hu", &old_cluster.port);
24 diff -urpa postgresql-9.5.14.orig/src/include/pg_config_manual.h postgresql-9.5.14/src/include/pg_config_manual.h
25 --- postgresql-9.5.14.orig/src/include/pg_config_manual.h       2018-08-23 13:18:56.652669757 +0000
26 +++ postgresql-9.5.14/src/include/pg_config_manual.h    2018-08-23 13:32:12.040660802 +0000
27 @@ -169,7 +169,7 @@
28   * here's where to twiddle it.  You can also override this at runtime
29   * with the postmaster's -k switch.
30   */
31 -#define DEFAULT_PGSOCKET_DIR  "/tmp"
32 +#define DEFAULT_PGSOCKET_DIR  "/var/run/postgresql"
33  
34  /*
35   * This is the default event source for Windows event log.