X-Git-Url: https://git.tld-linux.org/?p=packages%2Fpostgresql.git;a=blobdiff_plain;f=socket-dir-fixes.patch;h=3690d568fe51613e38c451c5a8ea8b27576d179d;hp=61cd4eb6819675b765b36dd23e6ccb03f0f8f851;hb=HEAD;hpb=e3bed88e2502a74b99d20051bd51bf8890677837 diff --git a/socket-dir-fixes.patch b/socket-dir-fixes.patch index 61cd4eb..6b0f67c 100644 --- a/socket-dir-fixes.patch +++ b/socket-dir-fixes.patch @@ -1,27 +1,31 @@ -diff -urpa postgresql-10.5.orig/src/bin/pg_upgrade/option.c postgresql-10.5/src/bin/pg_upgrade/option.c ---- postgresql-10.5.orig/src/bin/pg_upgrade/option.c 2018-08-22 19:57:55.237373015 +0000 -+++ postgresql-10.5/src/bin/pg_upgrade/option.c 2018-08-22 19:59:10.944372163 +0000 -@@ -460,6 +460,11 @@ get_sock_dir(ClusterInfo *cluster, bool - cluster->sockdir = pg_malloc(MAXPGPATH); - if (!getcwd(cluster->sockdir, MAXPGPATH)) - pg_fatal("could not determine current directory\n"); +diff -ur postgresql-16.1.orig/src/bin/pg_upgrade/option.c postgresql-16.1/src/bin/pg_upgrade/option.c +--- postgresql-16.1.orig/src/bin/pg_upgrade/option.c 2023-11-06 23:04:27.000000000 +0100 ++++ postgresql-16.1/src/bin/pg_upgrade/option.c 2023-12-13 21:51:21.445407619 +0100 +@@ -456,8 +456,14 @@ + get_sock_dir(ClusterInfo *cluster, bool live_check) + { + #if !defined(WIN32) +- if (!live_check) ++ if (!live_check) { + cluster->sockdir = user_opts.socketdir; +#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-10.5.orig/src/include/pg_config_manual.h postgresql-10.5/src/include/pg_config_manual.h ---- postgresql-10.5.orig/src/include/pg_config_manual.h 2018-08-22 19:57:55.095373017 +0000 -+++ postgresql-10.5/src/include/pg_config_manual.h 2018-08-22 19:58:30.664372616 +0000 -@@ -181,7 +181,7 @@ - * here's where to twiddle it. You can also override this at runtime - * with the postmaster's -k switch. ++ if (strlen(cluster->sockdir) >= UNIX_PATH_MAX - sizeof(".s.PGSQL.50432")) ++ strcpy(cluster->sockdir, "/tmp"); /* fall back to tmp */ ++ } + else + { + /* +diff -ur postgresql-16.1.orig/src/include/pg_config_manual.h postgresql-16.1/src/include/pg_config_manual.h +--- postgresql-16.1.orig/src/include/pg_config_manual.h 2023-11-06 23:04:27.000000000 +0100 ++++ postgresql-16.1/src/include/pg_config_manual.h 2023-12-13 21:49:50.563249439 +0100 +@@ -206,7 +206,7 @@ + * support them yet. */ + #ifndef WIN32 -#define DEFAULT_PGSOCKET_DIR "/tmp" +#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql" - - /* - * This is the default event source for Windows event log. + #else + #define DEFAULT_PGSOCKET_DIR "" + #endif