diff options
author | Aaron W. Swenson <titanofold@gentoo.org> | 2011-03-20 17:48:17 -0400 |
---|---|---|
committer | Aaron W. Swenson <titanofold@gentoo.org> | 2011-03-20 17:48:17 -0400 |
commit | 6224b4aecebc480880b955876ed90e8d56761995 (patch) | |
tree | da26601436023dae957d6c0426f305dfe6cbd253 | |
parent | Initial commit. README describes repository layout. (diff) | |
download | patches-6224b4aecebc480880b955876ed90e8d56761995.tar.gz patches-6224b4aecebc480880b955876ed90e8d56761995.tar.bz2 patches-6224b4aecebc480880b955876ed90e8d56761995.zip |
Initial commit of 8.3 patches.
-rw-r--r-- | SuperH.patch | 33 | ||||
-rw-r--r-- | autoconf.patch | 32 | ||||
-rw-r--r-- | base.patch | 137 | ||||
-rw-r--r-- | darwin.patch | 19 | ||||
-rw-r--r-- | regress.patch | 62 | ||||
-rw-r--r-- | relax_ssl_perms.patch | 14 | ||||
-rw-r--r-- | server.patch | 187 |
7 files changed, 484 insertions, 0 deletions
diff --git a/SuperH.patch b/SuperH.patch new file mode 100644 index 0000000..877c7c7 --- /dev/null +++ b/SuperH.patch @@ -0,0 +1,33 @@ +diff -Naur a/src/include/storage/s_lock.h b/src/include/storage/s_lock.h +--- a/src/include/storage/s_lock.h 2011-01-27 21:24:47.000000000 -0500 ++++ b/src/include/storage/s_lock.h 2011-03-20 16:59:30.462991541 -0400 +@@ -298,6 +298,29 @@ + + #endif /* __s390__ || __s390x__ */ + ++#if defined(__sh__) ++#define HAS_TEST_AND_SET ++ ++typedef unsigned char slock_t; ++ ++#define TAS(lock) tas(lock) ++ ++static __inline__ int ++tas(volatile slock_t *lock) ++{ ++ register int _res = 1; ++ ++ __asm__ __volatile__( ++ "tas.b @%1\n\t" ++ "movt %0\n\t" ++ "xor #1,%0" ++: "=z"(_res) ++: "r"(lock) ++: "t","memory"); ++ return _res; ++} ++ ++#endif /* __sh__ */ + + #if defined(__sparc__) /* Sparc */ + #define HAS_TEST_AND_SET diff --git a/autoconf.patch b/autoconf.patch new file mode 100644 index 0000000..668f0a5 --- /dev/null +++ b/autoconf.patch @@ -0,0 +1,32 @@ +diff -Naur a/config/programs.m4 b/config/programs.m4 +--- a/config/programs.m4 2011-01-27 21:24:47.000000000 -0500 ++++ b/config/programs.m4 2011-03-20 16:31:05.287491541 -0400 +@@ -204,8 +204,12 @@ + AC_CHECK_PROGS(MSGMERGE, msgmerge) + AC_CHECK_PROGS(XGETTEXT, xgettext) + +- # Note: share/locale is always the default, independent of $datadir +- localedir='${prefix}/share/locale' ++ # Note: share/locale *WAS* always the default, independent of $datadir ++ AC_ARG_WITH([locale-dir], ++ AC_HELP_STRING([--with-locale-dir],[Set path to locale files]), ++ [ localedir="${withval}" ], ++ [ localedir='${prefix}/share/locale' ] ++ ) + AC_SUBST(localedir) + ])# PGAC_CHECK_GETTEXT + +diff -Naur a/configure.in b/configure.in +--- a/configure.in 2011-01-27 21:24:47.000000000 -0500 ++++ b/configure.in 2011-03-20 16:27:33.227491542 -0400 +@@ -19,10 +19,6 @@ + + AC_INIT([PostgreSQL], [8.3.14], [pgsql-bugs@postgresql.org]) + +-m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.59], [], [m4_fatal([Autoconf version 2.59 is required. +-Untested combinations of 'autoconf' and PostgreSQL versions are not +-recommended. You can remove the check from 'configure.in' but it is then +-your responsibility whether the result works or not.])]) + AC_COPYRIGHT([Copyright (c) 1996-2008, PostgreSQL Global Development Group]) + AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) + AC_CONFIG_AUX_DIR(config) diff --git a/base.patch b/base.patch new file mode 100644 index 0000000..0fb8408 --- /dev/null +++ b/base.patch @@ -0,0 +1,137 @@ +diff -Naur a/contrib/Makefile b/contrib/Makefile +--- a/contrib/Makefile 2011-01-27 21:24:47.000000000 -0500 ++++ b/contrib/Makefile 2011-03-20 17:08:14.354083541 -0400 +@@ -5,41 +5,10 @@ + include $(top_builddir)/src/Makefile.global + + WANTED_DIRS = \ +- adminpack \ +- btree_gist \ +- chkpass \ +- cube \ +- dblink \ +- dict_int \ +- dict_xsyn \ +- earthdistance \ +- fuzzystrmatch \ +- hstore \ +- intagg \ +- intarray \ +- isn \ +- lo \ +- ltree \ + oid2name \ +- pageinspect \ +- pg_buffercache \ +- pg_freespacemap \ +- pg_standby \ +- pg_trgm \ + pgbench \ +- pgcrypto \ +- pgrowlocks \ +- pgstattuple \ +- seg \ +- spi \ +- tablefunc \ +- test_parser \ +- tsearch2 \ + vacuumlo + +-ifeq ($(with_openssl),yes) +-WANTED_DIRS += sslinfo +-endif + + ifeq ($(with_ossp_uuid),yes) + WANTED_DIRS += uuid-ossp +diff -Naur a/src/Makefile b/src/Makefile +--- a/src/Makefile 2011-01-27 21:24:47.000000000 -0500 ++++ b/src/Makefile 2011-03-20 17:10:04.114083541 -0400 +@@ -15,16 +15,11 @@ + + all install installdirs uninstall distprep: + $(MAKE) -C port $@ +- $(MAKE) -C timezone $@ + $(MAKE) -C backend $@ +- $(MAKE) -C backend/utils/mb/conversion_procs $@ +- $(MAKE) -C backend/snowball $@ + $(MAKE) -C include $@ + $(MAKE) -C interfaces $@ + $(MAKE) -C bin $@ +- $(MAKE) -C pl $@ + $(MAKE) -C makefiles $@ +- $(MAKE) -C test/regress $@ + + install: install-local + +diff -Naur a/src/backend/Makefile b/src/backend/Makefile +--- a/src/backend/Makefile 2011-01-27 21:24:47.000000000 -0500 ++++ b/src/backend/Makefile 2011-03-20 17:14:21.617388542 -0400 +@@ -34,7 +34,7 @@ + + ########################################################################## + +-all: submake-libpgport postgres $(POSTGRES_IMP) ++all: someheaders + + ifneq ($(PORTNAME), cygwin) + ifneq ($(PORTNAME), win32) +@@ -107,8 +107,7 @@ + + .PHONY: $(DIRS:%=%-recursive) + # Update the commonly used headers before building the subdirectories +-$(DIRS:%=%-recursive): $(top_builddir)/src/include/parser/parse.h $(top_builddir)/src/include/utils/fmgroids.h +- $(MAKE) -C $(subst -recursive,,$@) all ++someheaders $(DIRS:%=%-recursive): $(top_builddir)/src/include/parser/parse.h $(top_builddir)/src/include/utils/fmgroids.h + + + # The postgres.o target is needed by the rule in Makefile.global that +@@ -155,23 +154,7 @@ + + ########################################################################## + +-install: all installdirs install-bin +-ifeq ($(PORTNAME), cygwin) +-ifeq ($(MAKE_DLL), true) +- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' +-endif +-endif +-ifeq ($(PORTNAME), win32) +-ifeq ($(MAKE_DLL), true) +- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' +-endif +-endif +- $(MAKE) -C catalog install-data +- $(MAKE) -C tsearch install-data +- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample' +- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample' +- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample' +- $(INSTALL_DATA) $(srcdir)/access/transam/recovery.conf.sample '$(DESTDIR)$(datadir)/recovery.conf.sample' ++install: + + install-bin: postgres $(POSTGRES_IMP) installdirs + $(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)' +diff -Naur a/src/bin/Makefile b/src/bin/Makefile +--- a/src/bin/Makefile 2011-01-27 21:24:47.000000000 -0500 ++++ b/src/bin/Makefile 2011-03-20 17:16:38.931158541 -0400 +@@ -13,8 +13,7 @@ + top_builddir = ../.. + include $(top_builddir)/src/Makefile.global + +-DIRS = initdb ipcclean pg_ctl pg_dump \ +- psql scripts pg_config pg_controldata pg_resetxlog ++DIRS = pg_dump psql scripts pg_config + ifeq ($(PORTNAME), win32) + DIRS+=pgevent + endif +diff -Naur a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h +--- a/src/include/pg_config_manual.h 2011-01-27 21:24:47.000000000 -0500 ++++ b/src/include/pg_config_manual.h 2011-03-20 17:17:51.151158541 -0400 +@@ -184,7 +184,7 @@ + * here's where to twiddle it. You can also override this at runtime + * with the postmaster's -k switch. + */ +-#define DEFAULT_PGSOCKET_DIR "/tmp" ++#define DEFAULT_PGSOCKET_DIR "@GENTOO_PORTAGE_EPREFIX@/var/run/postgresql" + + /* + * The random() function is expected to yield values between 0 and diff --git a/darwin.patch b/darwin.patch new file mode 100644 index 0000000..fa6b449 --- /dev/null +++ b/darwin.patch @@ -0,0 +1,19 @@ +diff -Naur a/src/makefiles/Makefile.darwin b/src/makefiles/Makefile.darwin +--- a/src/makefiles/Makefile.darwin 2011-01-27 21:24:47.000000000 -0500 ++++ b/src/makefiles/Makefile.darwin 2011-03-20 16:37:58.667491540 -0400 +@@ -5,7 +5,15 @@ + CFLAGS_SL = + + ifdef PGXS ++ifdef PGXS_IN_SERVER ++ifndef PGXS_WITH_SERVER ++BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres ++else ++BE_DLLLIBS= -bundle_loader ${PGXS_WITH_SERVER} ++endif ++else + BE_DLLLIBS= -bundle_loader $(bindir)/postgres ++endif + else + BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres + endif diff --git a/regress.patch b/regress.patch new file mode 100644 index 0000000..2ae07d9 --- /dev/null +++ b/regress.patch @@ -0,0 +1,62 @@ +diff -Naur a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c +--- a/src/test/regress/pg_regress.c 2011-02-02 07:35:02.185212599 -0500 ++++ b/src/test/regress/pg_regress.c 2011-02-07 23:33:52.837335002 -0500 +@@ -70,7 +70,7 @@ + bool debug = false; + char *inputdir = "."; + char *outputdir = "."; +-char *psqldir = NULL; ++char *psqldir = PGBINDIR; + static _stringlist *loadlanguage = NULL; + static int max_connections = 0; + static char *encoding = NULL; +@@ -782,7 +782,7 @@ + datadir = tmp; + + /* psql will be installed into temp-install bindir */ +- psqldir = bindir; ++ /* psqldir = bindir; */ + + /* + * Set up shared library paths to include the temp install. +@@ -880,7 +880,7 @@ + + /* And now we can build and execute the shell command */ + snprintf(psql_cmd, sizeof(psql_cmd), +- SYSTEMQUOTE "\"%s%spsql\" -X -c \"%s\" \"%s\"" SYSTEMQUOTE, ++ SYSTEMQUOTE "\"%s%spsql\" -h @SOCKETDIR@ -X -c \"%s\" \"%s\"" SYSTEMQUOTE, + psqldir ? psqldir : "", + psqldir ? "/" : "", + query_escaped, +@@ -2049,7 +2049,7 @@ + */ + header(_("starting postmaster")); + snprintf(buf, sizeof(buf), +- SYSTEMQUOTE "\"%s/postgres\" -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE, ++ SYSTEMQUOTE "\"%s/postgres\" -k @SOCKETDIR@ -D \"%s/data\" -F%s -c \"listen_addresses=%s\" > \"%s/log/postmaster.log\" 2>&1" SYSTEMQUOTE, + bindir, temp_install, + debug ? " -d 5" : "", + hostname ? hostname : "", +@@ -2068,8 +2068,8 @@ + * forever, however. + */ + snprintf(buf, sizeof(buf), +- SYSTEMQUOTE "\"%s/psql\" -X postgres <%s 2>%s" SYSTEMQUOTE, +- bindir, DEVNULL, DEVNULL); ++ SYSTEMQUOTE "\"%s/psql\" -h @SOCKETDIR@ -X postgres <%s 2>%s" SYSTEMQUOTE, ++ psqldir, DEVNULL, DEVNULL); + for (i = 0; i < 60; i++) + { + /* Done if psql succeeds */ +diff -Naur a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c +--- a/src/test/regress/pg_regress_main.c 2011-02-02 07:35:02.205209914 -0500 ++++ b/src/test/regress/pg_regress_main.c 2011-02-07 06:00:16.264372002 -0500 +@@ -45,7 +45,7 @@ + add_stringlist_item(expectfiles, expectfile); + + snprintf(psql_cmd, sizeof(psql_cmd), +- SYSTEMQUOTE "\"%s%spsql\" -X -a -q -d \"%s\" < \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE, ++ SYSTEMQUOTE "\"%s%spsql\" -h @SOCKETDIR@ -X -a -q -d \"%s\" < \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE, + psqldir ? psqldir : "", + psqldir ? "/" : "", + dblist->str, diff --git a/relax_ssl_perms.patch b/relax_ssl_perms.patch new file mode 100644 index 0000000..351b7d9 --- /dev/null +++ b/relax_ssl_perms.patch @@ -0,0 +1,14 @@ +diff -Naur a/src/backend/libpq/be-secure.c b/src/backend/libpq/be-secure.c +--- a/src/backend/libpq/be-secure.c 2011-01-27 21:24:47.000000000 -0500 ++++ b/src/backend/libpq/be-secure.c 2011-03-20 16:53:00.877881541 -0400 +@@ -753,8 +753,8 @@ + * directory permission check in postmaster.c) + */ + #if !defined(WIN32) && !defined(__CYGWIN__) +- if (!S_ISREG(buf.st_mode) || (buf.st_mode & (S_IRWXG | S_IRWXO)) || +- buf.st_uid != geteuid()) ++ if (!S_ISREG(buf.st_mode) || (buf.st_mode & (S_IWGRP | S_IRWXO)) || ++ (buf.st_uid != geteuid()) && buf.st_uid != 0) + ereport(FATAL, + (errcode(ERRCODE_CONFIG_FILE_ERROR), + errmsg("unsafe permissions on private key file \"%s\"", diff --git a/server.patch b/server.patch new file mode 100644 index 0000000..5d58aff --- /dev/null +++ b/server.patch @@ -0,0 +1,187 @@ +diff -Naur a/contrib/adminpack/Makefile b/contrib/adminpack/Makefile +--- a/contrib/adminpack/Makefile 2011-02-02 07:33:37.755861971 -0500 ++++ b/contrib/adminpack/Makefile 2011-02-06 22:46:17.604452002 -0500 +@@ -1,7 +1,7 @@ + # $PostgreSQL: pgsql/contrib/adminpack/Makefile,v 1.6 2007/11/10 23:59:50 momjian Exp $ + + MODULE_big = adminpack +-PG_CPPFLAGS = -I$(libpq_srcdir) ++PG_CPPFLAGS = -I$(libpq_srcdir) -I../../src/include/ + DATA_built = adminpack.sql + DATA = uninstall_adminpack.sql + OBJS = adminpack.o +diff -Naur a/contrib/Makefile b/contrib/Makefile +--- a/contrib/Makefile 2011-02-02 07:33:37.705873097 -0500 ++++ b/contrib/Makefile 2011-02-07 05:24:58.225882002 -0500 +@@ -20,13 +20,11 @@ + isn \ + lo \ + ltree \ +- oid2name \ + pageinspect \ + pg_buffercache \ + pg_freespacemap \ + pg_standby \ + pg_trgm \ +- pgbench \ + pgcrypto \ + pgrowlocks \ + pgstattuple \ +@@ -34,8 +32,7 @@ + spi \ + tablefunc \ + test_parser \ +- tsearch2 \ +- vacuumlo ++ tsearch2 + + ifeq ($(with_openssl),yes) + WANTED_DIRS += sslinfo +diff -Naur a/contrib/uuid-ossp/Makefile b/contrib/uuid-ossp/Makefile +--- a/contrib/uuid-ossp/Makefile 2011-02-02 07:33:45.315801510 -0500 ++++ b/contrib/uuid-ossp/Makefile 2011-02-06 22:48:37.844452002 -0500 +@@ -1,11 +1,11 @@ + # $PostgreSQL: pgsql/contrib/uuid-ossp/Makefile,v 1.4 2007/11/13 00:13:19 tgl Exp $ +- ++PG_CPPFLAGS += "-DHAVE_OSSP_UUID_H" + MODULE_big = uuid-ossp + OBJS = uuid-ossp.o + DATA_built = uuid-ossp.sql + DATA = uninstall_uuid-ossp.sql + +-SHLIB_LINK += $(OSSP_UUID_LIBS) ++SHLIB_LINK += -lossp-uuid + + ifdef USE_PGXS + PG_CONFIG = pg_config +diff -Naur a/contrib/xml2/Makefile b/contrib/xml2/Makefile +--- a/contrib/xml2/Makefile 2011-02-02 07:33:45.405801070 -0500 ++++ b/contrib/xml2/Makefile 2011-02-06 22:50:18.104452002 -0500 +@@ -4,7 +4,8 @@ + + OBJS = xpath.o xslt_proc.o + +-SHLIB_LINK += $(filter -lxslt, $(LIBS)) $(filter -lxml2, $(LIBS)) ++PG_CPPFLAGS = $(shell xml2-config --cflags) ++SHLIB_LINK += $(shell xml2-config --libs) $(shell xslt-config --libs) + + DATA_built = pgxml.sql + DATA = uninstall_pgxml.sql +diff -Naur a/GNUmakefile.in b/GNUmakefile.in +--- a/GNUmakefile.in 2011-02-02 07:33:35.965875227 -0500 ++++ b/GNUmakefile.in 2011-02-06 22:51:03.324452001 -0500 +@@ -11,19 +11,16 @@ + all: + $(MAKE) -C doc all + $(MAKE) -C src all +- $(MAKE) -C config all + @echo "All of PostgreSQL successfully made. Ready to install." + + install: + $(MAKE) -C doc $@ + $(MAKE) -C src $@ +- $(MAKE) -C config $@ + @echo "PostgreSQL installation complete." + + installdirs uninstall: + $(MAKE) -C doc $@ + $(MAKE) -C src $@ +- $(MAKE) -C config $@ + + distprep: + $(MAKE) -C doc $@ +diff -Naur a/src/bin/initdb/Makefile b/src/bin/initdb/Makefile +--- a/src/bin/initdb/Makefile 2011-02-02 07:34:33.955427762 -0500 ++++ b/src/bin/initdb/Makefile 2011-02-07 05:13:51.232552002 -0500 +@@ -14,7 +14,7 @@ + top_builddir = ../../.. + include $(top_builddir)/src/Makefile.global + +-override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS) ++override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/libpq $(CPPFLAGS) + + OBJS= initdb.o encnames.o pqsignal.o $(WIN32RES) + +diff -Naur a/src/bin/Makefile b/src/bin/Makefile +--- a/src/bin/Makefile 2011-02-02 07:34:33.915431850 -0500 ++++ b/src/bin/Makefile 2011-02-07 05:14:49.751797001 -0500 +@@ -13,8 +13,7 @@ + top_builddir = ../.. + include $(top_builddir)/src/Makefile.global + +-DIRS = initdb ipcclean pg_ctl pg_dump \ +- psql scripts pg_config pg_controldata pg_resetxlog ++DIRS = initdb ipcclean pg_ctl pg_controldata pg_resetxlog + ifeq ($(PORTNAME), win32) + DIRS+=pgevent + endif +diff -Naur a/src/include/pg_config_manual.h b/src/include/pg_config_manual.h +--- a/src/include/pg_config_manual.h 2011-02-02 07:34:43.865352011 -0500 ++++ b/src/include/pg_config_manual.h 2011-02-07 05:15:36.915367001 -0500 +@@ -184,7 +184,7 @@ + * here's where to twiddle it. You can also override this at runtime + * with the postmaster's -k switch. + */ +-#define DEFAULT_PGSOCKET_DIR "/tmp" ++#define DEFAULT_PGSOCKET_DIR "/var/run/postgresql" + + /* + * The random() function is expected to yield values between 0 and +diff -Naur a/src/Makefile b/src/Makefile +--- a/src/Makefile 2011-02-02 07:33:57.615708236 -0500 ++++ b/src/Makefile 2011-02-07 05:17:23.898832002 -0500 +@@ -19,14 +19,11 @@ + $(MAKE) -C backend $@ + $(MAKE) -C backend/utils/mb/conversion_procs $@ + $(MAKE) -C backend/snowball $@ +- $(MAKE) -C include $@ +- $(MAKE) -C interfaces $@ + $(MAKE) -C bin $@ + $(MAKE) -C pl $@ +- $(MAKE) -C makefiles $@ + $(MAKE) -C test/regress $@ + +-install: install-local ++install: + + install-local: installdirs-local + $(INSTALL_DATA) Makefile.global '$(DESTDIR)$(pgxsdir)/$(subdir)/Makefile.global' +diff -Naur a/src/Makefile.global.in b/src/Makefile.global.in +--- a/src/Makefile.global.in 2011-02-02 07:33:57.635706175 -0500 ++++ b/src/Makefile.global.in 2011-02-07 05:19:34.754227002 -0500 +@@ -373,10 +373,8 @@ + + + submake-libpq: +- $(MAKE) -C $(libpq_builddir) all + + submake-libpgport: +- $(MAKE) -C $(top_builddir)/src/port all + + .PHONY: submake-libpq submake-libpgport + +@@ -419,6 +417,7 @@ + LDFLAGS += $(PROFILE) + endif + ++CFLAGS += -I$(top_srcdir)/src/include + + ########################################################################## + # +diff -Naur a/src/port/Makefile b/src/port/Makefile +--- a/src/port/Makefile 2011-02-02 07:34:54.435268853 -0500 ++++ b/src/port/Makefile 2011-02-07 05:23:21.077332001 -0500 +@@ -35,11 +35,10 @@ + # foo_srv.o and foo.o are both built from foo.c, but only foo.o has -DFRONTEND + OBJS_SRV = $(OBJS:%.o=%_srv.o) + +-all: libpgport.a libpgport_srv.a ++all: libpgport_srv.a + + # libpgport is needed by some contrib +-install: all installdirs +- $(INSTALL_STLIB) libpgport.a '$(DESTDIR)$(libdir)/libpgport.a' ++install: + + installdirs: + $(mkinstalldirs) '$(DESTDIR)$(libdir)' |