[postgis-tickets] [SCM] PostGIS branch stable-3.0 updated. 3.0.6-10-g999c3360d
git at osgeo.org
git at osgeo.org
Fri Aug 12 02:23:09 PDT 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, stable-3.0 has been updated
via 999c3360debcf4f610288e737216dba5272a425b (commit)
via d4c55c6c5562ab286e5a78d7675c8d000913d82c (commit)
from 506943604d2d5336691838e16cb7ec4cf119d0dc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 999c3360debcf4f610288e737216dba5272a425b
Author: Sandro Santilli <strk at kbt.io>
Date: Fri Aug 12 11:22:55 2022 +0200
Allow running `make staged-install` from top-level dir
diff --git a/GNUmakefile.in b/GNUmakefile.in
index becf84970..e159a8bf0 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -41,6 +41,9 @@ test: check
check: check-no-trailing-blanks check-unit check-regress docs-check check-news
+staged-install: all
+ $(MAKE) -C regress staged-install
+
check-news:
utils/check_news.sh
@@ -181,4 +184,4 @@ endif
postgis_revision.h:
$(PERL) utils/repo_revision.pl
-.PHONY: utils liblwgeom ChangeLog raster
\ No newline at end of file
+.PHONY: utils liblwgeom ChangeLog raster
commit d4c55c6c5562ab286e5a78d7675c8d000913d82c
Author: Sandro Santilli <strk at kbt.io>
Date: Tue Jul 12 07:30:57 2022 +0200
Package objects before upgrading (only those which exist)
We don't need to upgrade before packaging because objects
created during extension upgrade are automatically packaged.
Packaging upfront fixes creating PostGIS extension from
unpackaged on PostgreSQL versions 10.22, 11.17+, 12.12+, 13.8+
and 14.5+ addressing CVE-2022-2625, see:
https://www.postgresql.org/support/security/CVE-2022-2625/
References #5209 in 3.0 branch (3.0.7dev)
This is a backport of cb65cd8973 which landed in master branch
on July 12 2022.
diff --git a/extensions/postgis/Makefile.in b/extensions/postgis/Makefile.in
index 68f7df6e8..bf1019d8a 100644
--- a/extensions/postgis/Makefile.in
+++ b/extensions/postgis/Makefile.in
@@ -55,6 +55,7 @@ EXTENSION_UPGRADE_SCRIPTS = \
# Scripts making up the extension upgrade-from-unpackaged file
# NOTE: order matters
+# TODO: DROPME
EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS = \
sql/postgis.sql
@@ -99,12 +100,10 @@ sql/raster_unpackage.sql: $(RASTER_DROP_SCRIPTS) | sql
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql | sql
cp $< $@
-sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) sql/$(EXTENSION)--ANY--$(EXTVERSION).sql ../../utils/create_unpackaged.pl Makefile | sql
- # Ensure version is correct
- cat sql/$(EXTENSION)--ANY--$(EXTVERSION).sql > $@
- cat $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) \
- | $(PERL) ../../utils/create_unpackaged.pl postgis \
- >> $@
+sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql/$(EXTENSION)--ANY--$(EXTVERSION).sql ../../utils/create_unpackaged.pl Makefile | sql
+ cat sql/$(EXTENSION)--$(EXTVERSION).sql | $(PERL) @top_srcdir@/utils/create_unpackaged.pl postgis > $@
+ # Upgrade after packaging
+ cat $< >> $@
sql/$(EXTENSION)--unpackaged.sql: Makefile | sql
echo "-- Nothing to do here" > $@
diff --git a/extensions/postgis_raster/Makefile.in b/extensions/postgis_raster/Makefile.in
index 678537001..84d8031c7 100644
--- a/extensions/postgis_raster/Makefile.in
+++ b/extensions/postgis_raster/Makefile.in
@@ -81,10 +81,10 @@ sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql | sql
sql/$(EXTENSION)--unpackaged.sql: Makefile | sql
echo "-- Nothing to do here" > $@
-sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) ../../utils/create_unpackaged.pl sql/$(EXTENSION)--ANY--$(EXTVERSION).sql Makefile | sql
- # Ensure version is correct
- cat sql/$(EXTENSION)--ANY--$(EXTVERSION).sql > $@
- cat $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) | $(PERL) ../../utils/create_unpackaged.pl postgis_raster >> $@
+sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) | ../../utils/create_unpackaged.pl sql/$(EXTENSION)--ANY--$(EXTVERSION).sql Makefile sql
+ cat $^ | $(PERL) @top_srcdir@/utils/create_unpackaged.pl postgis_raster > $@
+ # Upgrade after packaging
+ cat sql/$(EXTENSION)--ANY--$(EXTVERSION).sql >> $@
unpackaged_check.sql: unpackaged_check.sql.in Makefile
cat $< \
diff --git a/extensions/postgis_sfcgal/Makefile.in b/extensions/postgis_sfcgal/Makefile.in
index 7663330b0..f711015e7 100644
--- a/extensions/postgis_sfcgal/Makefile.in
+++ b/extensions/postgis_sfcgal/Makefile.in
@@ -85,12 +85,12 @@ sql/$(EXTENSION)--unpackaged.sql: Makefile | sql
#grep all lines that start with CREATE OR REPLACE FUNCTION, TRIGGER...
#then replace CREATE OR REPLACE .. with ALTER EXTENSION..;
#then remove default values and extra junk
-sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) sql/$(EXTENSION)--ANY--$(EXTVERSION).sql ../../utils/create_unpackaged.pl Makefile | sql
- # Ensure version is correct
- cat sql/$(EXTENSION)--ANY--$(EXTVERSION).sql > $@
- cat $(EXTENSION_UNPACKAGED_UPGRADE_SCRIPTS) \
- | $(PERL) ../../utils/create_unpackaged.pl ${EXTENSION} \
- >> $@
+sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql_bits/sfcgal.sql sql/$(EXTENSION)--ANY--$(EXTVERSION).sql ../../utils/create_unpackaged.pl Makefile | sql
+ cat $< \
+ | $(PERL) @top_srcdir@/utils/create_unpackaged.pl ${EXTENSION} \
+ > $@
+ # Upgrade after packaging
+ cat sql/$(EXTENSION)--ANY--$(EXTVERSION).sql >> $@
sql_bits/sfcgal_upgrade.sql : ../../postgis/sfcgal_upgrade.sql
mkdir -p sql_bits
diff --git a/extensions/postgis_topology/Makefile.in b/extensions/postgis_topology/Makefile.in
index 8b95ab447..93714d4fa 100644
--- a/extensions/postgis_topology/Makefile.in
+++ b/extensions/postgis_topology/Makefile.in
@@ -77,9 +77,9 @@ sql/$(EXTENSION)--unpackaged.sql: Makefile | sql
echo "-- Nothing to do here" > $@
sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: ../../topology/topology.sql ../../utils/create_unpackaged.pl sql/topology_upgrade.sql Makefile | sql
- # Ugprade before packaging
- cat sql/topology_upgrade.sql > $@
- cat $< | $(PERL) ../../utils/create_unpackaged.pl postgis_topology >> $@
+ cat $< | $(PERL) @top_srcdir@/utils/create_unpackaged.pl postgis_topology > $@
+ # Ugprade after packaging (TODO: use ANY--TARGET path?)
+ cat sql/topology_upgrade.sql >> $@
#upgrade script should have everything but table, schema, type creation/alter
#NOTE: we assume all object definitions end in ;
diff --git a/utils/create_unpackaged.pl b/utils/create_unpackaged.pl
index aee76a9af..1baac4bee 100755
--- a/utils/create_unpackaged.pl
+++ b/utils/create_unpackaged.pl
@@ -4,7 +4,7 @@
# PostGIS - Spatial Types for PostgreSQL
# http://postgis.net
#
-# Copyright (C) 2013 Sandro Santilli <strk at kbt.io>
+# Copyright (C) 2013-2022 Sandro Santilli <strk at kbt.io>
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU General Public Licence. See the COPYING file.
@@ -144,15 +144,29 @@ sub add_if_not_exists
print <<"EOF"
DO \$\$
BEGIN
- ALTER EXTENSION $extname ADD $obj;
- RAISE NOTICE 'newly registered $obj';
-EXCEPTION WHEN object_not_in_prerequisite_state THEN
+
+ -- TODO: check if ownership of the object
+ -- matches ownership of the extension
+ -- the object to the extension
+
+ ALTER EXTENSION $extname ADD $obj;
+ RAISE NOTICE 'newly registered $obj';
+
+EXCEPTION
+WHEN object_not_in_prerequisite_state THEN
IF SQLERRM ~ '\\m$extname\\M'
THEN
RAISE NOTICE 'already registered $obj';
ELSE
RAISE EXCEPTION '%', SQLERRM;
END IF;
+WHEN
+ undefined_function
+ -- TODO: handle more exceptions ?
+THEN
+ RAISE NOTICE 'undefined function $obj';
+WHEN OTHERS THEN
+ RAISE EXCEPTION 'Trying to add $obj to $extname, got % (%)', SQLERRM, SQLSTATE;
END;
\$\$ LANGUAGE 'plpgsql';
EOF
-----------------------------------------------------------------------
Summary of changes:
GNUmakefile.in | 5 ++++-
extensions/postgis/Makefile.in | 11 +++++------
extensions/postgis_raster/Makefile.in | 8 ++++----
extensions/postgis_sfcgal/Makefile.in | 12 ++++++------
extensions/postgis_topology/Makefile.in | 6 +++---
utils/create_unpackaged.pl | 22 ++++++++++++++++++----
6 files changed, 40 insertions(+), 24 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list