pgpool: 3.4.14 -> 4.0.5 (#66224)

Updated to PGPool-II 4.0.5 and modify the code to allow absolute path
for pool_passwd file.
This commit is contained in:
Derek Kulinski 2019-08-07 04:15:10 -07:00 committed by Danylo Hlynskyi
parent 7d90a4c67b
commit b1d00b71b6
3 changed files with 28 additions and 15 deletions

View file

@ -1,15 +1,17 @@
{ stdenv, fetchurl, postgresql, openssl, pam ? null, libmemcached ? null }:
stdenv.mkDerivation rec {
name = "pgpool-II-3.4.14";
pname = "pgpool-II";
version = "4.0.5";
name = "${pname}-${version}";
src = fetchurl {
name = "${name}.tar.gz";
url = "http://www.pgpool.net/download.php?f=${name}.tar.gz";
sha256 = "1paak83f4lv48xckmf2znryrvhmdz86w4v97mcw2gxm50hcl74sw";
sha256 = "0v2g2ksikn10kxsa8i47gv0kbklrsscvlddza3caf522q1k0fic4";
};
patches = [ ./pgpool-II-3.4.14-glibc-2.26.patch ];
patches = [ ./pgpool.patch ];
buildInputs = [ postgresql openssl pam libmemcached ];

View file

@ -1,12 +0,0 @@
diff --git a/src/watchdog/wd_lifecheck.c b/src/watchdog/wd_lifecheck.c
index 1e72307..5cf68a3 100644
--- a/src/watchdog/wd_lifecheck.c
+++ b/src/watchdog/wd_lifecheck.c
@@ -26,6 +26,7 @@
#include <ctype.h>
#include <time.h>
#include <string.h>
+#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <netdb.h>

View file

@ -0,0 +1,23 @@
diff --git a/src/main/main.c b/src/main/main.c
index eec3c3e4..4169112b 100644
--- a/src/main/main.c
+++ b/src/main/main.c
@@ -337,10 +337,14 @@ main(int argc, char **argv)
char dirnamebuf[POOLMAXPATHLEN + 1];
char *dirp;
- strlcpy(dirnamebuf, conf_file, sizeof(dirnamebuf));
- dirp = dirname(dirnamebuf);
- snprintf(pool_passwd, sizeof(pool_passwd), "%s/%s",
- dirp, pool_config->pool_passwd);
+ if (pool_config->pool_passwd[0] != '/') {
+ strlcpy(dirnamebuf, conf_file, sizeof(dirnamebuf));
+ dirp = dirname(dirnamebuf);
+ snprintf(pool_passwd, sizeof(pool_passwd), "%s/%s",
+ dirp, pool_config->pool_passwd);
+ } else
+ strlcpy(pool_passwd, pool_config->pool_passwd,
+ sizeof(pool_passwd));
pool_init_pool_passwd(pool_passwd, POOL_PASSWD_R);
}