Skip to content
Snippets Groups Projects
  1. Jan 16, 2015
    • Noah Misch's avatar
      Update "pg_regress --no-locale" for Darwin and Windows. · 28df6a0d
      Noah Misch authored
      Commit 894459e5 revealed this option to
      be broken for NLS builds on Darwin, but "make -C contrib/unaccent check"
      and the buildfarm client rely on it.  Fix that configuration by
      redefining the option to imply LANG=C on Darwin.  In passing, use LANG=C
      instead of LANG=en on Windows; since only postmaster startup uses that
      value, testers are unlikely to notice the change.  Back-patch to 9.0,
      like the predecessor commit.
      28df6a0d
  2. Jan 06, 2015
  3. Dec 25, 2014
  4. Dec 18, 2014
    • Noah Misch's avatar
      Lock down regression testing temporary clusters on Windows. · f6dc6dd5
      Noah Misch authored
      Use SSPI authentication to allow connections exclusively from the OS
      user that launched the test suite.  This closes on Windows the
      vulnerability that commit be76a6d3
      closed on other platforms.  Users of "make installcheck" or custom test
      harnesses can run "pg_regress --config-auth=DATADIR" to activate the
      same authentication configuration that "make check" would use.
      Back-patch to 9.0 (all supported versions).
      
      Security: CVE-2014-0067
      f6dc6dd5
  5. Jun 14, 2014
    • Noah Misch's avatar
      Secure Unix-domain sockets of "make check" temporary clusters. · be76a6d3
      Noah Misch authored
      Any OS user able to access the socket can connect as the bootstrap
      superuser and proceed to execute arbitrary code as the OS user running
      the test.  Protect against that by placing the socket in a temporary,
      mode-0700 subdirectory of /tmp.  The pg_regress-based test suites and
      the pg_upgrade test suite were vulnerable; the $(prove_check)-based test
      suites were already secure.  Back-patch to 8.4 (all supported versions).
      The hazard remains wherever the temporary cluster accepts TCP
      connections, notably on Windows.
      
      As a convenient side effect, this lets testing proceed smoothly in
      builds that override DEFAULT_PGSOCKET_DIR.  Popular non-default values
      like /var/run/postgresql are often unwritable to the build user.
      
      Security: CVE-2014-0067
      be76a6d3
  6. May 06, 2014
    • Bruce Momjian's avatar
      pgindent run for 9.4 · 0a783200
      Bruce Momjian authored
      This includes removing tabs after periods in C comments, which was
      applied to back branches, so this change should not effect backpatching.
      0a783200
  7. May 05, 2014
    • Heikki Linnakangas's avatar
      Replace SYSTEMQUOTEs with Windows-specific wrapper functions. · a692ee58
      Heikki Linnakangas authored
      It's easy to forget using SYSTEMQUOTEs when constructing command strings
      for system() or popen(). Even if we fix all the places missing it now, it is
      bound to be forgotten again in the future. Introduce wrapper functions that
      do the the extra quoting for you, and get rid of SYSTEMQUOTEs in all the
      callers.
      
      We previosly used SYSTEMQUOTEs in all the hard-coded command strings, and
      this doesn't change the behavior of those. But user-supplied commands, like
      archive_command, restore_command, COPY TO/FROM PROGRAM calls, as well as
      pgbench's \shell, will now gain an extra pair of quotes. That is desirable,
      but if you have existing scripts or config files that include an extra
      pair of quotes, those might need to be adjusted.
      
      Reviewed by Amit Kapila and Tom Lane
      a692ee58
  8. Apr 05, 2014
    • Tom Lane's avatar
      Make sure -D is an absolute path when starting server on Windows. · 9aca5125
      Tom Lane authored
      This is needed because Windows services may get started with a different
      current directory than where pg_ctl is executed.  We want relative -D
      paths to be interpreted relative to pg_ctl's CWD, similarly to what
      happens on other platforms.
      
      In support of this, move the backend's make_absolute_path() function
      into src/port/path.c (where it probably should have been long since)
      and get rid of the rather inferior version in pg_regress.
      
      Kumar Rajeev Rastogi, reviewed by MauMau
      9aca5125
  9. Mar 29, 2014
    • Noah Misch's avatar
      Revert "Secure Unix-domain sockets of "make check" temporary clusters." · 8f5578d0
      Noah Misch authored
      About half of the buildfarm members use too-long directory names,
      strongly suggesting that this approach is a dead end.
      8f5578d0
    • Noah Misch's avatar
      Secure Unix-domain sockets of "make check" temporary clusters. · 31c6e54e
      Noah Misch authored
      Any OS user able to access the socket can connect as the bootstrap
      superuser and in turn execute arbitrary code as the OS user running the
      test.  Protect against that by placing the socket in the temporary data
      directory, which has mode 0700 thanks to initdb.  Back-patch to 8.4 (all
      supported versions).  The hazard remains wherever the temporary cluster
      accepts TCP connections, notably on Windows.
      
      Attempts to run "make check" from a directory with a long name will now
      fail.  An alternative not sharing that problem was to place the socket
      in a subdirectory of /tmp, but that is only secure if /tmp is sticky.
      The PG_REGRESS_SOCK_DIR environment variable is available as a
      workaround when testing from long directory paths.
      
      As a convenient side effect, this lets testing proceed smoothly in
      builds that override DEFAULT_PGSOCKET_DIR.  Popular non-default values
      like /var/run/postgresql are often unwritable to the build user.
      
      Security: CVE-2014-0067
      31c6e54e
  10. Mar 13, 2014
  11. Mar 03, 2014
    • Peter Eisentraut's avatar
      Fix whitespace · de94b47c
      Peter Eisentraut authored
      de94b47c
    • Stephen Frost's avatar
      Another round of Coverity fixes · 5592ebac
      Stephen Frost authored
      Additional non-security issues/improvements spotted by Coverity.
      
      In backend/libpq, no sense trying to protect against port->hba being
      NULL after we've already dereferenced it in the switch() statement.
      
      Prevent against possible overflow due to 32bit arithmitic in
      basebackup throttling (not yet released, so no security concern).
      
      Remove nonsensical check of array pointer against NULL in procarray.c,
      looks to be a holdover from 9.1 and earlier when there were pointers
      being used but now it's just an array.
      
      Remove pointer check-against-NULL in tsearch/spell.c as we had already
      dereferenced it above (in the strcmp()).
      
      Remove dead code from adt/orderedsetaggs.c, isnull is checked
      immediately after each tuplesort_getdatum() call and if true we return,
      so no point checking it again down at the bottom.
      
      Remove recently added minor error-condition memory leak in pg_regress.
      5592ebac
  12. Mar 02, 2014
    • Stephen Frost's avatar
      Various Coverity-spotted fixes · b1aebbb6
      Stephen Frost authored
      A number of issues were identified by the Coverity scanner and are
      addressed in this patch.  None of these appear to be security issues
      and many are mostly cosmetic changes.
      
      Short comments for each of the changes follows.
      
      Correct the semi-colon placement in be-secure.c regarding SSL retries.
      Remove a useless comparison-to-NULL in proc.c (value is dereferenced
        prior to this check and therefore can't be NULL).
      Add checking of chmod() return values to initdb.
      Fix a couple minor memory leaks in initdb.
      Fix memory leak in pg_ctl- involves free'ing the config file contents.
      Use an int to capture fgetc() return instead of an enum in pg_dump.
      Fix minor memory leaks in pg_dump.
        (note minor change to convertOperatorReference()'s API)
      Check fclose()/remove() return codes in psql.
      Check fstat(), find_my_exec() return codes in psql.
      Various ECPG memory leak fixes.
      Check find_my_exec() return in ECPG.
      Explicitly ignore pqFlush return in libpq error-path.
      Change PQfnumber() to avoid doing an strdup() when no changes required.
      Remove a few useless check-against-NULL's (value deref'd beforehand).
      Check rmtree(), malloc() results in pg_regress.
      Also check get_alternative_expectfile() return in pg_regress.
      b1aebbb6
  13. Feb 17, 2014
    • Tom Lane's avatar
      Prevent potential overruns of fixed-size buffers. · 01824385
      Tom Lane authored
      Coverity identified a number of places in which it couldn't prove that a
      string being copied into a fixed-size buffer would fit.  We believe that
      most, perhaps all of these are in fact safe, or are copying data that is
      coming from a trusted source so that any overrun is not really a security
      issue.  Nonetheless it seems prudent to forestall any risk by using
      strlcpy() and similar functions.
      
      Fixes by Peter Eisentraut and Jozef Mlich based on Coverity reports.
      
      In addition, fix a potential null-pointer-dereference crash in
      contrib/chkpass.  The crypt(3) function is defined to return NULL on
      failure, but chkpass.c didn't check for that before using the result.
      The main practical case in which this could be an issue is if libc is
      configured to refuse to execute unapproved hashing algorithms (e.g.,
      "FIPS mode").  This ideally should've been a separate commit, but
      since it touches code adjacent to one of the buffer overrun changes,
      I included it in this commit to avoid last-minute merge issues.
      This issue was reported by Honza Horak.
      
      Security: CVE-2014-0065 for buffer overruns, CVE-2014-0066 for crypt()
      01824385
  14. Jan 07, 2014
  15. Nov 13, 2013
    • Kevin Grittner's avatar
      Free ignorelist after each regression test schedule. · fe67d252
      Kevin Grittner authored
      It's a trivial amount of RAM held until the end of the regression
      test run; but it's probably worth fixing to silence future warnings
      from code analyzers.
      
      This was the only memory leak pointed out by clang's static code
      analysis tool.
      fe67d252
  16. Nov 08, 2013
  17. Oct 23, 2013
    • Tom Lane's avatar
      Replace pg_asprintf() with psprintf(). · 2c66f992
      Tom Lane authored
      This eliminates an awkward coding pattern that's also unnecessarily
      inconsistent with backend coding.  psprintf() is now the thing to
      use everywhere.
      2c66f992
  18. Oct 13, 2013
  19. Jan 30, 2013
  20. Jan 01, 2013
  21. Dec 01, 2012
    • Tom Lane's avatar
      Prevent passing gmake's environment variables down through pg_regress. · c35fea10
      Tom Lane authored
      When we do "make install" to create a temp installation, we don't want
      that instance of make to try to communicate with any instance of make
      that might be calling us.  This is known to cause problems if the
      upper make has a -jN flag, and in principle could cause problems even
      without that.  Unset the relevant environment variables to prevent such
      issues.
      
      Andres Freund
      c35fea10
  22. Nov 30, 2012
  23. Jul 22, 2012
  24. Jun 10, 2012
  25. Apr 24, 2012
  26. Mar 17, 2012
    • Andrew Dunstan's avatar
      Honor inputdir and outputdir when converting regression files. · e3fc4a97
      Andrew Dunstan authored
      When converting source files, pg_regress' inputdir and outputdir options were
      ignored when computing the locations of the destination files. In consequence,
      these options were effectively unusable when the regression inputs need to
      be adjusted by pg_regress. This patch makes pg_regress put the converted files
      in the same place that these options specify non-converted input or results
      files are to be found. Backpatched to all live branches.
      e3fc4a97
  27. Feb 21, 2012
  28. Jan 02, 2012
  29. Aug 30, 2011
  30. Aug 23, 2011
  31. Jun 18, 2011
  32. Jun 09, 2011
  33. May 16, 2011
  34. Apr 28, 2011
  35. Apr 25, 2011
    • Peter Eisentraut's avatar
      Support "make check" in contrib · f8ebe3bc
      Peter Eisentraut authored
      Added a new option --extra-install to pg_regress to arrange installing
      the respective contrib directory into the temporary installation.
      This is currently not yet supported for Windows MSVC builds.
      
      Updated the .gitignore files for contrib modules to ignore the
      leftovers of a temp-install check run.
      
      Changed the exit status of "make check" in a pgxs build (which still
      does nothing) to 0 from 1.
      
      Added "make check" in contrib to top-level "make check-world".
      f8ebe3bc
    • Andrew Dunstan's avatar
      Assorted minor changes to silence Windows compiler warnings. · 860be17e
      Andrew Dunstan authored
      Mostly to do with macro redefinitions or object signedness.
      860be17e
  36. Apr 19, 2011
Loading