[pgpool-general: 2127] Patches from Debian

Christoph Berg myon+oss.postgresql at df7cb.de
Thu Sep 12 19:58:35 JST 2013


Hi,

here's two patches from the Debian package that should be integrated
into pgpool2:

Replace pg_config by $(PG_CONFIG) in Makefiles so it can be overridden
at build time when compiling for different PG major versions:

--- a/sql/Makefile
+++ b/sql/Makefile
@@ -29,7 +29,8 @@
 top_builddir = ..
 
 ifdef USE_PGXS
-PGXS = $(shell pg_config --pgxs)
+PG_CONFIG = pg_config
+PGXS = $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
 else
 subdir = contrib
--- a/sql/pgpool-recovery/Makefile
+++ b/sql/pgpool-recovery/Makefile
@@ -14,7 +14,8 @@
 top_builddir = ../..
 
 ifdef USE_PGXS
-PGXS = $(shell pg_config --pgxs)
+PG_CONFIG = pg_config
+PGXS = $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
 else
 subdir = contrib/pgpool-recovery
--- a/sql/pgpool-regclass/Makefile
+++ b/sql/pgpool-regclass/Makefile
@@ -14,7 +14,8 @@
 top_builddir = ../..
 
 ifdef USE_PGXS
-PGXS = $(shell pg_config --pgxs)
+PG_CONFIG = pg_config
+PGXS = $(shell $(PG_CONFIG) --pgxs)
 include $(PGXS)
 else
 subdir = contrib/pgpool-regclass


Fix a warning/error when compiling with -Werror=format-security:

--- a/watchdog/wd_packet.c
+++ b/watchdog/wd_packet.c
@@ -1135,8 +1135,8 @@
 
 	username_len = authkey_len / 2;
 	pass_len = authkey_len - username_len;
-	snprintf(username, username_len + 1, pool_config->wd_authkey);
-	snprintf(pass, pass_len + 1, pool_config->wd_authkey + username_len);
+	snprintf(username, username_len + 1, "%s", pool_config->wd_authkey);
+	snprintf(pass, pass_len + 1, "%s", pool_config->wd_authkey + username_len);
 
 	/* calculate hash using md5 encrypt */
 	pool_md5_encrypt(pass, username, strlen(username), buf + MD5_PASSWD_LEN + 1);

Christoph
-- 
cb at df7cb.de | http://www.df7cb.de/


More information about the pgpool-general mailing list