Skip to content

Commit 80e2694

Browse files
committed
Don't try to create a temp install without abs_top_builddir.
Otherwise, we effectively act as if abs_top_builddir were the root directory, which is quite dangerous if the user happens to have permissions to do things there. This can crop up in PGXS builds, for example. Report by Sandro Santilli, patch by me, review by Noah Misch.
1 parent 27af56b commit 80e2694

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Makefile.global.in

+2
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,15 @@ check: temp-install
320320
.PHONY: temp-install
321321
temp-install:
322322
ifndef NO_TEMP_INSTALL
323+
ifneq ($(abs_top_builddir),)
323324
ifeq ($(MAKELEVEL),0)
324325
rm -rf '$(abs_top_builddir)'/tmp_install
325326
$(MKDIR_P) '$(abs_top_builddir)'/tmp_install/log
326327
$(MAKE) -C '$(top_builddir)' DESTDIR='$(abs_top_builddir)'/tmp_install install >'$(abs_top_builddir)'/tmp_install/log/install.log 2>&1
327328
endif
328329
$(if $(EXTRA_INSTALL),for extra in $(EXTRA_INSTALL); do $(MAKE) -C '$(top_builddir)'/$$extra DESTDIR='$(abs_top_builddir)'/tmp_install install >>'$(abs_top_builddir)'/tmp_install/log/install.log || exit; done)
329330
endif
331+
endif
330332

331333
PROVE = @PROVE@
332334
PG_PROVE_FLAGS = -I $(top_srcdir)/src/test/perl/

0 commit comments

Comments
 (0)